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
6bc209c2
Commit
6bc209c2
authored
Jan 12, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge BUG#675118 into maria-5.1
parents
3e77b1da
ef623209
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
mysql-test/r/table_elim.result
mysql-test/r/table_elim.result
+31
-0
mysql-test/t/table_elim.test
mysql-test/t/table_elim.test
+32
-0
sql/table.h
sql/table.h
+1
-1
No files found.
mysql-test/r/table_elim.result
View file @
6bc209c2
...
...
@@ -535,3 +535,34 @@ HAVING
field4 != 6;
field1 field2 field3 field4 field5 field6
drop table t0,t1,t2,t3,t4,t5,t6;
#
# BUG#675118: Elimination of a table results in an invalid execution plan
#
CREATE TABLE t1 (f1 int(11), PRIMARY KEY (f1)) ;
CREATE TABLE t2 (f4 varchar(1024), KEY (f4)) ;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
INSERT IGNORE INTO t2 VALUES ('xcddwntkbxyorzdv'),
('cnxxcddwntkbxyor'),('r'),('r'), ('did'),('I'),('when'),
('hczkfqjeggivdvac'),('e'),('okay'),('up');
CREATE TABLE t3 (f4 varchar(1024), f1 int(11), f2 int(11)) ;
INSERT IGNORE INTO t3 VALUES ('f','4','0'),('n','5','-996540416');
CREATE TABLE t4 (f1 int(11), f3 varchar(10)) ;
INSERT IGNORE INTO t4 VALUES ('8','n'),('9','nwzcerzsgx'),('10','c');
CREATE TABLE t5 (f5 int(11), KEY (f5)) ;
EXPLAIN
SELECT t3.f2
FROM t2
LEFT JOIN t3
LEFT JOIN t4
LEFT JOIN t1 ON t4.f1 = t1.f1
JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4
WHERE t3.f2 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t5 ref f5 f5 5 test.t3.f1 2 Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 ALL f4 NULL NULL NULL 11 Using where; Using join buffer
# ^^ The above must not produce a QEP of t3,t5,t2,t4
# as that violates the "no interleaving of outer join nests" rule.
DROP TABLE t1,t2,t3,t4,t5;
mysql-test/t/table_elim.test
View file @
6bc209c2
...
...
@@ -467,3 +467,35 @@ HAVING
field4
!=
6
;
drop
table
t0
,
t1
,
t2
,
t3
,
t4
,
t5
,
t6
;
--
echo
#
--
echo
# BUG#675118: Elimination of a table results in an invalid execution plan
--
echo
#
CREATE
TABLE
t1
(
f1
int
(
11
),
PRIMARY
KEY
(
f1
))
;
CREATE
TABLE
t2
(
f4
varchar
(
1024
),
KEY
(
f4
))
;
INSERT
IGNORE
INTO
t2
VALUES
(
'xcddwntkbxyorzdv'
),
(
'cnxxcddwntkbxyor'
),(
'r'
),(
'r'
),
(
'did'
),(
'I'
),(
'when'
),
(
'hczkfqjeggivdvac'
),(
'e'
),(
'okay'
),(
'up'
);
CREATE
TABLE
t3
(
f4
varchar
(
1024
),
f1
int
(
11
),
f2
int
(
11
))
;
INSERT
IGNORE
INTO
t3
VALUES
(
'f'
,
'4'
,
'0'
),(
'n'
,
'5'
,
'-996540416'
);
CREATE
TABLE
t4
(
f1
int
(
11
),
f3
varchar
(
10
))
;
INSERT
IGNORE
INTO
t4
VALUES
(
'8'
,
'n'
),(
'9'
,
'nwzcerzsgx'
),(
'10'
,
'c'
);
CREATE
TABLE
t5
(
f5
int
(
11
),
KEY
(
f5
))
;
EXPLAIN
SELECT
t3
.
f2
FROM
t2
LEFT
JOIN
t3
LEFT
JOIN
t4
LEFT
JOIN
t1
ON
t4
.
f1
=
t1
.
f1
JOIN
t5
ON
t4
.
f3
ON
t3
.
f1
=
t5
.
f5
ON
t2
.
f4
=
t3
.
f4
WHERE
t3
.
f2
;
--
echo
# ^^ The above must not produce a QEP of t3,t5,t2,t4
--
echo
# as that violates the "no interleaving of outer join nests" rule.
DROP
TABLE
t1
,
t2
,
t3
,
t4
,
t5
;
sql/table.h
View file @
6bc209c2
...
...
@@ -1736,7 +1736,7 @@ typedef struct st_nested_join
2. All child join nest nodes are fully covered.
*/
bool
is_fully_covered
()
const
{
return
join_list
.
element
s
==
counter
;
}
bool
is_fully_covered
()
const
{
return
n_table
s
==
counter
;
}
}
NESTED_JOIN
;
...
...
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