diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-02-17 19:39:11 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-02-17 19:39:11 +0000 |
commit | ef736430e5c16b9370227ee9958ece36953062af (patch) | |
tree | 93f390a66b75cda21033ef6914d652882f1abdc8 /includes | |
parent | 29c377c8cdcb5a4de1a52267a65f729577f62541 (diff) | |
download | brdo-ef736430e5c16b9370227ee9958ece36953062af.tar.gz brdo-ef736430e5c16b9370227ee9958ece36953062af.tar.bz2 |
- 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.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/database.mysql.inc | 3 | ||||
-rw-r--r-- | includes/database.mysqli.inc | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index a71c2371a..e8f831d71 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -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; diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc index 47390eb8e..b1b4f3b7f 100644 --- a/includes/database.mysqli.inc +++ b/includes/database.mysqli.inc @@ -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 { |