Commit 02a47550 authored by Dries's avatar Dries

- Patch #851590 by Damien Tournoud: SQLite should 'stringify' fetches.

parent 9d15ef4f
......@@ -47,6 +47,8 @@ public function __construct(array $connection_options = array()) {
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 @@ public function nextId($existing_id = 0) {
}
// 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') {
......
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