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
71371a9d
Commit
71371a9d
authored
Feb 25, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for BUG#723822
parents
227f1103
0f265b82
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
1 deletion
+41
-1
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+18
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+21
-0
sql/opt_range.cc
sql/opt_range.cc
+2
-1
No files found.
mysql-test/r/subselect4.result
View file @
71371a9d
...
...
@@ -689,3 +689,21 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY X ALL NULL NULL NULL NULL 10
2 DEPENDENT SUBQUERY B ALL a,b NULL NULL NULL 1000 Range checked for each record (index map: 0x3)
drop table t1, t2;
#
# BUG#723822: Crash in get_constant_key_infix with EXISTS ( SELECT .. DISTINCT )
#
CREATE TABLE t1 ( f1 int(11), f3 varchar(1)) ;
INSERT INTO t1 VALUES ('8','c'),('5','f');
ALTER TABLE t1 ADD KEY (f3,f1);
CREATE TABLE t2 ( f4 varchar(1)) ;
INSERT INTO t2 VALUES ('f'),('d');
SELECT * FROM t2
WHERE EXISTS (
SELECT DISTINCT f3
FROM t1
WHERE f3 <= t2.f4
);
f4
f
d
drop table t1,t2;
mysql-test/t/subselect4.test
View file @
71371a9d
...
...
@@ -619,3 +619,24 @@ select a,
from
t1
A
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# BUG#723822: Crash in get_constant_key_infix with EXISTS ( SELECT .. DISTINCT )
--
echo
#
CREATE
TABLE
t1
(
f1
int
(
11
),
f3
varchar
(
1
))
;
INSERT
INTO
t1
VALUES
(
'8'
,
'c'
),(
'5'
,
'f'
);
ALTER
TABLE
t1
ADD
KEY
(
f3
,
f1
);
CREATE
TABLE
t2
(
f4
varchar
(
1
))
;
INSERT
INTO
t2
VALUES
(
'f'
),(
'd'
);
SELECT
*
FROM
t2
WHERE
EXISTS
(
SELECT
DISTINCT
f3
FROM
t1
WHERE
f3
<=
t2
.
f4
);
drop
table
t1
,
t2
;
sql/opt_range.cc
View file @
71371a9d
...
...
@@ -11857,7 +11857,8 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
Find the range tree for the current keypart. We assume that
index_range_tree points to the leftmost keypart in the index.
*/
for
(
cur_range
=
index_range_tree
;
cur_range
;
for
(
cur_range
=
index_range_tree
;
cur_range
&&
cur_range
->
type
==
SEL_ARG
::
KEY_RANGE
;
cur_range
=
cur_range
->
next_key_part
)
{
if
(
cur_range
->
field
->
eq
(
cur_part
->
field
))
...
...
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