Commit fbe3a0d1 authored by unknown's avatar unknown

Merge gleb.loc:/home/uchum/work/bk/5.1-opt-29985

into  gleb.loc:/home/uchum/work/bk/5.1-opt

parents bc25c6ca ea040540
...@@ -140,7 +140,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE, ...@@ -140,7 +140,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE,
auto_generate_sql= FALSE; auto_generate_sql= FALSE;
const char *auto_generate_sql_type= "mixed"; const char *auto_generate_sql_type= "mixed";
static unsigned long connect_flags= CLIENT_MULTI_RESULTS; static unsigned long connect_flags= CLIENT_MULTI_RESULTS |
CLIENT_MULTI_STATEMENTS;
static int verbose, delimiter_length; static int verbose, delimiter_length;
static uint commit_rate; static uint commit_rate;
...@@ -1877,13 +1878,16 @@ pthread_handler_t run_task(void *p) ...@@ -1877,13 +1878,16 @@ pthread_handler_t run_task(void *p)
} }
} }
if (mysql_field_count(mysql)) do
{ {
result= mysql_store_result(mysql); if (mysql_field_count(mysql))
while ((row = mysql_fetch_row(result))) {
counter++; result= mysql_store_result(mysql);
mysql_free_result(result); while ((row = mysql_fetch_row(result)))
} counter++;
mysql_free_result(result);
}
} while(mysql_next_result(mysql) == 0);
queries++; queries++;
if (commit_rate && commit_rate <= trans_counter) if (commit_rate && commit_rate <= trans_counter)
......
...@@ -211,3 +211,8 @@ COMMIT; ...@@ -211,3 +211,8 @@ COMMIT;
COMMIT; COMMIT;
SHOW TABLES; SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
#
# Bug #29985: mysqlslap -- improper handling of resultsets in SPROCs
#
DROP PROCEDURE IF EXISTS p1;
CREATE PROCEDURE p1() SELECT 1;
...@@ -40,3 +40,14 @@ ...@@ -40,3 +40,14 @@
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1; --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1;
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2 --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2
--echo #
--echo # Bug #29985: mysqlslap -- improper handling of resultsets in SPROCs
--echo #
--disable_warnings
DROP PROCEDURE IF EXISTS p1;
--enable_warnings
CREATE PROCEDURE p1() SELECT 1;
--exec $MYSQL_SLAP --create-schema=test --delimiter=";" --query="CALL p1; SELECT 1;" --silent 2>&1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment