summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-07-05 09:47:20 -0700
committerunknown <jimw@mysql.com>2005-07-05 09:47:20 -0700
commit63c5a72b314bcf4ad68e120fa2e16caa861bb822 (patch)
treeb9559572d9068a65f3ebaa464b35ff27d369fa20 /tests
parent7450eef89a7aac5be282d7be7b22b0c636b5ea74 (diff)
parent390bc0d6195a2042d0534fcfbdeee336f8b394fe (diff)
downloadmariadb-git-63c5a72b314bcf4ad68e120fa2e16caa861bb822.tar.gz
Merge mysql.com:/home/jimw/my/mysql-5.0-10214
into mysql.com:/home/jimw/my/mysql-5.0-clean include/my_sys.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged sql/set_var.cc: Auto merged sql/sql_class.cc: Auto merged tests/mysql_client_test.c: Clean up merge of new tests
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index a80d5e1d1be..0c79925c3eb 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -13332,7 +13332,6 @@ static void test_bug9992()
mysql_close(mysql1);
}
-
/* Bug#10736: cursors and subqueries, memroot management */
static void test_bug10736()
@@ -13601,6 +13600,34 @@ static void test_bug11656()
/*
+ Check that the server signals when NO_BACKSLASH_ESCAPES mode is in effect,
+ and mysql_real_escape_string() does the right thing as a result.
+*/
+
+static void test_bug10214()
+{
+ MYSQL_RES* res ;
+ int len;
+ char out[8];
+
+ myheader("test_bug10214");
+
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES));
+
+ len= mysql_real_escape_string(mysql, out, "a'b\\c", 5);
+ DIE_UNLESS(memcmp(out, "a\\'b\\\\c", len) == 0);
+
+ mysql_query(mysql, "set sql_mode='NO_BACKSLASH_ESCAPES'");
+ DIE_UNLESS(mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES);
+
+ len= mysql_real_escape_string(mysql, out, "a'b\\c", 5);
+ DIE_UNLESS(memcmp(out, "a''b\\c", len) == 0);
+
+ mysql_query(mysql, "set sql_mode=''");
+}
+
+
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -13839,6 +13866,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug10794", test_bug10794 },
{ "test_bug11172", test_bug11172 },
{ "test_bug11656", test_bug11656 },
+ { "test_bug10214", test_bug10214 },
{ 0, 0 }
};