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
23095e27
Commit
23095e27
authored
Aug 07, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
parents
25201f23
84d34d9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+17
-2
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+15
-0
sql/item_subselect.cc
sql/item_subselect.cc
+9
-4
No files found.
mysql-test/r/subselect.result
View file @
23095e27
...
@@ -932,7 +932,7 @@ ROW(1, 1, 'a') IN (select a,b,c from t1)
...
@@ -932,7 +932,7 @@ ROW(1, 1, 'a') IN (select a,b,c from t1)
1
1
select ROW(1, 2, 'a') IN (select a,b,c from t1);
select ROW(1, 2, 'a') IN (select a,b,c from t1);
ROW(1, 2, 'a') IN (select a,b,c from t1)
ROW(1, 2, 'a') IN (select a,b,c from t1)
NULL
0
select ROW(1, 1, 'a') IN (select b,a,c from t1);
select ROW(1, 1, 'a') IN (select b,a,c from t1);
ROW(1, 1, 'a') IN (select b,a,c from t1)
ROW(1, 1, 'a') IN (select b,a,c from t1)
1
1
...
@@ -950,7 +950,7 @@ ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a')
...
@@ -950,7 +950,7 @@ ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a')
1
1
select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a')
ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a')
NULL
0
select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a')
ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a')
1
1
...
@@ -2727,3 +2727,18 @@ select * from (select max(fld) from t1) as foo;
...
@@ -2727,3 +2727,18 @@ select * from (select max(fld) from t1) as foo;
max(fld)
max(fld)
1
1
drop table t1;
drop table t1;
CREATE TABLE t1 (one int, two int, flag char(1));
CREATE TABLE t2 (one int, two int, flag char(1));
INSERT INTO t1 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N');
INSERT INTO t2 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N');
SELECT * FROM t1
WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t2 WHERE flag = 'N');
one two flag
5 6 N
7 8 N
SELECT * FROM t1
WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N');
one two flag
5 6 N
7 8 N
DROP TABLE t1,t2;
mysql-test/t/subselect.test
View file @
23095e27
...
@@ -1754,5 +1754,20 @@ insert into t1 values ('1');
...
@@ -1754,5 +1754,20 @@ insert into t1 values ('1');
select
*
from
(
select
max
(
fld
)
from
t1
)
as
foo
;
select
*
from
(
select
max
(
fld
)
from
t1
)
as
foo
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #11867: queries with ROW(,elems>) IN (SELECT DISTINCT <cols> FROM ...)
#
CREATE
TABLE
t1
(
one
int
,
two
int
,
flag
char
(
1
));
CREATE
TABLE
t2
(
one
int
,
two
int
,
flag
char
(
1
));
INSERT
INTO
t1
VALUES
(
1
,
2
,
'Y'
),(
2
,
3
,
'Y'
),(
3
,
4
,
'Y'
),(
5
,
6
,
'N'
),(
7
,
8
,
'N'
);
INSERT
INTO
t2
VALUES
(
1
,
2
,
'Y'
),(
2
,
3
,
'Y'
),(
3
,
4
,
'Y'
),(
5
,
6
,
'N'
),(
7
,
8
,
'N'
);
SELECT
*
FROM
t1
WHERE
ROW
(
one
,
two
)
IN
(
SELECT
DISTINCT
one
,
two
FROM
t2
WHERE
flag
=
'N'
);
SELECT
*
FROM
t1
WHERE
ROW
(
one
,
two
)
IN
(
SELECT
DISTINCT
one
,
two
FROM
t1
WHERE
flag
=
'N'
);
DROP
TABLE
t1
,
t2
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_subselect.cc
View file @
23095e27
...
@@ -951,14 +951,19 @@ Item_in_subselect::row_value_transformer(JOIN *join)
...
@@ -951,14 +951,19 @@ Item_in_subselect::row_value_transformer(JOIN *join)
List_iterator_fast
<
Item
>
li
(
select_lex
->
item_list
);
List_iterator_fast
<
Item
>
li
(
select_lex
->
item_list
);
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
{
Item
*
func
;
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
);
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
);
if
(
select_lex
->
ref_pointer_array
[
i
]
->
if
(
select_lex
->
ref_pointer_array
[
i
]
->
check_cols
(
left_expr
->
el
(
i
)
->
cols
()))
check_cols
(
left_expr
->
el
(
i
)
->
cols
()))
DBUG_RETURN
(
RES_ERROR
);
DBUG_RETURN
(
RES_ERROR
);
Item
*
func
=
new
Item_ref_null_helper
(
this
,
if
(
join
->
having
||
select_lex
->
with_sum_func
||
select_lex
->
ref_pointer_array
+
i
,
select_lex
->
group_list
.
elements
)
(
char
*
)
"<no matter>"
,
func
=
new
Item_ref_null_helper
(
this
,
(
char
*
)
"<list ref>"
);
select_lex
->
ref_pointer_array
+
i
,
(
char
*
)
"<no matter>"
,
(
char
*
)
"<list ref>"
);
else
func
=
li
++
;
func
=
func
=
eq_creator
.
create
(
new
Item_direct_ref
((
*
optimizer
->
get_cache
())
->
eq_creator
.
create
(
new
Item_direct_ref
((
*
optimizer
->
get_cache
())
->
addr
(
i
),
addr
(
i
),
...
...
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