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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5ed99790
Commit
5ed99790
authored
Apr 04, 2011
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case for LP BUG#715062.
There is no patch because the bug cannot be reproduced any more.
parent
619a16bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
0 deletions
+185
-0
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+121
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+64
-0
No files found.
mysql-test/r/subselect4.result
View file @
5ed99790
...
...
@@ -1454,3 +1454,124 @@ WHERE SQ2_t2.f3 AND alias1.f1)
ORDER BY f3 ;
f2
drop table t1,t2;
#
# LP BUG#715062: Wrong result with VIEW + UNION + subquery in maria-5.3-mwl89
#
create table t1 (f1 int);
create table t2 (f2 int);
create table t3 (f3 int);
insert into t1 values (2);
insert into t2 values (2);
insert into t3 values (7);
CREATE VIEW v1 AS SELECT 2 UNION SELECT 2 ;
CREATE VIEW v2 AS SELECT * from t1 UNION SELECT * from t2 ;
set @save_optimizer_switch=@@optimizer_switch;
SET @@optimizer_switch = 'in_to_exists=off,semijoin=off,materialization=on';
EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
bug
EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT ( 5 ) IN ( SELECT * FROM v1 );
( 5 ) IN ( SELECT * FROM v1 )
0
EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
bug
EXPLAIN
SELECT 'bug' FROM t3 WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
2 SUBQUERY <derived3> system NULL NULL NULL NULL 1
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM t3 WHERE ( 5 ) IN (SELECT * FROM v2);
bug
EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT ( 5 ) IN ( SELECT * FROM v2 );
( 5 ) IN ( SELECT * FROM v2 )
0
SET @@optimizer_switch = 'in_to_exists=on,semijoin=off,materialization=off';
EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
bug
EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT ( 5 ) IN ( SELECT * FROM v1 );
( 5 ) IN ( SELECT * FROM v1 )
0
EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
bug
EXPLAIN
SELECT 'bug' FROM t3 WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT 'bug' FROM t3 WHERE ( 5 ) IN (SELECT * FROM v2);
bug
EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
SELECT ( 5 ) IN ( SELECT * FROM v2 );
( 5 ) IN ( SELECT * FROM v2 )
0
set @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
drop view v1,v2;
mysql-test/t/subselect4.test
View file @
5ed99790
...
...
@@ -1200,3 +1200,67 @@ WHERE (SELECT SQ2_t2.f1
ORDER
BY
f3
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# LP BUG#715062: Wrong result with VIEW + UNION + subquery in maria-5.3-mwl89
--
echo
#
create
table
t1
(
f1
int
);
create
table
t2
(
f2
int
);
create
table
t3
(
f3
int
);
insert
into
t1
values
(
2
);
insert
into
t2
values
(
2
);
insert
into
t3
values
(
7
);
CREATE
VIEW
v1
AS
SELECT
2
UNION
SELECT
2
;
CREATE
VIEW
v2
AS
SELECT
*
from
t1
UNION
SELECT
*
from
t2
;
set
@
save_optimizer_switch
=@@
optimizer_switch
;
SET
@@
optimizer_switch
=
'in_to_exists=off,semijoin=off,materialization=on'
;
EXPLAIN
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v1
);
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v1
);
EXPLAIN
SELECT
(
5
)
IN
(
SELECT
*
FROM
v1
);
SELECT
(
5
)
IN
(
SELECT
*
FROM
v1
);
EXPLAIN
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
EXPLAIN
SELECT
'bug'
FROM
t3
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
'bug'
FROM
t3
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
EXPLAIN
SELECT
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
(
5
)
IN
(
SELECT
*
FROM
v2
);
SET
@@
optimizer_switch
=
'in_to_exists=on,semijoin=off,materialization=off'
;
EXPLAIN
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v1
);
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v1
);
EXPLAIN
SELECT
(
5
)
IN
(
SELECT
*
FROM
v1
);
SELECT
(
5
)
IN
(
SELECT
*
FROM
v1
);
EXPLAIN
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
'bug'
FROM
DUAL
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
EXPLAIN
SELECT
'bug'
FROM
t3
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
'bug'
FROM
t3
WHERE
(
5
)
IN
(
SELECT
*
FROM
v2
);
EXPLAIN
SELECT
(
5
)
IN
(
SELECT
*
FROM
v2
);
SELECT
(
5
)
IN
(
SELECT
*
FROM
v2
);
set
@@
optimizer_switch
=@
save_optimizer_switch
;
drop
table
t1
,
t2
,
t3
;
drop
view
v1
,
v2
;
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