Skip to content

Commit c9414cc

Browse files
committed
Move debug dependent MDEV-32441 test in separate file
1 parent 69c07f7 commit c9414cc

File tree

4 files changed

+234
-233
lines changed

4 files changed

+234
-233
lines changed

mysql-test/main/status2.result

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -83,122 +83,3 @@ variable_value < 1024*1024*1024
8383
#
8484
# End of 10.2 tests
8585
#
86-
#
87-
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
88-
# is selected
89-
#
90-
create table t1 (a int) engine=aria;
91-
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
92-
flush status;
93-
create function if not exists f() returns int return
94-
(
95-
select sum(a) > 0 from t1
96-
);
97-
select f() from seq_1_to_10 where seq%5 = 0;
98-
f()
99-
1
100-
1
101-
show status like "rows_sent";
102-
Variable_name Value
103-
Rows_sent 2
104-
# Test simple query
105-
set debug_sync='RESET';
106-
connect con1,localhost,root,,;
107-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
108-
select f() from seq_1_to_10 where seq%5 = 0;
109-
connection default;
110-
set debug_sync='now WAIT_FOR parked';
111-
# Result should be 2, 10+7*2=24
112-
select sent_rows, examined_rows from information_schema.processlist where id=#;
113-
sent_rows examined_rows
114-
2 24
115-
set debug_sync='now signal go';
116-
connection con1;
117-
f()
118-
1
119-
1
120-
# Test union
121-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
122-
select a from t1 where a not in (1,2,3,4) union select a from t1 where a not in (4,5,6,7);
123-
connection default;
124-
set debug_sync='now WAIT_FOR parked';
125-
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
126-
select sent_rows, examined_rows from information_schema.processlist where id=#;
127-
sent_rows examined_rows
128-
6 20
129-
set debug_sync='now signal go';
130-
connection con1;
131-
a
132-
5
133-
6
134-
7
135-
1
136-
2
137-
3
138-
# Test handler calls
139-
handler t1 open;
140-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
141-
handler t1 read NEXT LIMIT 2,4;
142-
connection default;
143-
set debug_sync='now WAIT_FOR parked';
144-
# Result should be 2, 10+7*2=24
145-
select sent_rows, examined_rows from information_schema.processlist where id=#;
146-
sent_rows examined_rows
147-
4 6
148-
set debug_sync='now signal go';
149-
connection con1;
150-
a
151-
3
152-
4
153-
5
154-
6
155-
handler t1 close;
156-
connection default;
157-
drop function f;
158-
drop table t1;
159-
# Test Stored procedures
160-
create or replace table t (a int primary key);
161-
insert into t select seq from seq_1_to_100;
162-
create procedure pr()
163-
begin
164-
select * from t where a between 1 and 2 ;
165-
select * from t where a between 4 and 6 ;
166-
end $
167-
connection con1;
168-
flush status;
169-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
170-
call pr();
171-
connection default;
172-
set debug_sync='now WAIT_FOR parked';
173-
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
174-
examined_rows sent_rows info
175-
2 2 select * from t where a between 1 and 2
176-
set debug_sync='now signal go';
177-
set debug_sync='now WAIT_FOR parked';
178-
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
179-
examined_rows sent_rows info
180-
3 3 select * from t where a between 4 and 6
181-
set debug_sync='now signal go';
182-
connection con1;
183-
a
184-
1
185-
2
186-
a
187-
4
188-
5
189-
6
190-
show status like '%rows%';
191-
Variable_name Value
192-
Not_flushed_delayed_rows 0
193-
Rows_read 8
194-
Rows_sent 5
195-
Rows_tmp_read 0
196-
Sort_rows 0
197-
connection default;
198-
drop table t;
199-
drop procedure pr;
200-
disconnect con1;
201-
set debug_sync= RESET;
202-
#
203-
# End of 11.3 tests
204-
#

mysql-test/main/status2.test

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
--source include/not_embedded.inc
2-
--source include/have_sequence.inc
3-
--source include/have_debug_sync.inc
4-
--source include/have_sequence.inc
52

