diff options
author | unknown <evgen@moonbone.local> | 2007-08-14 18:16:34 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-08-14 18:16:34 +0400 |
commit | 83fdcb2b7bddfffcf5a750ac9830f7ea38d2b8fc (patch) | |
tree | db7a4eb8d5cc784b95a10d37f4211d98389b203c /tests | |
parent | de619bd17c69453dc115fad746719b0751de87f5 (diff) | |
parent | e34aa82da9eca8b219a88bc255938f2c7094567a (diff) | |
download | mariadb-git-83fdcb2b7bddfffcf5a750ac9830f7ea38d2b8fc.tar.gz |
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/29948-bug-5.0-opt-mysql
tests/mysql_client_test.c:
Manually merged
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index cbeea064ffd..dd6b0b5585f 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -15735,6 +15735,79 @@ static void test_bug27592() } +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; + + 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); + + buf= CURSOR_TYPE_READ_ONLY; + res= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&buf); + 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); +} + /** Bug#29306 Truncated data in MS Access with decimal (3,1) columns in a VIEW */ @@ -16068,6 +16141,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_bug29306", test_bug29306 }, { 0, 0 } }; |