Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c9414ccd
Commit
c9414ccd
authored
Jun 13, 2024
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move debug dependent MDEV-32441 test in separate file
parent
69c07f70
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
234 additions
and
233 deletions
+234
-233
mysql-test/main/status2.result
mysql-test/main/status2.result
+0
-119
mysql-test/main/status2.test
mysql-test/main/status2.test
+0
-114
mysql-test/main/status_debug.result
mysql-test/main/status_debug.result
+119
-0
mysql-test/main/status_debug.test
mysql-test/main/status_debug.test
+115
-0
No files found.
mysql-test/main/status2.result
View file @
c9414ccd
...
...
@@ -83,122 +83,3 @@ variable_value < 1024*1024*1024
#
# End of 10.2 tests
#
#
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
# is selected
#
create table t1 (a int) engine=aria;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
flush status;
create function if not exists f() returns int return
(
select sum(a) > 0 from t1
);
select f() from seq_1_to_10 where seq%5 = 0;
f()
1
1
show status like "rows_sent";
Variable_name Value
Rows_sent 2
# Test simple query
set debug_sync='RESET';
connect con1,localhost,root,,;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
select f() from seq_1_to_10 where seq%5 = 0;
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 2, 10+7*2=24
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
2 24
set debug_sync='now signal go';
connection con1;
f()
1
1
# Test union
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
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);
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
6 20
set debug_sync='now signal go';
connection con1;
a
5
6
7
1
2
3
# Test handler calls
handler t1 open;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
handler t1 read NEXT LIMIT 2,4;
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 2, 10+7*2=24
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
4 6
set debug_sync='now signal go';
connection con1;
a
3
4
5
6
handler t1 close;
connection default;
drop function f;
drop table t1;
# Test Stored procedures
create or replace table t (a int primary key);
insert into t select seq from seq_1_to_100;
create procedure pr()
begin
select * from t where a between 1 and 2 ;
select * from t where a between 4 and 6 ;
end $
connection con1;
flush status;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
call pr();
connection default;
set debug_sync='now WAIT_FOR parked';
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
examined_rows sent_rows info
2 2 select * from t where a between 1 and 2
set debug_sync='now signal go';
set debug_sync='now WAIT_FOR parked';
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
examined_rows sent_rows info
3 3 select * from t where a between 4 and 6
set debug_sync='now signal go';
connection con1;
a
1
2
a
4
5
6
show status like '%rows%';
Variable_name Value
Not_flushed_delayed_rows 0
Rows_read 8
Rows_sent 5
Rows_tmp_read 0
Sort_rows 0
connection default;
drop table t;
drop procedure pr;
disconnect con1;
set debug_sync= RESET;
#
# End of 11.3 tests
#
mysql-test/main/status2.test
View file @
c9414ccd
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_sequence
.
inc
--
source
include
/
have_debug_sync
.
inc
--
source
include
/
have_sequence
.
inc
--
echo
#
--
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
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
--
echo
# is selected
--
echo
#
create
table
t1
(
a
int
)
engine
=
aria
;
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
);
flush
status
;
create
function
if
not
exists
f
()
returns
int
return
(
select
sum
(
a
)
>
0
from
t1
);
--
disable_ps_protocol
select
f
()
from
seq_1_to_10
where
seq
%
5
=
0
;
show
status
like
"rows_sent"
;
--
enable_ps_protocol
--
echo
# Test simple query
set
debug_sync
=
'RESET'
;
--
connect
(
con1
,
localhost
,
root
,,)
--
let
$conid
=
`select connection_id()`
--
let
$replace_conid
=
id
=
$conid
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
send
select
f
()
from
seq_1_to_10
where
seq
%
5
=
0
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 2, 10+7*2=24
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
--
echo
# Test union
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
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
)
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
--
echo
# Test handler calls
handler
t1
open
;
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
send
handler
t1
read
NEXT
LIMIT
2
,
4
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 2, 10+7*2=24
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
handler
t1
close
;
--
connection
default
drop
function
f
;
drop
table
t1
;
--
echo
# Test Stored procedures
create
or
replace
table
t
(
a
int
primary
key
);
insert
into
t
select
seq
from
seq_1_to_100
;
--
delimiter
$
create
procedure
pr
()
begin
select
*
from
t
where
a
between
1
and
2
;
select
*
from
t
where
a
between
4
and
6
;
end
$
--
delimiter
;
--
connection
con1
flush
status
;
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2'
;
--
send
call
pr
()
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
replace_result
$replace_conid
id
=
#
eval
select
examined_rows
,
sent_rows
,
info
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
set
debug_sync
=
'now WAIT_FOR parked'
;
--
replace_result
$replace_conid
id
=
#
eval
select
examined_rows
,
sent_rows
,
info
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
show
status
like
'%rows%'
;
connection
default
;
# Cleanup
drop
table
t
;
drop
procedure
pr
;
--
disconnect
con1
set
debug_sync
=
RESET
;
--
echo
#
--
echo
# End of 11.3 tests
--
echo
#
mysql-test/main/status_debug.result
0 → 100644
View file @
c9414ccd
#
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
# is selected
#
create table t1 (a int) engine=aria;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
flush status;
create function if not exists f() returns int return
(
select sum(a) > 0 from t1
);
select f() from seq_1_to_10 where seq%5 = 0;
f()
1
1
show status like "rows_sent";
Variable_name Value
Rows_sent 2
# Test simple query
set debug_sync='RESET';
connect con1,localhost,root,,;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
select f() from seq_1_to_10 where seq%5 = 0;
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 2, 10+7*2=24
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
2 24
set debug_sync='now signal go';
connection con1;
f()
1
1
# Test union
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
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);
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
6 20
set debug_sync='now signal go';
connection con1;
a
5
6
7
1
2
3
# Test handler calls
handler t1 open;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
handler t1 read NEXT LIMIT 2,4;
connection default;
set debug_sync='now WAIT_FOR parked';
# Result should be 2, 10+7*2=24
select sent_rows, examined_rows from information_schema.processlist where id=#;
sent_rows examined_rows
4 6
set debug_sync='now signal go';
connection con1;
a
3
4
5
6
handler t1 close;
connection default;
drop function f;
drop table t1;
# Test Stored procedures
create or replace table t (a int primary key);
insert into t select seq from seq_1_to_100;
create procedure pr()
begin
select * from t where a between 1 and 2 ;
select * from t where a between 4 and 6 ;
end $
connection con1;
flush status;
set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
call pr();
connection default;
set debug_sync='now WAIT_FOR parked';
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
examined_rows sent_rows info
2 2 select * from t where a between 1 and 2
set debug_sync='now signal go';
set debug_sync='now WAIT_FOR parked';
select examined_rows, sent_rows, info from information_schema.processlist where id=#;
examined_rows sent_rows info
3 3 select * from t where a between 4 and 6
set debug_sync='now signal go';
connection con1;
a
1
2
a
4
5
6
show status like '%rows%';
Variable_name Value
Not_flushed_delayed_rows 0
Rows_read 8
Rows_sent 5
Rows_tmp_read 0
Sort_rows 0
connection default;
drop table t;
drop procedure pr;
disconnect con1;
set debug_sync= RESET;
#
# End of 11.3 tests
#
mysql-test/main/status_debug.test
0 → 100644
View file @
c9414ccd
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_debug_sync
.
inc
--
source
include
/
have_sequence
.
inc
--
echo
#
--
echo
# MDEV-32441 SENT_ROWS shows random wrong values when stored function
--
echo
# is selected
--
echo
#
create
table
t1
(
a
int
)
engine
=
aria
;
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
);
flush
status
;
create
function
if
not
exists
f
()
returns
int
return
(
select
sum
(
a
)
>
0
from
t1
);
--
disable_ps_protocol
select
f
()
from
seq_1_to_10
where
seq
%
5
=
0
;
show
status
like
"rows_sent"
;
--
enable_ps_protocol
--
echo
# Test simple query
set
debug_sync
=
'RESET'
;
--
connect
(
con1
,
localhost
,
root
,,)
--
let
$conid
=
`select connection_id()`
--
let
$replace_conid
=
id
=
$conid
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
send
select
f
()
from
seq_1_to_10
where
seq
%
5
=
0
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 2, 10+7*2=24
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
--
echo
# Test union
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
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
)
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
--
echo
# Test handler calls
handler
t1
open
;
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go'
;
--
send
handler
t1
read
NEXT
LIMIT
2
,
4
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
echo
# Result should be 2, 10+7*2=24
--
replace_result
$replace_conid
id
=
#
eval
select
sent_rows
,
examined_rows
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
handler
t1
close
;
--
connection
default
drop
function
f
;
drop
table
t1
;
--
echo
# Test Stored procedures
create
or
replace
table
t
(
a
int
primary
key
);
insert
into
t
select
seq
from
seq_1_to_100
;
--
delimiter
$
create
procedure
pr
()
begin
select
*
from
t
where
a
between
1
and
2
;
select
*
from
t
where
a
between
4
and
6
;
end
$
--
delimiter
;
--
connection
con1
flush
status
;
set
debug_sync
=
'end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2'
;
--
send
call
pr
()
--
connection
default
set
debug_sync
=
'now WAIT_FOR parked'
;
--
replace_result
$replace_conid
id
=
#
eval
select
examined_rows
,
sent_rows
,
info
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
set
debug_sync
=
'now WAIT_FOR parked'
;
--
replace_result
$replace_conid
id
=
#
eval
select
examined_rows
,
sent_rows
,
info
from
information_schema
.
processlist
where
id
=
$conid
;
set
debug_sync
=
'now signal go'
;
--
connection
con1
--
reap
show
status
like
'%rows%'
;
connection
default
;
# Cleanup
drop
table
t
;
drop
procedure
pr
;
--
disconnect
con1
set
debug_sync
=
RESET
;
--
echo
#
--
echo
# End of 11.3 tests
--
echo
#
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment