MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:<gshchepa Date:September 17 2007 4:39pm
Subject:bk commit into 5.1 tree (gshchepa:1.2614) BUG#29985
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of uchum. When uchum does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-17 21:39:07+05:00, gshchepa@stripped +3 -0
  Fixed bug #29985.
  Multiple-result processing is required during the execution
  of CALL statements for stored procedures, however the mysqlslap
  client lacked that processing.
  

  client/mysqlslap.c@stripped, 2007-09-17 21:23:40+05:00, gshchepa@stripped +11 -7
    Fixed bug #29985.
    1. Connection flags have been changed: the CLIENT_MULTI_STATEMENTS
    flag has been added.
    2. The run_task function has been modified to process multiple
    result sets.

  mysql-test/r/mysqlslap.result@stripped, 2007-09-17 21:24:50+05:00, gshchepa@stripped +5 -0
    Added test case for bug #29985.

  mysql-test/t/mysqlslap.test@stripped, 2007-09-17 21:24:02+05:00, gshchepa@stripped +11 -0
    Added test case for bug #29985.

diff -Nrup a/client/mysqlslap.c b/client/mysqlslap.c
--- a/client/mysqlslap.c	2007-09-05 08:03:09 +05:00
+++ b/client/mysqlslap.c	2007-09-17 21:23:40 +05:00
@@ -140,7 +140,8 @@ static my_bool opt_compress= FALSE, tty_
                auto_generate_sql= FALSE;
 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 uint commit_rate;
@@ -1877,13 +1878,16 @@ limit_not_met:
         }
       }
 
-      if (mysql_field_count(mysql))
+      do
       {
-        result= mysql_store_result(mysql);
-        while ((row = mysql_fetch_row(result)))
-          counter++;
-        mysql_free_result(result);
-      }
+        if (mysql_field_count(mysql))
+        {
+          result= mysql_store_result(mysql);
+          while ((row = mysql_fetch_row(result)))
+            counter++;
+          mysql_free_result(result);
+        }
+      } while(mysql_next_result(mysql) == 0);
       queries++;
 
       if (commit_rate && commit_rate <= trans_counter)
diff -Nrup a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result
--- a/mysql-test/r/mysqlslap.result	2007-08-10 01:01:27 +05:00
+++ b/mysql-test/r/mysqlslap.result	2007-09-17 21:24:50 +05:00
@@ -211,3 +211,8 @@ COMMIT;
 COMMIT;
 SHOW TABLES;
 DROP SCHEMA IF EXISTS `mysqlslap`;
+#
+# Bug #29985: mysqlslap -- improper handling of resultsets in SPROCs
+#
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1() SELECT 1;
diff -Nrup a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test
--- a/mysql-test/t/mysqlslap.test	2007-08-21 01:03:48 +05:00
+++ b/mysql-test/t/mysqlslap.test	2007-09-17 21:24:02 +05:00
@@ -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 --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 
Thread
bk commit into 5.1 tree (gshchepa:1.2614) BUG#29985gshchepa17 Sep