]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Enable tests of fetch/offset for mariadb>=10.6
authorFederico Caselli <cfederico87@gmail.com>
Mon, 4 Oct 2021 15:59:42 +0000 (17:59 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Fri, 8 Oct 2021 12:05:57 +0000 (14:05 +0200)
Fixes: #6999
Change-Id: I29cf3908a6c872611409a3e7256296314c81dea1

lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/test_select.py
test/requirements.py

index f6e79042c99617a133b294b67be0867c2e871536..a546e1febc064a9cdaad8bc606220799d0c70571 100644 (file)
@@ -1440,6 +1440,15 @@ class SuiteRequirements(Requirements):
         """
         return exclusions.closed()
 
+    @property
+    def fetch_expression(self):
+        """backend supports fetch / offset with expression in them, like
+
+        SELECT * FROM some_table
+        OFFSET 1 + 1 ROWS FETCH FIRST 1 + 1 ROWS ONLY
+        """
+        return exclusions.closed()
+
     @property
     def autoincrement_without_sequence(self):
         """If autoincrement=True on a column does not require an explicit
index c96c62a458e7650043afc6835e75b347413d0c06..a3475f651b46b681d3fa776a9e89269a44bc815e 100644 (file)
@@ -467,6 +467,7 @@ class FetchLimitOffsetTest(fixtures.TablesTest):
         )
 
     @testing.requires.fetch_first
+    @testing.requires.fetch_expression
     def test_expr_fetch_offset(self, connection):
         table = self.tables.some_table
         self._assert_result(
index 221a1dafa208fd71e19e666762ba237120f46de3..721bb8ba376ddf8b951746e54ba596e457185168 100644 (file)
@@ -1769,7 +1769,9 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def fetch_first(self):
-        return only_on(["postgresql", "mssql >= 11", "oracle >= 12"])
+        return only_on(
+            ["postgresql", "mssql >= 11", "oracle >= 12", "mariadb >= 10.6"]
+        )
 
     @property
     def fetch_percent(self):
@@ -1777,16 +1779,29 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def fetch_ties(self):
-        return only_on(["postgresql >= 13", "mssql >= 11", "oracle >= 12"])
+        return only_on(
+            [
+                "postgresql >= 13",
+                "mssql >= 11",
+                "oracle >= 12",
+                "mariadb >= 10.6",
+            ]
+        )
 
     @property
     def fetch_no_order_by(self):
-        return only_on(["postgresql", "oracle >= 12"])
+        return only_on(["postgresql", "oracle >= 12", "mariadb >= 10.6"])
 
     @property
     def fetch_offset_with_options(self):
+        # use together with fetch_first
         return skip_if("mssql")
 
+    @property
+    def fetch_expression(self):
+        # use together with fetch_first
+        return skip_if("mariadb")
+
     @property
     def autoincrement_without_sequence(self):
         return skip_if("oracle")