diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-05-25 00:55:47 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-05-25 00:55:47 +0200 |
commit | ee0f97ad35750c71e7888992b9084979059e831c (patch) | |
tree | 36d550c7290076aecf1f40ab51e3acf555b81f7a /tests/codeigniter/database | |
parent | def568fcc8586db7685c4a1c2efd14c3cd75c8ad (diff) | |
parent | 98dcac7ea5f82cc1d5cecedd030c5f242f1dc652 (diff) |
Merge pull request #1395 from toopay/db-test-suite
Alter the escape like test, since it use raw SQL via query(), the sql st...
Diffstat (limited to 'tests/codeigniter/database')
-rw-r--r-- | tests/codeigniter/database/query_builder/escape_test.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/codeigniter/database/query_builder/escape_test.php b/tests/codeigniter/database/query_builder/escape_test.php index f2d1b84ca..5dd2da058 100644 --- a/tests/codeigniter/database/query_builder/escape_test.php +++ b/tests/codeigniter/database/query_builder/escape_test.php @@ -23,7 +23,9 @@ class Escape_test extends CI_TestCase { public function test_escape_like_percent_sign() { $string = $this->db->escape_like_str('\%foo'); - $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%';"; + $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%'"; + $sql .= (strpos(DB_DRIVER, 'mysql') !== FALSE) ? ";" : "ESCAPE '!';"; + $res = $this->db->query($sql)->result_array(); // Check the result @@ -38,7 +40,8 @@ class Escape_test extends CI_TestCase { public function test_escape_like_backslash_sign() { $string = $this->db->escape_like_str('\\'); - $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%';"; + $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%'"; + $sql .= (strpos(DB_DRIVER, 'mysql') !== FALSE) ? ";" : "ESCAPE '!';"; $res = $this->db->query($sql)->result_array(); // Check the result |