Index: skeleton/rdbms/sybase/SybaseDialect.class.php =================================================================== --- skeleton/rdbms/sybase/SybaseDialect.class.php (revision 12079) +++ skeleton/rdbms/sybase/SybaseDialect.class.php (working copy) @@ -25,10 +25,10 @@ ); public - $escape = '"', - $escapeRules = array('"' => '""'), - $escapeT = '"', - $escapeTRules = array('"' => '""'), + $escape = "'", + $escapeRules = array("'" => "''"), + $escapeT = "'", + $escapeTRules = array("'" => "''"), $dateFormat = 'Y-m-d h:iA'; /** @@ -58,9 +58,9 @@ * @throws lang.IllegalArgumentException */ public function datepart($datepart) { - $datepart= strToLower($datepart); + $datepart= strtolower($datepart); if (!array_key_exists($datepart, self::$dateparts)) return parent::datepart($datepart); - if (FALSE === self::$dateparts[$datepart]) throw new IllegalArgumentException('SYBASE does not support datepart '.$datepart); + if (FALSE === self::$dateparts[$datepart]) throw new IllegalArgumentException('Sybase does not support datepart '.$datepart); return self::$dateparts[$datepart]; } @@ -72,7 +72,7 @@ * @throws lang.IllegalArgumentException */ public function makeJoinBy(Array $conditions) { - if (0 == sizeof($conditions)) throw new IllegalArgumentException('conditions can not be empty'); + if (0 == sizeof($conditions)) throw new IllegalArgumentException('Conditions cannot be empty'); $tableString= current($conditions)->getSource()->toSqlString(); $conditionString= ''; Index: skeleton/rdbms/mysql/MysqlDialect.class.php =================================================================== --- skeleton/rdbms/mysql/MysqlDialect.class.php (revision 12077) +++ skeleton/rdbms/mysql/MysqlDialect.class.php (working copy) @@ -27,9 +27,9 @@ ); public - $escape = '"', + $escape = "'", $escapeRules = array( - '"' => '\"', + "'" => "''", '\\' => '\\\\' ), $escapeT = '`', Index: ports/classes/net/xp_framework/unittest/rdbms/CriteriaTest.class.php =================================================================== --- ports/classes/net/xp_framework/unittest/rdbms/CriteriaTest.class.php (revision 12077) +++ ports/classes/net/xp_framework/unittest/rdbms/CriteriaTest.class.php (working copy) @@ -98,7 +98,7 @@ } $this->assertSql( - 'where job_id = 1 and valid_from >= "2006-01-01 12:00AM" and title like "Hello%" order by valid_from asc', + 'where job_id = 1 and valid_from >= \'2006-01-01 12:00AM\' and title like \'Hello%\' order by valid_from asc', $c ); } @@ -127,8 +127,8 @@ $this->assertSql( 'where (not (job_id in (1, 2, 3))' - .' or (title like "Hello%" and valid_from > "2006-01-01 12:00AM")' - .' or (title like "Hello%" and valid_from > "2006-01-01 12:00AM")' + .' or (title like \'Hello%\' and valid_from > \'2006-01-01 12:00AM\')' + .' or (title like \'Hello%\' and valid_from > \'2006-01-01 12:00AM\')' .' or job_id between 1 and 5)', $c ); @@ -141,7 +141,7 @@ #[@test] public function constructorAcceptsVarArgArrays() { $this->assertSql( - 'where job_id = 1 and title = "Hello"', + 'where job_id = 1 and title = \'Hello\'', new Criteria(array('job_id', 1, EQUAL), array('title', 'Hello', EQUAL)) ); } Index: ports/classes/net/xp_framework/unittest/rdbms/TokenizerTest.class.php =================================================================== --- ports/classes/net/xp_framework/unittest/rdbms/TokenizerTest.class.php (revision 12077) +++ ports/classes/net/xp_framework/unittest/rdbms/TokenizerTest.class.php (working copy) @@ -90,8 +90,8 @@ #[@test] public function testStringToken() { static $expect= array( - 'sybase' => 'select """Hello"", Tom\'s friend said" as strval', - 'mysql' => 'select "\"Hello\", Tom\'s friend said" as strval', + 'sybase' => "select '\"Hello\", Tom''s friend said' as strval", + 'mysql' => 'select \'"Hello", Tom\'\'s friend said\' as strval', 'pgsql' => 'select \'"Hello", Tom\'\'s friend said\' as strval', // Add other built-in rdbms engines when added to the test! ); @@ -110,8 +110,8 @@ #[@test] public function testBackslash() { static $expect= array( - 'sybase' => 'select "Hello \\ " as strval', // one backslash - 'mysql' => 'select "Hello \\\\ " as strval', // two backslashes + 'sybase' => 'select \'Hello \\ \' as strval', // one backslash + 'mysql' => 'select \'Hello \\\\ \' as strval', // two backslashes 'pgsql' => 'select \'Hello \\ \' as strval', // one backslash // TBD: Other built-in rdbms engines ); @@ -150,8 +150,8 @@ #[@test] public function testDateArrayToken() { static $expect= array( - 'sybase' => '"1977-12-14 12:00AM", "1977-12-15 12:00AM"', - 'mysql' => '"1977-12-14 00:00:00", "1977-12-15 00:00:00"', + 'sybase' => "'1977-12-14 12:00AM', '1977-12-15 12:00AM'", + 'mysql' => "'1977-12-14 00:00:00', '1977-12-15 00:00:00'", 'pgsql' => "'1977-12-14 00:00:00', '1977-12-15 00:00:00'", // Add other built-in rdbms engines when added to the test! ); @@ -231,8 +231,8 @@ #[@test] public function percentSignInPrepareString() { static $expect= array( - 'sybase' => 'insert into table values ("value", "str%&ing", "value")', - 'mysql' => 'insert into table values ("value", "str%&ing", "value")', + 'sybase' => 'insert into table values (\'value\', "str%&ing", \'value\')', + 'mysql' => 'insert into table values (\'value\', "str%&ing", \'value\')', 'pgsql' => 'insert into table values (\'value\', "str%&ing", \'value\')' ); @@ -250,8 +250,8 @@ #[@test] public function percentSignInValues() { static $expect= array( - 'sybase' => 'select "%20"', - 'mysql' => 'select "%20"', + 'sybase' => "select '%20'", + 'mysql' => "select '%20'", 'pgsql' => "select '%20'" );