Two bugs in one! The count call was duplicating internally the counts for...

Two bugs in one! The count call was duplicating internally the counts for loaded tests (not autosql tests, just loaded). This could manifest itself by executing by file, or by executing a pre statement.
BUG#29803
parent 5a7f36fb
...@@ -1407,13 +1407,13 @@ get_options(int *argc,char ***argv) ...@@ -1407,13 +1407,13 @@ get_options(int *argc,char ***argv)
tmp_string[sbuf.st_size]= '\0'; tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0)); my_close(data_file,MYF(0));
if (user_supplied_pre_statements) if (user_supplied_pre_statements)
actual_queries= parse_delimiter(tmp_string, &pre_statements, (void)parse_delimiter(tmp_string, &pre_statements,
delimiter[0]); delimiter[0]);
my_free(tmp_string, MYF(0)); my_free(tmp_string, MYF(0));
} }
else if (user_supplied_pre_statements) else if (user_supplied_pre_statements)
{ {
actual_queries= parse_delimiter(user_supplied_pre_statements, (void)parse_delimiter(user_supplied_pre_statements,
&pre_statements, &pre_statements,
delimiter[0]); delimiter[0]);
} }
...@@ -1438,13 +1438,13 @@ get_options(int *argc,char ***argv) ...@@ -1438,13 +1438,13 @@ get_options(int *argc,char ***argv)
tmp_string[sbuf.st_size]= '\0'; tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0)); my_close(data_file,MYF(0));
if (user_supplied_post_statements) if (user_supplied_post_statements)
parse_delimiter(tmp_string, &post_statements, (void)parse_delimiter(tmp_string, &post_statements,
delimiter[0]); delimiter[0]);
my_free(tmp_string, MYF(0)); my_free(tmp_string, MYF(0));
} }
else if (user_supplied_post_statements) else if (user_supplied_post_statements)
{ {
parse_delimiter(user_supplied_post_statements, &post_statements, (void)parse_delimiter(user_supplied_post_statements, &post_statements,
delimiter[0]); delimiter[0]);
} }
...@@ -1993,7 +1993,6 @@ parse_delimiter(const char *script, statement **stmt, char delm) ...@@ -1993,7 +1993,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
ptr+= retstr - ptr + 1; ptr+= retstr - ptr + 1;
if (isspace(*ptr)) if (isspace(*ptr))
ptr++; ptr++;
count++;
} }
if (ptr != script+length) if (ptr != script+length)
......
...@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
select * from t1; select * from t1;
select * from t2; select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`; CREATE SCHEMA `mysqlslap`;
...@@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
select * from t1; select * from t1;
select * from t2; select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`; CREATE SCHEMA `mysqlslap`;
...@@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
SHOW TABLES; SHOW TABLES;
select * from t1; select * from t1;
select * from t2;
SHOW TABLES; SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
...@@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
SHOW TABLES; SHOW TABLES;
select * from t1; select * from t1;
select * from t2;
SHOW TABLES; SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
......
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