Issue #2939760: allow granular overriding of sql_mode options
Merge request reports
Activity
added 87 commits
-
175deaa6...dcefcaa2 - 84 commits from branch
project:9.4.x
- 9971b23f - Changed sql_mode to be set with an array of options rather than a string.
- c4ac692d - Fixed sql_mode getting written into connection options init_commands in migrate tests.
- f6f13759 - Removed use of deprecated sql_mode option in tests.
Toggle commit list-
175deaa6...dcefcaa2 - 84 commits from branch
added 4187 commits
- f6f13759...4f2c136f - 4177 earlier commits
- 68373895 - Issue #3442660 by catch, smustgrave: Remove deprecated code from jsonapi and serialization modules
- 79eed4ac - Issue #1561214 by mfb, sun, fietserwin, drzraf, sdrycroft, nicxvan: Bootstrap...
- 22707d5c - Issue #3437839 by catch, Luke.Leber, thejimbirch: Only send libraries with...
- 7f4b5f18 - Issue #144538 by acbramley, tuutti, Damien Tournoud, alexpott, solideogloria,...
- 166f3a39 - Issue #3439369 by fromme, quietone, pradhumanjain2311, smustgrave, alexpott:...
- 1c914f2d - Issue #3432868 by smustgrave, obsidian_, longwave, quietone, mstrelan, catch:...
- 941b7e79 - Issue #3439871 by SolimanHarkas, vensires: Fix Help tests that rely on UID1's super user behavior
- d59413ca - Changed sql_mode to be set with an array of options rather than a string.
- 5e09d7e0 - Fixed sql_mode getting written into connection options init_commands in migrate tests.
- 161a7cb5 - Removed use of deprecated sql_mode option in tests.
Toggle commit list- Resolved by Joachim Noreiko
added 2 commits
- Resolved by Joachim Noreiko
added 1 commit
- 64d5f065 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
added 159 commits
-
64d5f065...966fd63a - 150 commits from branch
project:11.x
- 7d2430f7 - Changed sql_mode to be set with an array of options rather than a string.
- 43841a9c - Fixed sql_mode getting written into connection options init_commands in migrate tests.
- 603690e3 - Removed use of deprecated sql_mode option in tests.
- 3c321188 - Changed sql_mode_options to be at the top level of the connection options array.
- 2fdc03cb - Updated deprecation message.
- f777a4fb - Fixed handling of sqlmode_ansi_quotes.
- e3d297e1 - Removed deprecation handling.
- ee2097da - Unset sql_mode init command.
- 6a888965 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
Toggle commit list-
64d5f065...966fd63a - 150 commits from branch
added 1 commit
- 28f88f74 - Add example of sql_mode_options usage to default.settings.php
added 1 commit
- a1f806d5 - Use TRUE rather than true in default.settings.php comment.
added 14 commits
-
4a4a78b5 - 1 commit from branch
project:11.x
- 4a4a78b5...7bb61c6c - 3 earlier commits
- bd1e078f - Changed sql_mode_options to be at the top level of the connection options array.
- 13c8480a - Updated deprecation message.
- 4247fa0c - Fixed handling of sqlmode_ansi_quotes.
- 38ebe044 - Removed deprecation handling.
- 0a50bff8 - Unset sql_mode init command.
- 405cecb3 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
- d92e9214 - Add example of sql_mode_options usage to default.settings.php
- d1dacfc3 - Use TRUE rather than true in default.settings.php comment.
- fbe988dc - Revert "Use TRUE rather than true in default.settings.php comment."
- 4f555b5f - Revert "Add example of sql_mode_options usage to default.settings.php"
Toggle commit list-
4a4a78b5 - 1 commit from branch
added 1 commit
- e4b80c30 - Copy default.settings.php to scaffold asset files.
added 15 commits
-
e4b80c30...152b7f06 - 3 commits from branch
project:11.x
- 152b7f06...3337783f - 2 earlier commits
- 22e08821 - Removed use of deprecated sql_mode option in tests.
- 9df20fa9 - Changed sql_mode_options to be at the top level of the connection options array.
- 50d21b79 - Updated deprecation message.
- a5b66235 - Fixed handling of sqlmode_ansi_quotes.
- 727c90c7 - Removed deprecation handling.
- 2b65a300 - Unset sql_mode init command.
- cf2667c5 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
- 7211c5e7 - Add example of sql_mode_options usage to default.settings.php
- a40f08d3 - Use TRUE rather than true in default.settings.php comment.
- 6ec83a6f - Copy default.settings.php to scaffold asset files.
Toggle commit list-
e4b80c30...152b7f06 - 3 commits from branch
- Resolved by Joachim Noreiko
- Resolved by Joachim Noreiko
34 34 // based on databaseType() rather than 'driver', but here all we have to go 35 35 // on is 'driver'. 36 36 if ($info['default']['driver'] === 'mysql') { 37 $info['default']['init_commands']['sql_mode'] = "SET sql_mode = ''"; 37 $info['default']['sql_mode_options']['ANSI'] = FALSE; The existing test clears all of the SQL modes, but 'ANSI' is the only one that the test actually depends on. It would do no harm to set 'TRADITIONAL' to false, but it is not necessary. If we wanted the test to be literally the same as the existing line, then we would use
$info['default']['sql_mode_options'] = [];
. I will consider that option when I am working on enhancing the tests later today.changed this line in version 42 of the diff
added 1 commit
- 59f3062f - Make SqlModeTest literally the same as it was when it used sql_mode instead of sql_mode_options.
added 1 commit
- e84e52ab - Add some ONLY_FULL_GROUP_BY tests (preliminary, will fail).
added 1 commit
- 96e526d4 - Use groupBy queries copied from another test.
added 28 commits
-
56525ba1...8d512c2a - 14 commits from branch
project:11.x
- 8d512c2a...559a6a40 - 4 earlier commits
- 09fbe066 - Updated deprecation message.
- 1d75cf81 - Fixed handling of sqlmode_ansi_quotes.
- 1ea8be49 - Removed deprecation handling.
- 0e8e3707 - Unset sql_mode init command.
- 8baf2e41 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
- 68449658 - Add example of sql_mode_options usage to default.settings.php
- cec6bf2d - Use TRUE rather than true in default.settings.php comment.
- 25d8b889 - Copy default.settings.php to scaffold asset files.
- e6e1c899 - Removed obsolete comment.
- 821364a3 - Add tests to demonstrate that individual sql modes can be set.
Toggle commit list-
56525ba1...8d512c2a - 14 commits from branch
added 16 commits
-
821364a3...6293c8e0 - 2 commits from branch
project:11.x
- 6293c8e0...bcdb58f3 - 4 earlier commits
- fc637b42 - Updated deprecation message.
- 1f8c6648 - Fixed handling of sqlmode_ansi_quotes.
- 55aba116 - Removed deprecation handling.
- 5ce38711 - Unset sql_mode init command.
- ef1c29b3 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
- ec462aa9 - Add example of sql_mode_options usage to default.settings.php
- 10f965de - Use TRUE rather than true in default.settings.php comment.
- 627e7ad4 - Copy default.settings.php to scaffold asset files.
- 9447e6e2 - Removed obsolete comment.
- 761af4dd - Add tests to demonstrate that individual sql modes can be set.
Toggle commit list-
821364a3...6293c8e0 - 2 commits from branch
added 96 commits
-
5ca2d2ef...6fc1e6f2 - 81 commits from branch
project:11.x
- 6fc1e6f2...cc491bbe - 5 earlier commits
- 22f6f8c7 - Fixed handling of sqlmode_ansi_quotes.
- 04237b38 - Removed deprecation handling.
- f5963ee0 - Unset sql_mode init command.
- c8f46420 - Ignore new top-level driver setting "sql_mode_options" when setting up functional tests.
- 7f24323a - Add example of sql_mode_options usage to default.settings.php
- d255f4b4 - Use TRUE rather than true in default.settings.php comment.
- 7d81048c - Copy default.settings.php to scaffold asset files.
- 70b68738 - Removed obsolete comment.
- 2bccfa63 - Add tests to demonstrate that individual sql modes can be set.
- 37ad08b1 - Deprecate sql_mode in 11.x for removal in 12.x.
Toggle commit list-
5ca2d2ef...6fc1e6f2 - 81 commits from branch
added 1 commit
- 8756253c - Be more careful to behave correctly when sql_mode is still in use.
added 1 commit
- 2090351f - isolation_level already pollutes the $connection_options array in the existing...
added 1 commit
- 2c8da601 - Move sql_mode_options calculation to the end
added 29 commits
-
2c8da601...cdb29302 - 10 commits from branch
project:11.x
- cdb29302...fce1bcb0 - 9 earlier commits
- 23fdcea8 - Add example of sql_mode_options usage to default.settings.php
- 2068edbc - Use TRUE rather than true in default.settings.php comment.
- 643b91f9 - Copy default.settings.php to scaffold asset files.
- 1697c33e - Removed obsolete comment.
- bec6d165 - Add tests to demonstrate that individual sql modes can be set.
- 7a021fb6 - Deprecate sql_mode in 11.x for removal in 12.x.
- cb1ac676 - Remove unused use statement
- 2341aa29 - Deprecate in 11.1.0 instead of 11.0.0.
- 53b622ef - Be more careful to behave correctly when sql_mode is still in use.
- cc78bcd0 - Move sql_mode_options calculation to the end
Toggle commit list-
2c8da601...cdb29302 - 10 commits from branch
added 24 commits
-
ad257384...e51adec7 - 2 commits from branch
project:11.x
- e51adec7...b4a9b574 - 12 earlier commits
- 6e25ed8f - Removed obsolete comment.
- 424be077 - Add tests to demonstrate that individual sql modes can be set.
- 03e4632d - Deprecate sql_mode in 11.x for removal in 12.x.
- f5bb2177 - Remove unused use statement
- 8a6075ef - Deprecate in 11.1.0 instead of 11.0.0.
- fbdc94ff - Be more careful to behave correctly when sql_mode is still in use.
- dbf713fc - Move sql_mode_options calculation to the end
- 4d77dddb - Introduce an SqlMode constant
- c813b6e5 - Code style
- 9b1a6062 - Moar code style
Toggle commit list-
ad257384...e51adec7 - 2 commits from branch
added 26 commits
-
5f84bdda...1c814ad4 - 3 commits from branch
project:11.x
- 1c814ad4...d6b66283 - 13 earlier commits
- cf88b44c - Add tests to demonstrate that individual sql modes can be set.
- ac037d42 - Deprecate sql_mode in 11.x for removal in 12.x.
- 3a548d47 - Remove unused use statement
- 83b5a2e2 - Deprecate in 11.1.0 instead of 11.0.0.
- 032638a6 - Be more careful to behave correctly when sql_mode is still in use.
- 192f1d39 - Move sql_mode_options calculation to the end
- a9efcf06 - Introduce an SqlMode constant
- d1e7f179 - Code style
- 64ff022b - Moar code style
- 0a258119 - Touch up SqlMode comments.
Toggle commit list-
5f84bdda...1c814ad4 - 3 commits from branch
added 29 commits
-
0a258119...20a080c2 - 5 commits from branch
project:11.x
- 20a080c2...bc4169b4 - 14 earlier commits
- c709fa92 - Deprecate sql_mode in 11.x for removal in 12.x.
- 39694211 - Remove unused use statement
- 9f64165b - Deprecate in 11.1.0 instead of 11.0.0.
- 33980aa3 - Be more careful to behave correctly when sql_mode is still in use.
- fa47f9e8 - Move sql_mode_options calculation to the end
- 0ce781fb - Introduce an SqlMode constant
- 9480fb86 - Code style
- 9caa88ca - Moar code style
- e6075703 - Touch up SqlMode comments.
- 29284493 - Add a few more Sql Mode docs, and reference them from default.settings.php.
Toggle commit list-
0a258119...20a080c2 - 5 commits from branch
195 197 'init_commands' => [], 196 198 ]; 197 199 198 $connection_options['init_commands'] += [ 199 'sql_mode' => "SET sql_mode = 'ANSI,TRADITIONAL'", 200 // Emit a deprecation warning if sql_mode is in the init commands. 201 if (isset($connection_options['init_commands']['sql_mode'])) { 202 @trigger_error("The 'sql_mode' database command is deprecated in drupal:11.1.0 and will be removed in drupal:12.0.0. Use an array of options in 'sql_mode_options' instead. See https://www.drupal.org/node/3403416", E_USER_DEPRECATED); How strongly do you feel about having a test for this? If I leverage
DriverSpecificDatabaseTestBase
, then this method is called duringsetup()
, so that won't work. If I extend KernelTestBase, then I could duplicate thesetup()
method in my test class, and add anexpectDeprecation()
before callingDatabase::getConnection()
, which calls thisopen()
method. Do you think that's worth doing, or can you think of a better way?
195 197 'init_commands' => [], 196 198 ]; 197 199 198 $connection_options['init_commands'] += [ 199 'sql_mode' => "SET sql_mode = 'ANSI,TRADITIONAL'", 200 // Emit a deprecation warning if sql_mode is in the init commands. 201 if (isset($connection_options['init_commands']['sql_mode'])) { 202 @trigger_error("The 'sql_mode' database command is deprecated in drupal:11.1.0 and will be removed in drupal:12.0.0. Use an array of options in 'sql_mode_options' instead. See https://www.drupal.org/node/3403416", E_USER_DEPRECATED); 203 } 204 205 // If the user has set sql_mode_options, then ignore sql_mode. 206 if (isset($connection_options['sql_mode_options'])) { 207 unset($connection_options['init_commands']['sql_mode']); added 1 commit
- a871bba1 - Add a test that demonstrates that we can add and remove specific SQL modes.
added 31 commits
-
a86462a4...9a6641de - 2 commits from branch
project:11.x
- 9a6641de...b61841f1 - 19 earlier commits
- 9962631b - Introduce an SqlMode constant
- 400fa7bf - Code style
- 6ff510b6 - Moar code style
- d1a4ea68 - Touch up SqlMode comments.
- 80fcedbb - Add a few more Sql Mode docs, and reference them from default.settings.php.
- 3d299683 - Add a test that demonstrates that we can add and remove specific SQL modes.
- 9d49ff1b - Code stye
- 210636e7 - More code style
- 1ef8d997 - Add a deprecation test.
- 668eb9ef - We do not need to calculate the expected driver, it is always mysql.
Toggle commit list-
a86462a4...9a6641de - 2 commits from branch
added 1 commit
- 26b73e25 - We must use group "legacy" to use expectDeprecation
added 1 commit
- 81ecfc7b - Improve comments in SqlModeSelectionTest, and also illustrate that it is not...
167 167 * Advanced users can add or override initial commands to execute when 168 168 * connecting to the database server, as well as PDO connection settings. For 169 169 * example, to enable MySQL SELECT queries to exceed the max_join_size system 170 * variable, and to reduce the database connection timeout to 5 seconds: 170 * variable, and configure MariaDB to interpret GROUP BY clauses the same way 171 * that MySQL does, and to reduce the database connection timeout to 5 seconds: 171 172 * @code 172 173 * $databases['default']['default'] = [ 173 174 * 'init_commands' => [ 174 175 * 'big_selects' => 'SET SQL_BIG_SELECTS=1', 175 176 * ], 177 * 'sql_mode_options' => [ 178 * 'ONLY_FULL_GROUP_BY' => TRUE,