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
1b7a2e4c
Commit
1b7a2e4c
authored
Aug 17, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13510 main.delete_use_source fails in buildbot and outside with wrong plan
parent
935c6f50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
mysql-test/r/delete_use_source.result
mysql-test/r/delete_use_source.result
+15
-12
mysql-test/t/delete_use_source.test
mysql-test/t/delete_use_source.test
+6
-5
No files found.
mysql-test/r/delete_use_source.result
View file @
1b7a2e4c
create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
create view v1 as select * from t1 where c1 in (0,1);
create view v1 as select * from t1 where c1 in (0,1);
insert t1 select 0,seq from seq_1_to_500;
insert t1 select 0,seq from seq_1_to_500;
insert t1 select 1,seq from seq_1_to_
5
0;
insert t1 select 1,seq from seq_1_to_
10
0;
insert t1 select 2,seq from seq_1_to_
2
0;
insert t1 select 2,seq from seq_1_to_
5
0;
insert t1 select 3,seq from seq_1_to_20;
insert t1 select 3,seq from seq_1_to_20;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
#
#
# Delete with limit (quick select - range acces)
# Delete with limit (quick select - range acces)
#
#
...
@@ -31,7 +34,7 @@ select count(*) from v1 where c1=2;
...
@@ -31,7 +34,7 @@ select count(*) from v1 where c1=2;
count(*)
count(*)
0
0
delete from t1 where c1=2 and exists(select 'x' from t1 b where b.c2<10);
delete from t1 where c1=2 and exists(select 'x' from t1 b where b.c2<10);
affected rows:
2
0
affected rows:
5
0
delete from t1 where c1=2 and exists(select 'x' from t1 b where b.c2<10);
delete from t1 where c1=2 and exists(select 'x' from t1 b where b.c2<10);
affected rows: 0
affected rows: 0
select count(*) from v1 where c1=2;
select count(*) from v1 where c1=2;
...
@@ -39,13 +42,13 @@ count(*)
...
@@ -39,13 +42,13 @@ count(*)
0
0
rollback;
rollback;
#
#
# Delete thro
w
a view with limit (range access)
# Delete thro
ugh
a view with limit (range access)
#
#
start transaction;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1
range c1 c1 4 NULL 550
Using where
1 PRIMARY t1
ALL c1 NULL NULL NULL 502
Using where
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1
82
Using index
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1
58
Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
affected rows: 1
affected rows: 1
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
...
@@ -55,13 +58,13 @@ count(*)
...
@@ -55,13 +58,13 @@ count(*)
499
499
rollback;
rollback;
#
#
# Delete thro
w
a view (ALL access)
# Delete thro
ugh
a view (ALL access)
#
#
start transaction;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL c1 NULL NULL NULL
717
Using where
1 PRIMARY t1 ALL c1 NULL NULL NULL
502
Using where
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1
82
Using index
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1
58
Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ;
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ;
affected rows: 500
affected rows: 500
select count(*) from v1 where c1=0;
select count(*) from v1 where c1=0;
...
@@ -92,13 +95,13 @@ ERROR 45000: Unhandled user-defined exception condition
...
@@ -92,13 +95,13 @@ ERROR 45000: Unhandled user-defined exception condition
select c1,count(*) from t1 group by c1;
select c1,count(*) from t1 group by c1;
c1 count(*)
c1 count(*)
0 500
0 500
1
5
0
1
10
0
2
2
0
2
5
0
3 20
3 20
rollback;
rollback;
drop trigger trg;
drop trigger trg;
#
#
# Delete thro
w
a view with returning
# Delete thro
ugh
a view with returning
#
#
start transaction;
start transaction;
delete from t1 where (select count(*) from t1 b where b.c1=t1.c1) = 500 order by c2 asc limit 10 returning c1,c2;
delete from t1 where (select count(*) from t1 b where b.c1=t1.c1) = 500 order by c2 asc limit 10 returning c1,c2;
...
...
mysql-test/t/delete_use_source.test
View file @
1b7a2e4c
...
@@ -4,9 +4,10 @@ create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb
...
@@ -4,9 +4,10 @@ create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb
create
view
v1
as
select
*
from
t1
where
c1
in
(
0
,
1
);
create
view
v1
as
select
*
from
t1
where
c1
in
(
0
,
1
);
insert
t1
select
0
,
seq
from
seq_1_to_500
;
insert
t1
select
0
,
seq
from
seq_1_to_500
;
insert
t1
select
1
,
seq
from
seq_1_to_
5
0
;
insert
t1
select
1
,
seq
from
seq_1_to_
10
0
;
insert
t1
select
2
,
seq
from
seq_1_to_
2
0
;
insert
t1
select
2
,
seq
from
seq_1_to_
5
0
;
insert
t1
select
3
,
seq
from
seq_1_to_20
;
insert
t1
select
3
,
seq
from
seq_1_to_20
;
analyze
table
t1
;
--
echo
#
--
echo
#
--
echo
# Delete with limit (quick select - range acces)
--
echo
# Delete with limit (quick select - range acces)
...
@@ -43,7 +44,7 @@ select count(*) from v1 where c1=2;
...
@@ -43,7 +44,7 @@ select count(*) from v1 where c1=2;
rollback
;
rollback
;
--
echo
#
--
echo
#
--
echo
# Delete thro
w
a view with limit (range access)
--
echo
# Delete thro
ugh
a view with limit (range access)
--
echo
#
--
echo
#
start
transaction
;
start
transaction
;
...
@@ -56,7 +57,7 @@ select count(*) from v1 where c1=0;
...
@@ -56,7 +57,7 @@ select count(*) from v1 where c1=0;
rollback
;
rollback
;
--
echo
#
--
echo
#
--
echo
# Delete thro
w
a view (ALL access)
--
echo
# Delete thro
ugh
a view (ALL access)
--
echo
#
--
echo
#
start
transaction
;
start
transaction
;
...
@@ -97,7 +98,7 @@ rollback;
...
@@ -97,7 +98,7 @@ rollback;
drop
trigger
trg
;
drop
trigger
trg
;
--
echo
#
--
echo
#
--
echo
# Delete thro
w
a view with returning
--
echo
# Delete thro
ugh
a view with returning
--
echo
#
--
echo
#
start
transaction
;
start
transaction
;
...
...
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