Correct detection of row_number support for MariaDB (#57663)

This commit is contained in:
Erik Montnemery 2021-10-14 20:19:39 +02:00 committed by GitHub
parent e27e4c3561
commit 8ef8838801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -311,7 +311,9 @@ def setup_connection_for_dialect(
result = query_on_connection(dbapi_connection, "SELECT VERSION()")
version = result[0][0]
major, minor, _patch = version.split(".", 2)
if int(major) == 5 and int(minor) < 8:
if (int(major) == 5 and int(minor) < 8) or (
int(major) == 10 and int(minor) < 2
):
instance._db_supports_row_number = ( # pylint: disable=[protected-access]
False
)

View File

@ -125,7 +125,8 @@ async def test_last_run_was_recently_clean(hass):
@pytest.mark.parametrize(
"mysql_version, db_supports_row_number",
[
("10.0.0", True),
("10.2.0", True),
("10.1.0", False),
("5.8.0", True),
("5.7.0", False),
],