From fbd935220b562c7ec17c6869b6d4cb438abdc3ec Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 14 Jan 2011 22:40:17 +0100 Subject: [PATCH] BOOLEAN is integer in SQLite internally, cast booleans to integers. --- framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php | 16 ++++++++++++++++ framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php index dc5f0986c..c01e43dc9 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php @@ -48,6 +48,22 @@ class Horde_Db_Adapter_Sqlite_Schema extends Horde_Db_Adapter_Base_Schema return '"' . str_replace('"', '""', $name) . '"'; } + /** + * @return string + */ + public function quoteTrue() + { + return '1'; + } + + /** + * @return string + */ + public function quoteFalse() + { + return '0'; + } + /*########################################################################## # Schema Statements diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php index 598f2c024..023fb461f 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php @@ -277,12 +277,12 @@ class Horde_Db_Adapter_Pdo_SqliteTest extends PHPUnit_Framework_TestCase public function testQuoteTrue() { - $this->assertEquals("'t'", $this->_conn->quote(true)); + $this->assertEquals('1', $this->_conn->quote(true)); } public function testQuoteFalse() { - $this->assertEquals("'f'", $this->_conn->quote(false)); + $this->assertEquals('0', $this->_conn->quote(false)); } public function testQuoteString() -- 2.11.0