diff options
author | Marc Alff <marc.alff@sun.com> | 2008-08-11 16:44:13 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2008-08-11 16:44:13 -0600 |
commit | 7f228cf20ea057a5d677d3546c6b29742db386a7 (patch) | |
tree | 7a10933aa27f945821757097c651e2de18b1c2aa /tests | |
parent | b0d5c8a10bf9f165affe89d8d593888e12b694f5 (diff) | |
parent | 2f3b860305a88e7e44ed68c5ed3a0f1837921cb0 (diff) | |
download | mariadb-git-7f228cf20ea057a5d677d3546c6b29742db386a7.tar.gz |
Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam
Note: NULL merge of sql/sql_yacc.yy, the fix for bug#38296 will be provided separately for 5.1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index aafa22bdf7f..a41d9029d70 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -17594,6 +17594,33 @@ static void test_wl4166_2() } +/** + Bug#38486 Crash when using cursor protocol +*/ + +static void test_bug38486(void) +{ + myheader("test_bug38486"); + + MYSQL_STMT *stmt; + stmt= mysql_stmt_init(mysql); + unsigned long type= CURSOR_TYPE_READ_ONLY; + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + const char *sql= "CREATE TABLE t1 (a INT)"; + mysql_stmt_prepare(stmt,sql,strlen(sql)); + + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + const char *sql2= "INSERT INTO t1 VALUES (1)"; + mysql_stmt_prepare(stmt,sql2,strlen(sql2)); + mysql_stmt_execute(stmt); + + mysql_stmt_close(stmt); +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -17902,6 +17929,7 @@ static struct my_tests_st my_tests[]= { { "test_bug28386", test_bug28386 }, { "test_wl4166_1", test_wl4166_1 }, { "test_wl4166_2", test_wl4166_2 }, + { "test_bug38486", test_bug38486 }, { 0, 0 } }; |