Fixed DatabaseFeatures.supports_select_(intersection/difference) on MariaDB and MySQL 8.0.31+.

This commit is contained in:
Mariusz Felisiak 2022-10-25 20:01:25 +02:00 committed by GitHub
parent c0fc1b5302
commit 6d41f5e5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -20,8 +20,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
atomic_transactions = False atomic_transactions = False
can_clone_databases = True can_clone_databases = True
supports_temporal_subtraction = True supports_temporal_subtraction = True
supports_select_intersection = False
supports_select_difference = False
supports_slicing_ordering_in_compound = True supports_slicing_ordering_in_compound = True
supports_index_on_text_field = False supports_index_on_text_field = False
supports_update_conflicts = True supports_update_conflicts = True
@ -322,6 +320,15 @@ class DatabaseFeatures(BaseDatabaseFeatures):
and self.connection.mysql_version >= (8, 0, 13) and self.connection.mysql_version >= (8, 0, 13)
) )
@cached_property
def supports_select_intersection(self):
is_mariadb = self.connection.mysql_is_mariadb
return is_mariadb or self.connection.mysql_version >= (8, 0, 31)
supports_select_difference = property(
operator.attrgetter("supports_select_intersection")
)
@cached_property @cached_property
def can_rename_index(self): def can_rename_index(self):
if self.connection.mysql_is_mariadb: if self.connection.mysql_is_mariadb: