diff options
| author | Nathaniel Conroy <nathanielaconroy@gmail.com> | 2023-11-26 18:36:56 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-11-27 09:20:10 +0100 |
| commit | 0257426fe1fe9d146fd5813f09d909917ff59360 (patch) | |
| tree | 1ed6e139e8f84e987405d2cc48bf5f7a44227004 /tests | |
| parent | 0203771b626c27c1af24cdeb0e425ccca3d19ad5 (diff) | |
Fixed #34992 -- Fixed DatabaseFeatures.allows_group_by_selected_pks on MariaDB with ONLY_FULL_GROUP_BY sql mode.
Regression in 041551d716b69ee7c81199eee86a2d10a72e15ab.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/backends/mysql/test_features.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/backends/mysql/test_features.py b/tests/backends/mysql/test_features.py index 96e1ed3b49..4e5c7c294f 100644 --- a/tests/backends/mysql/test_features.py +++ b/tests/backends/mysql/test_features.py @@ -28,3 +28,21 @@ class TestFeatures(TestCase): _connection.sql_mode = {"NO_AUTO_VALUE_ON_ZERO"} database_features = DatabaseFeatures(_connection) self.assertIs(database_features.allows_auto_pk_0, True) + + def test_allows_group_by_selected_pks(self): + with mock.MagicMock() as _connection: + _connection.mysql_is_mariadb = False + database_features = DatabaseFeatures(_connection) + self.assertIs(database_features.allows_group_by_selected_pks, True) + + with mock.MagicMock() as _connection: + _connection.mysql_is_mariadb = False + _connection.sql_mode = {} + database_features = DatabaseFeatures(_connection) + self.assertIs(database_features.allows_group_by_selected_pks, True) + + with mock.MagicMock() as _connection: + _connection.mysql_is_mariadb = True + _connection.sql_mode = {"ONLY_FULL_GROUP_BY"} + database_features = DatabaseFeatures(_connection) + self.assertIs(database_features.allows_group_by_selected_pks, False) |
