summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-05-25 00:55:47 +0200
committerAndrey Andreev <narf@bofh.bg>2012-05-25 00:55:47 +0200
commitee0f97ad35750c71e7888992b9084979059e831c (patch)
tree36d550c7290076aecf1f40ab51e3acf555b81f7a /tests/codeigniter/database
parentdef568fcc8586db7685c4a1c2efd14c3cd75c8ad (diff)
parent98dcac7ea5f82cc1d5cecedd030c5f242f1dc652 (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.php7
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