63
--echo #
74
--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
@@ -79,114 +76,3 @@ select variable_value < 1024*1024*1024 from information_schema.global_status whe
7976
--echo #
8077
--echo # End of 10.2 tests
8178
--echo #
82-
83-
--echo #
84-
--echo # MDEV-32441 SENT_ROWS shows random wrong values when stored function
85-
--echo # is selected
86-
--echo #
87-
88-
create table t1 (a int) engine=aria;
89-
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
90-
flush status;
91-
create function if not exists f() returns int return
92-
(
93-
select sum(a) > 0 from t1
94-
);
95-
96-
--disable_ps_protocol
97-
select f() from seq_1_to_10 where seq%5 = 0;
98-
show status like "rows_sent";
99-
--enable_ps_protocol
100-
101-
--echo # Test simple query
102-
103-
set debug_sync='RESET';
104-
--connect(con1,localhost,root,,)
105-
--let $conid= `select connection_id()`
106-
--let $replace_conid=id=$conid
107-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
108-
--send select f() from seq_1_to_10 where seq%5 = 0
109-
110-
--connection default
111-
set debug_sync='now WAIT_FOR parked';
112-
--echo # Result should be 2, 10+7*2=24
113-
--replace_result $replace_conid id=#
114-
eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
115-
set debug_sync='now signal go';
116-
--connection con1
117-
--reap
118-
119-
--echo # Test union
120-
121-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
122-
--send select a from t1 where a not in (1,2,3,4) union select a from t1 where a not in (4,5,6,7)
123-
--connection default
124-
set debug_sync='now WAIT_FOR parked';
125-
--echo # Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
126-
--replace_result $replace_conid id=#
127-
eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
128-
set debug_sync='now signal go';
129-
--connection con1
130-
--reap
131-
132-
--echo # Test handler calls
133-
handler t1 open;
134-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
135-
--send handler t1 read NEXT LIMIT 2,4
136-
--connection default
137-
set debug_sync='now WAIT_FOR parked';
138-
--echo # Result should be 2, 10+7*2=24
139-
--replace_result $replace_conid id=#
140-
eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
141-
set debug_sync='now signal go';
142-
--connection con1
143-
--reap
144-
handler t1 close;
145-
146-
--connection default
147-
drop function f;
148-
drop table t1;
149-
150-
--echo # Test Stored procedures
151-
152-
create or replace table t (a int primary key);
153-
insert into t select seq from seq_1_to_100;
154-
--delimiter $
155-
create procedure pr()
156-
begin
157-
select * from t where a between 1 and 2 ;
158-
select * from t where a between 4 and 6 ;
159-
end $
160-
--delimiter ;
161-
162-
--connection con1
163-
flush status;
164-
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
165-
166-
--send call pr()
167-
168-
--connection default
169-
set debug_sync='now WAIT_FOR parked';
170-
--replace_result $replace_conid id=#
171-
eval select examined_rows, sent_rows, info from information_schema.processlist where id=$conid;
172-
set debug_sync='now signal go';
173-
set debug_sync='now WAIT_FOR parked';
174-
--replace_result $replace_conid id=#
175-
eval select examined_rows, sent_rows, info from information_schema.processlist where id=$conid;
176-
set debug_sync='now signal go';
177-
178-
--connection con1
179-
--reap
180-
show status like '%rows%';
181-
182-
connection default;
183-
# Cleanup
184-
drop table t;
185-
drop procedure pr;
186-
187-
--disconnect con1
188-
set debug_sync= RESET;
189-
190-
--echo #
191-
--echo # End of 11.3 tests
192-
--echo #

mysql-test/main/status_debug.result

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#
2+
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
3+
# is selected
4+
#
5+
create table t1 (a int) engine=aria;
6+
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
7+
flush status;
8+
create function if not exists f() returns int return
9+
(
10+
select sum(a) > 0 from t1
11+
);
12+
select f() from seq_1_to_10 where seq%5 = 0;
13+
f()
14+
1
15+
1
16+
show status like "rows_sent";
17+
Variable_name Value
18+
Rows_sent 2
19+
# Test simple query
20+
set debug_sync='RESET';
21+
connect con1,localhost,root,,;
22+
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
23+
select f() from seq_1_to_10 where seq%5 = 0;
24+
connection default;
25+
set debug_sync='now WAIT_FOR parked';
26+
# Result should be 2, 10+7*2=24
27+
select sent_rows, examined_rows from information_schema.processlist where id=#;
28+
sent_rows examined_rows
29+
2 24
30+
set debug_sync='now signal go';
31+
connection con1;
32+
f()
33+
1
34+
1
35+
# Test union
36+
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
37+
select a from t1 where a not in (1,2,3,4) union select a from t1 where a not in (4,5,6,7);
38+
connection default;
39+
set debug_sync='now WAIT_FOR parked';
40+
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
41+
select sent_rows, examined_rows from information_schema.processlist where id=#;
42+
sent_rows examined_rows
43+
6 20
44+
set debug_sync='now signal go';
45+
connection con1;
46+
a
47+
5
48+
6
49+
7
50+
1
51+
2
52+
3
53+
# Test handler calls
54+
handler t1 open;
55+
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
56+
handler t1 read NEXT LIMIT 2,4;
57+
connection default;
58+
set debug_sync='now WAIT_FOR parked';
59+
# Result should be 2, 10+7*2=24
60+
select sent_rows, examined_rows from information_schema.processlist where id=#;
61+
sent_rows examined_rows
62+
4 6
63+
set debug_sync='now signal go';
64+
connection con1;
65+
a
66+
3
67+
4
68+
5
69+
6
70+
handler t1 close;
71+
connection default;
72+
drop function f;
73+
drop table t1;
74+
# Test Stored procedures
75+
create or replace table t (a int primary key);
76+
insert into t select seq from seq_1_to_100;
77+
create procedure pr()
78+
begin
79+
select * from t where a between 1 and 2 ;
80+
select * from t where a between 4 and 6 ;
81+
end $
82+
connection con1;
83+
flush status;
84+
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
85+
call pr();
86+
connection default;
87+
set debug_sync='now WAIT_FOR parked';
88+
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
89+
examined_rows sent_rows info
90+
2 2 select * from t where a between 1 and 2
91+
set debug_sync='now signal go';
92+
set debug_sync='now WAIT_FOR parked';
93+
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
94+
examined_rows sent_rows info
95+
3 3 select * from t where a between 4 and 6
96+
set debug_sync='now signal go';
97+
connection con1;
98+
a
99+
1
100+
2
101+
a
102+
4
103+
5
104+
6
105+
show status like '%rows%';
106+
Variable_name Value
107+
Not_flushed_delayed_rows 0
108+
Rows_read 8
109+
Rows_sent 5
110+
Rows_tmp_read 0
111+
Sort_rows 0
112+
connection default;
113+
drop table t;
114+
drop procedure pr;
115+
disconnect con1;
116+
set debug_sync= RESET;
117+
#
118+
# End of 11.3 tests
119+
#

0 commit comments

Comments
 (0)