From: Jan Schneider Date: Fri, 14 Jan 2011 21:40:17 +0000 (+0100) Subject: BOOLEAN is integer in SQLite internally, cast booleans to integers. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fbd935220b562c7ec17c6869b6d4cb438abdc3ec;p=horde.git BOOLEAN is integer in SQLite internally, cast booleans to integers. --- 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()