#At file:///Users/mattiasj/clones/bzrroot/topush2-60-bugteam/
2757 Mattias Jonsson 2008-08-13 [merge]
merge (into the latest mysql-6.0-bugteam tree)
modified:
sql/sql_cursor.cc
tests/mysql_client_test.c
=== modified file 'sql/sql_cursor.cc'
--- a/sql/sql_cursor.cc 2008-08-11 13:45:45 +0000
+++ b/sql/sql_cursor.cc 2008-08-13 07:08:29 +0000
@@ -155,6 +155,7 @@ int mysql_open_cursor(THD *thd, uint fla
if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result)))
{
delete result_materialize;
+ result_materialize= NULL;
return 1;
}
@@ -212,6 +213,7 @@ int mysql_open_cursor(THD *thd, uint fla
if ((rc= materialized_cursor->open(0)))
{
delete materialized_cursor;
+ materialized_cursor= NULL;
goto err_open;
}
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2008-08-11 13:45:45 +0000
+++ b/tests/mysql_client_test.c 2008-08-13 07:08:29 +0000
@@ -17881,6 +17881,36 @@ static void test_wl4284_1()
DBUG_VOID_RETURN;
}
+/**
+ Bug#38486 Crash when using cursor protocol
+*/
+
+static void test_bug38486(void)
+{
+ MYSQL_STMT *stmt;
+ const char *stmt_text;
+ unsigned long type= CURSOR_TYPE_READ_ONLY;
+
+ DBUG_ENTER("test_bug38486");
+ myheader("test_bug38486");
+
+ stmt= mysql_stmt_init(mysql);
+ mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+ stmt_text= "CREATE TABLE t1 (a INT)";
+ mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ mysql_stmt_execute(stmt);
+ mysql_stmt_close(stmt);
+
+ stmt= mysql_stmt_init(mysql);
+ mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+ stmt_text= "INSERT INTO t1 VALUES (1)";
+ mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ mysql_stmt_execute(stmt);
+ mysql_stmt_close(stmt);
+
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -18193,6 +18223,7 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4166_4", test_wl4166_4 },
{ "test_bug36004", test_bug36004 },
{ "test_wl4284_1", test_wl4284_1 },
+ { "test_bug38486", test_bug38486 },
{ 0, 0 }
};
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (mattiasj:2757) | Mattias Jonsson | 13 Aug |