summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordlenev@mysql.com <>2004-10-22 20:21:56 +0400
committerdlenev@mysql.com <>2004-10-22 20:21:56 +0400
commitfbdc20e0afcb590f87696e72aec568934e908a59 (patch)
treec1b0ab37020b6422d09050351de952838e1f9d4e /tests
parentaf7ecf4c785af1533eac814952c04ccf3d7f2968 (diff)
parentb7a957d127181b07152504d302c2feb1e7366155 (diff)
downloadmariadb-git-fbdc20e0afcb590f87696e72aec568934e908a59.tar.gz
Manual merge of fix for bug #6081 "Call to deprecated mysql_create_db() function crashes
server" with main tree.
Diffstat (limited to 'tests')
-rw-r--r--tests/client_test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/client_test.c b/tests/client_test.c
index 130e0bc3b4f..31244395132 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -10688,6 +10688,31 @@ static void test_bug6046()
}
+/*
+ Altough mysql_create_db(), mysql_rm_db() are deprecated since 4.0 they
+ should not crash server and should not hang in case of errors.
+
+ Since those functions can't be seen in modern API (unless client library
+ was compiled with USE_OLD_FUNCTIONS define) we use simple_command() macro.
+*/
+static void test_bug6081()
+{
+ int rc;
+ myheader("test_bug6081");
+
+ rc= simple_command(mysql, COM_DROP_DB, current_db,
+ (ulong)strlen(current_db), 0);
+ myquery(rc);
+ rc= simple_command(mysql, COM_DROP_DB, current_db,
+ (ulong)strlen(current_db), 0);
+ myquery_r(rc);
+ rc= simple_command(mysql, COM_CREATE_DB, current_db,
+ (ulong)strlen(current_db), 0);
+ myquery(rc);
+ rc= simple_command(mysql, COM_CREATE_DB, current_db,
+ (ulong)strlen(current_db), 0);
+ myquery_r(rc);
+}
/*
@@ -11004,6 +11029,7 @@ int main(int argc, char **argv)
test_bug6058(); /* check support for 0000-00-00 dates */
test_bug6059(); /* correct metadata for SELECT ... INTO OUTFILE */
test_bug6046(); /* NATURAL JOIN transformation works in PS */
+ test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */
/*
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.