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
4f93e841
Commit
4f93e841
authored
Jun 23, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
d66770b5
893c6c9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+21
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+22
-0
sql/opt_range.cc
sql/opt_range.cc
+4
-1
No files found.
mysql-test/r/subselect.result
View file @
4f93e841
...
...
@@ -2816,3 +2816,24 @@ select * from t1;
EMPNUM
E1
DROP TABLE t1,t2;
CREATE TABLE t1(select_id BIGINT, values_id BIGINT);
INSERT INTO t1 VALUES (1, 1);
CREATE TABLE t2 (select_id BIGINT, values_id BIGINT,
PRIMARY KEY(select_id,values_id));
INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5);
SELECT values_id FROM t1
WHERE values_id IN (SELECT values_id FROM t2
WHERE select_id IN (1, 0));
values_id
1
SELECT values_id FROM t1
WHERE values_id IN (SELECT values_id FROM t2
WHERE select_id BETWEEN 0 AND 1);
values_id
1
SELECT values_id FROM t1
WHERE values_id IN (SELECT values_id FROM t2
WHERE select_id = 0 OR select_id = 1);
values_id
1
DROP TABLE t1, t2;
mysql-test/t/subselect.test
View file @
4f93e841
...
...
@@ -1837,3 +1837,25 @@ WHERE t1.EMPNUM NOT IN
WHERE
t1
.
EMPNUM
=
t2
.
EMPNUM
);
select
*
from
t1
;
DROP
TABLE
t1
,
t2
;
#
# Test for bug #11487: range access in a subquery
#
CREATE
TABLE
t1
(
select_id
BIGINT
,
values_id
BIGINT
);
INSERT
INTO
t1
VALUES
(
1
,
1
);
CREATE
TABLE
t2
(
select_id
BIGINT
,
values_id
BIGINT
,
PRIMARY
KEY
(
select_id
,
values_id
));
INSERT
INTO
t2
VALUES
(
0
,
1
),
(
0
,
2
),
(
0
,
3
),
(
1
,
5
);
SELECT
values_id
FROM
t1
WHERE
values_id
IN
(
SELECT
values_id
FROM
t2
WHERE
select_id
IN
(
1
,
0
));
SELECT
values_id
FROM
t1
WHERE
values_id
IN
(
SELECT
values_id
FROM
t2
WHERE
select_id
BETWEEN
0
AND
1
);
SELECT
values_id
FROM
t1
WHERE
values_id
IN
(
SELECT
values_id
FROM
t2
WHERE
select_id
=
0
OR
select_id
=
1
);
DROP
TABLE
t1
,
t2
;
sql/opt_range.cc
View file @
4f93e841
...
...
@@ -5992,7 +5992,10 @@ int QUICK_RANGE_SELECT::reset()
next
=
0
;
range
=
NULL
;
cur_range
=
(
QUICK_RANGE
**
)
ranges
.
buffer
;
if
(
file
->
inited
==
handler
::
NONE
&&
(
error
=
file
->
ha_index_init
(
index
)))
DBUG_RETURN
(
error
);
/* Do not allocate the buffers twice. */
if
(
multi_range_length
)
{
...
...
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