summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg@mysql.com>2009-07-09 23:10:50 +0200
committerJoerg Bruehe <joerg@mysql.com>2009-07-09 23:10:50 +0200
commit9313d74e913cf7a3ce4f019d323c4689842af074 (patch)
tree90adb4d952d048c2bf8d97e20ef78c5b0af453ec /tests
parenta1af64f3adc136a2874940880e3bb6ae17b10b07 (diff)
parent006d97dc972bead95351dba20a1027d235d1b05f (diff)
downloadmariadb-git-9313d74e913cf7a3ce4f019d323c4689842af074.tar.gz
Merge main 5.0 into 5.0-build.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 9dfacb7436d..ce1a1a99b04 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -12063,6 +12063,27 @@ static void test_bug6081()
}
+/*
+ Verify that bogus database names are handled properly with
+ COM_CREATE_DB and COM_DROP_DB, i.e., cannot cause SIGSEGV through
+ the use of printf specifiers in the database name.
+*/
+static void test_bug45790()
+{
+ const char* bogus_db = "%s%s%s%s%s%s%s";
+ int rc;
+
+ myheader("test_bug45790");
+ rc= simple_command(mysql, COM_CREATE_DB, bogus_db,
+ (ulong)strlen(bogus_db), 0);
+ myquery(rc);
+
+ rc= simple_command(mysql, COM_DROP_DB, bogus_db,
+ (ulong)strlen(bogus_db), 0);
+ myquery(rc);
+}
+
+
static void test_bug6096()
{
MYSQL_STMT *stmt;
@@ -16829,6 +16850,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug6059", test_bug6059 },
{ "test_bug6046", test_bug6046 },
{ "test_bug6081", test_bug6081 },
+ { "test_bug45790",test_bug45790 },
{ "test_bug6096", test_bug6096 },
{ "test_datetime_ranges", test_datetime_ranges },
{ "test_bug4172", test_bug4172 },