From 1c0f4ac3aa513701837cfbc3829d3eb242dcc525 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 23 Dec 2008 07:48:24 +0000 Subject: - Patch #344575 by cdale et al: force MySQL to run in ANSI compatibility mode. Comes with tests. --- includes/database/mysql/database.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'includes/database/mysql') diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc index 9a9c57082..b7043dd15 100644 --- a/includes/database/mysql/database.inc +++ b/includes/database/mysql/database.inc @@ -35,9 +35,12 @@ class DatabaseConnection_mysql extends DatabaseConnection { // Force MySQL to use the UTF-8 character set by default. $this->exec('SET NAMES "utf8"'); - // Enable MySQL's "strict mode", which removes most of MySQL's - // "just be lazy" behaviors that end up causing more trouble than they're worth. - $this->exec('SET sql_mode=STRICT_ALL_TABLES'); + // Force MySQL's behavior to conform more closely to SQL standards. + // This allows Drupal to run almost seamlessly on many different + // kinds of database systems. These settings force MySQL to behave + // the same as postgresql, or sqlite in regards to syntax interpretation + // and invalid data handling. See http://drupal.org/node/344575 for further disscussion. + $this->exec("SET sql_mode='ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY'"); } public function queryRange($query, array $args, $from, $count, array $options = array()) { -- cgit v1.2.3