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
070a2334
Commit
070a2334
authored
Mar 20, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge host.loc:/home/uchum/work/PA/5.0-opt-34763
into host.loc:/home/uchum/work/5.0-opt sql/item.cc: Auto merged
parents
e12afb1e
9699767c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
10 deletions
+49
-10
mysql-test/r/subselect3.result
mysql-test/r/subselect3.result
+12
-1
mysql-test/t/subselect3.test
mysql-test/t/subselect3.test
+18
-1
sql/item.cc
sql/item.cc
+9
-6
sql/item_subselect.cc
sql/item_subselect.cc
+10
-2
No files found.
mysql-test/r/subselect3.result
View file @
070a2334
...
...
@@ -758,5 +758,16 @@ EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
DROP TABLE t1;
DROP TABLE t1, t2;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2 (placeholder CHAR(11));
INSERT INTO t2 VALUES("placeholder");
SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
ROW(1, 2) IN (SELECT t1.a, 2)
1
SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
1
DROP TABLE t1, t2;
End of 5.0 tests
mysql-test/t/subselect3.test
View file @
070a2334
...
...
@@ -586,6 +586,23 @@ SELECT a FROM t1 WHERE a NOT IN (65,66);
SELECT
a
FROM
t1
WHERE
a
NOT
IN
(
SELECT
a
FROM
t2
);
EXPLAIN
SELECT
a
FROM
t1
WHERE
a
NOT
IN
(
SELECT
a
FROM
t2
);
DROP
TABLE
t1
;
DROP
TABLE
t1
,
t2
;
#
# Bug #34763: item_subselect.cc:1235:Item_in_subselect::row_value_transformer:
# Assertion failed, unexpected error message:
# ERROR 1247 (42S22): Reference '<list ref>' not supported (forward
# reference in item list)
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
);
CREATE
TABLE
t2
(
placeholder
CHAR
(
11
));
INSERT
INTO
t2
VALUES
(
"placeholder"
);
SELECT
ROW
(
1
,
2
)
IN
(
SELECT
t1
.
a
,
2
)
FROM
t1
GROUP
BY
t1
.
a
;
SELECT
ROW
(
1
,
2
)
IN
(
SELECT
t1
.
a
,
2
FROM
t2
)
FROM
t1
GROUP
BY
t1
.
a
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
sql/item.cc
View file @
070a2334
...
...
@@ -5481,13 +5481,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
DBUG_ASSERT
(
*
ref
);
/*
Check if this is an incorrect reference in a group function or forward
reference. Do not issue an error if this is an unnamed reference inside an
aggregate function.
reference. Do not issue an error if this is:
1. outer reference (will be fixed later by the fix_inner_refs function);
2. an unnamed reference inside an aggregate function.
*/
if
(((
*
ref
)
->
with_sum_func
&&
name
&&
if
(
!
((
*
ref
)
->
type
()
==
REF_ITEM
&&
((
Item_ref
*
)(
*
ref
))
->
ref_type
()
==
OUTER_REF
)
&&
(((
*
ref
)
->
with_sum_func
&&
name
&&
!
(
current_sel
->
linkage
!=
GLOBAL_OPTIONS_TYPE
&&
current_sel
->
having_fix_field
))
||
!
(
*
ref
)
->
fixed
)
!
(
*
ref
)
->
fixed
)
)
{
my_error
(
ER_ILLEGAL_REFERENCE
,
MYF
(
0
),
name
,
((
*
ref
)
->
with_sum_func
?
...
...
sql/item_subselect.cc
View file @
070a2334
...
...
@@ -1232,7 +1232,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
Item
*
item_having_part2
=
0
;
for
(
uint
i
=
0
;
i
<
cols_num
;
i
++
)
{
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
);
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
||
(
select_lex
->
ref_pointer_array
[
i
]
->
type
()
==
REF_ITEM
&&
((
Item_ref
*
)(
select_lex
->
ref_pointer_array
[
i
]))
->
ref_type
()
==
Item_ref
::
OUTER_REF
));
if
(
select_lex
->
ref_pointer_array
[
i
]
->
check_cols
(
left_expr
->
element_index
(
i
)
->
cols
()))
DBUG_RETURN
(
RES_ERROR
);
...
...
@@ -1306,7 +1310,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
for
(
uint
i
=
0
;
i
<
cols_num
;
i
++
)
{
Item
*
item
,
*
item_isnull
;
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
);
DBUG_ASSERT
(
left_expr
->
fixed
&&
select_lex
->
ref_pointer_array
[
i
]
->
fixed
||
(
select_lex
->
ref_pointer_array
[
i
]
->
type
()
==
REF_ITEM
&&
((
Item_ref
*
)(
select_lex
->
ref_pointer_array
[
i
]))
->
ref_type
()
==
Item_ref
::
OUTER_REF
));
if
(
select_lex
->
ref_pointer_array
[
i
]
->
check_cols
(
left_expr
->
element_index
(
i
)
->
cols
()))
DBUG_RETURN
(
RES_ERROR
);
...
...
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