From: Federico Caselli Date: Mon, 4 Oct 2021 15:59:42 +0000 (+0200) Subject: Enable tests of fetch/offset for mariadb>=10.6 X-Git-Tag: rel_1_4_26~31^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d581161b3cbea06b0d4f612b9f8be2781f1ae5c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Enable tests of fetch/offset for mariadb>=10.6 Fixes: #6999 Change-Id: I29cf3908a6c872611409a3e7256296314c81dea1 --- diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index f6e79042c9..a546e1febc 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -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 diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index c96c62a458..a3475f651b 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -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( diff --git a/test/requirements.py b/test/requirements.py index 221a1dafa2..721bb8ba37 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -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")