diff options
author | unknown <dlenev@mysql.com> | 2004-10-22 20:21:56 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2004-10-22 20:21:56 +0400 |
commit | ba69a3e0f1356c4ffd88b690e5232564ebc3cbef (patch) | |
tree | c1b0ab37020b6422d09050351de952838e1f9d4e /tests | |
parent | ba32fe3407b82cfab6974b0d8c2300941dfac1b2 (diff) | |
parent | cb9b167251add22da16ba1b9c84a21fe8bdafc13 (diff) | |
download | mariadb-git-ba69a3e0f1356c4ffd88b690e5232564ebc3cbef.tar.gz |
Manual merge of fix for bug #6081 "Call to deprecated mysql_create_db() function crashes
server" with main tree.
sql/sql_parse.cc:
Auto merged
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client_test.c | 26 |
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. |