summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <df@pippilotta.erinye.com>2007-08-24 10:13:03 +0200
committerunknown <df@pippilotta.erinye.com>2007-08-24 10:13:03 +0200
commit3fa6127979f23ebe22db0cd36416b3f572d45c3e (patch)
tree1996af4c6c00c74ebb8c2f4e8053b3731c763f4b /tests
parentaa52d6d703f7ecc0538fbdb3c05421a0056b4043 (diff)
parent0aefd73b3dda1705270fb756329c32e10e1cc476 (diff)
downloadmariadb-git-3fa6127979f23ebe22db0cd36416b3f572d45c3e.tar.gz
Merge dfischer@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build libmysql/libmysql.c: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/information_schema.test: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged tests/mysql_client_test.c: Auto merged
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 0b23f1ab9d4..7f0289d93db 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16267,6 +16267,78 @@ static void test_bug27592()
DBUG_VOID_RETURN;
}
+static void test_bug29948()
+{
+ MYSQL *dbc=NULL;
+ MYSQL_STMT *stmt=NULL;
+ MYSQL_BIND bind;
+
+ int res=0;
+ my_bool auto_reconnect=1, error=0, is_null=0;
+ char kill_buf[20];
+ const char *query;
+ int buf;
+ unsigned long length, cursor_type;
+
+ dbc = mysql_init(NULL);
+ DIE_UNLESS(dbc);
+
+ mysql_options(dbc, MYSQL_OPT_RECONNECT, (char*)&auto_reconnect);
+ if (!mysql_real_connect(dbc, opt_host, opt_user,
+ opt_password, current_db, opt_port,
+ opt_unix_socket,
+ (CLIENT_FOUND_ROWS | CLIENT_MULTI_STATEMENTS |
+ CLIENT_MULTI_RESULTS)))
+ {
+ printf("connection failed: %s (%d)", mysql_error(dbc),
+ mysql_errno(dbc));
+ exit(1);
+ }
+
+ bind.buffer_type= MYSQL_TYPE_LONG;
+ bind.buffer= (char *)&buf;
+ bind.is_null= &is_null;
+ bind.error= &error;
+ bind.length= &length;
+
+ res= mysql_query(dbc, "DROP TABLE IF EXISTS t1");
+ myquery(res);
+ res= mysql_query(dbc, "CREATE TABLE t1 (a INT)");
+ myquery(res);
+ res= mysql_query(dbc, "INSERT INTO t1 VALUES(1)");
+ myquery(res);
+
+ stmt= mysql_stmt_init(dbc);
+ check_stmt(stmt);
+
+ cursor_type= CURSOR_TYPE_READ_ONLY;
+ res= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&cursor_type);
+ myquery(res);
+
+ query= "SELECT * from t1 where a=?";
+ res= mysql_stmt_prepare(stmt, query, strlen(query));
+ myquery(res);
+
+ res= mysql_stmt_bind_param(stmt, &bind);
+ myquery(res);
+
+ res= mysql_stmt_execute(stmt);
+ check_execute(stmt, res);
+
+ res= mysql_stmt_bind_result(stmt,&bind);
+ check_execute(stmt, res);
+
+ sprintf(kill_buf, "kill %ld", dbc->thread_id);
+ mysql_query(dbc, kill_buf);
+
+ res= mysql_stmt_store_result(stmt);
+ DIE_UNLESS(res);
+
+ mysql_stmt_free_result(stmt);
+ mysql_stmt_close(stmt);
+ mysql_query(dbc, "DROP TABLE t1");
+ mysql_close(dbc);
+}
/*
@@ -16668,6 +16740,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug28505", test_bug28505 },
{ "test_bug28934", test_bug28934 },
{ "test_bug27592", test_bug27592 },
+ { "test_bug29948", test_bug29948 },
{ "test_bug29687", test_bug29687 },
{ "test_bug29692", test_bug29692 },
{ "test_bug29306", test_bug29306 },