diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-13 04:30:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-13 04:30:08 +0000 |
commit | 02a4755049313aa3eb66d97fbef10362aaffa1bc (patch) | |
tree | 2d61338e102dd09d643e96881d1ec5121c0c51f9 /includes/database/sqlite | |
parent | 9d15ef4f044729f5b7bcede5417ec2c3fcf5c0b4 (diff) | |
download | brdo-02a4755049313aa3eb66d97fbef10362aaffa1bc.tar.gz brdo-02a4755049313aa3eb66d97fbef10362aaffa1bc.tar.bz2 |
- Patch #851590 by Damien Tournoud: SQLite should 'stringify' fetches.
Diffstat (limited to 'includes/database/sqlite')
-rw-r--r-- | includes/database/sqlite/database.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc index d7fa35a6e..c8750e58e 100644 --- a/includes/database/sqlite/database.inc +++ b/includes/database/sqlite/database.inc @@ -47,6 +47,8 @@ class DatabaseConnection_sqlite extends DatabaseConnection { parent::__construct('sqlite:' . $connection_options['database'], '', '', array( // Force column names to lower case. PDO::ATTR_CASE => PDO::CASE_LOWER, + // Convert numeric values to strings when fetching. + PDO::ATTR_STRINGIFY_FETCHES => TRUE, )); $this->exec('PRAGMA encoding="UTF-8"'); @@ -207,7 +209,7 @@ class DatabaseConnection_sqlite extends DatabaseConnection { } // The transaction gets committed when the transaction object gets destroyed // because it gets out of scope. - return (int) $this->query('SELECT value FROM {sequences}')->fetchField(); + return $this->query('SELECT value FROM {sequences}')->fetchField(); } public function rollback($savepoint_name = 'drupal_transaction') { |