Commit d32a4c9d authored by Dries's avatar Dries

- Patch #337926 by hswong3i: by default, force lower-case database tables/columns.

parent 77c5b369
......@@ -29,6 +29,8 @@ public function __construct(Array $connection_options = array()) {
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,
// Because MySQL's prepared statements skip the query cache, because it's dumb.
PDO::ATTR_EMULATE_PREPARES => TRUE,
// Force column names to lower case.
PDO::ATTR_CASE => PDO::CASE_LOWER,
));
// Force MySQL to use the UTF-8 character set by default.
......
......@@ -30,6 +30,8 @@ public function __construct(Array $connection_options = array()) {
parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(
// Convert numeric values to strings when fetching.
PDO::ATTR_STRINGIFY_FETCHES => TRUE,
// Force column names to lower case.
PDO::ATTR_CASE => PDO::CASE_LOWER,
));
}
......
......@@ -31,7 +31,10 @@ public function __construct(Array $connection_options = array()) {
$this->transactionSupport = isset($connection_options['transactions']) ? $connection_options['transactions'] : TRUE;
parent::__construct('sqlite:'. $connection_options['database'], '', '', $connection_options);
parent::__construct('sqlite:'. $connection_options['database'], '', '', array(
// Force column names to lower case.
PDO::ATTR_CASE => PDO::CASE_LOWER,
));
$this->exec('PRAGMA encoding="UTF-8"');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment