diff options
author | Bernt M. Johnsen <bernt.johnsen@sun.com> | 2009-05-05 12:34:25 +0200 |
---|---|---|
committer | Bernt M. Johnsen <bernt.johnsen@sun.com> | 2009-05-05 12:34:25 +0200 |
commit | f27d9c267d859bf9eca32a8aeb79a182303ffac9 (patch) | |
tree | 78286c3994460dbf2746bf664bf58ec661977ae3 /tests | |
parent | c5548ad7bdb8faa673c8455ebd4d98aad93b43eb (diff) | |
parent | ef65e32d70913dd57c206b29a1a6935aa23de210 (diff) | |
download | mariadb-git-f27d9c267d859bf9eca32a8aeb79a182303ffac9.tar.gz |
Bug#23471 prepared for commit in 5.1 gca branch
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 6025063846a..1183256eb1a 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2464,6 +2464,9 @@ static void test_ps_query_cache() myheader("test_ps_query_cache"); + rc= mysql_query(mysql, "SET SQL_MODE=''"); + myquery(rc); + /* prepare the table */ rc= mysql_query(mysql, "drop table if exists t1"); @@ -2506,6 +2509,9 @@ static void test_ps_query_cache() mysql_close(lmysql); DIE_UNLESS(0); } + rc= mysql_query(lmysql, "SET SQL_MODE=''"); + myquery(rc); + if (!opt_silent) fprintf(stdout, "OK"); } @@ -4240,6 +4246,10 @@ static void test_fetch_date() myheader("test_fetch_date"); + /* Will not work if sql_mode is NO_ZERO_DATE (implicit if TRADITIONAL) /*/ + rc= mysql_query(mysql, "SET SQL_MODE=''"); + myquery(rc); + rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); myquery(rc); @@ -4954,6 +4964,9 @@ static void test_stmt_close() /* set AUTOCOMMIT to ON*/ mysql_autocommit(lmysql, TRUE); + rc= mysql_query(lmysql, "SET SQL_MODE = ''"); + myquery(rc); + rc= mysql_query(lmysql, "DROP TABLE IF EXISTS test_stmt_close"); myquery(rc); @@ -12088,6 +12101,9 @@ static void test_bug6058() myheader("test_bug6058"); + rc= mysql_query(mysql, "SET SQL_MODE=''"); + myquery(rc); + stmt_text= "SELECT CAST('0000-00-00' AS DATE)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); @@ -13303,6 +13319,9 @@ static void test_bug8378() if (!opt_silent) fprintf(stdout, "OK"); + rc= mysql_query(lmysql, "SET SQL_MODE=''"); + myquery(rc); + len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4); /* No escaping should have actually happened. */ @@ -16390,12 +16409,27 @@ static void test_change_user() myquery(rc); sprintf(buff, + "grant select on %s.* to %s@'localhost' identified by '%s'", + db, + user_pw, + pw); + rc= mysql_query(mysql, buff); + myquery(rc); + + sprintf(buff, "grant select on %s.* to %s@'%%'", db, user_no_pw); rc= mysql_query(mysql, buff); myquery(rc); + sprintf(buff, + "grant select on %s.* to %s@'localhost'", + db, + user_no_pw); + rc= mysql_query(mysql, buff); + myquery(rc); + /* Try some combinations */ rc= mysql_change_user(mysql, NULL, NULL, NULL); @@ -16552,6 +16586,14 @@ static void test_change_user() rc= mysql_query(mysql, buff); myquery(rc); + sprintf(buff, "drop user %s@'localhost'", user_pw); + rc= mysql_query(mysql, buff); + myquery(rc); + + sprintf(buff, "drop user %s@'localhost'", user_no_pw); + rc= mysql_query(mysql, buff); + myquery(rc); + DBUG_VOID_RETURN; } @@ -17220,6 +17262,11 @@ static void test_bug31669() rc= mysql_query(mysql, query); myquery(rc); + strxmov(query, "GRANT ALL PRIVILEGES ON *.* TO '", user, "'@'localhost' IDENTIFIED BY " + "'", buff, "' WITH GRANT OPTION", NullS); + rc= mysql_query(mysql, query); + myquery(rc); + rc= mysql_query(mysql, "FLUSH PRIVILEGES"); myquery(rc); @@ -17257,7 +17304,7 @@ static void test_bug31669() strxmov(query, "DELETE FROM mysql.user WHERE User='", user, "'", NullS); rc= mysql_query(mysql, query); myquery(rc); - DIE_UNLESS(mysql_affected_rows(mysql) == 1); + DIE_UNLESS(mysql_affected_rows(mysql) == 2); #endif DBUG_VOID_RETURN; @@ -17469,6 +17516,9 @@ static void test_wl4166_2() myheader("test_wl4166_2"); + rc= mysql_query(mysql, "SET SQL_MODE=''"); + myquery(rc); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); rc= mysql_query(mysql, "create table t1 (c_int int, d_date date)"); |