Skip to content
Snippets Groups Projects
Commit ef736430 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #212918 by pwolanin: enable MySQL's ANSI-mode. We can chose to...

- Patch #212918 by pwolanin: enable MySQL's ANSI-mode.  We can chose to disable this when we ship Drupal 7, but it is really helpful during the development cycle.
parent 29c377c8
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -79,7 +79,8 @@ function db_connect($url) {
// Show error screen otherwise
_db_error_page(mysql_error());
}
// Require ANSI mode to improve SQL portability.
mysql_query("SET SESSION sql_mode='ANSI'", $connection);
// Force UTF-8.
mysql_query('SET NAMES "utf8"', $connection);
return $connection;
......
......@@ -120,6 +120,8 @@ function _db_query($query, $debug = 0) {
}
if (!mysqli_errno($active_db)) {
// Require ANSI mode to improve SQL portability.
mysqli_query($active_db, "SET SESSION sql_mode='ANSI'");
return $result;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment