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
2ab34bac
Commit
2ab34bac
authored
Oct 20, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
4eff5ab2
d8a83694
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+15
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+17
-0
sql/item_subselect.cc
sql/item_subselect.cc
+5
-0
No files found.
mysql-test/r/subselect.result
View file @
2ab34bac
...
@@ -3002,6 +3002,21 @@ field1 field2
...
@@ -3002,6 +3002,21 @@ field1 field2
1 1
1 1
1 3
1 3
DROP TABLE t1, t2;
DROP TABLE t1, t2;
CREATE TABLE t1(a int, INDEX (a));
INSERT INTO t1 VALUES (1), (3), (5), (7);
INSERT INTO t1 VALUES (NULL);
CREATE TABLE t2(a int);
INSERT INTO t2 VALUES (1),(2),(3);
EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 3
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 2 Using index
SELECT a, a IN (SELECT a FROM t1) FROM t2;
a a IN (SELECT a FROM t1)
1 1
2 NULL
3 1
DROP TABLE t1,t2;
create table t1 (df decimal(5,1));
create table t1 (df decimal(5,1));
insert into t1 values(1.1);
insert into t1 values(1.1);
insert into t1 values(2.2);
insert into t1 values(2.2);
...
...
mysql-test/t/subselect.test
View file @
2ab34bac
...
@@ -1955,6 +1955,23 @@ SELECT field1, field2
...
@@ -1955,6 +1955,23 @@ SELECT field1, field2
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug #23478: not top-level IN subquery returning a non-empty result set
# with possible NULL values by index access from the outer query
#
CREATE
TABLE
t1
(
a
int
,
INDEX
(
a
));
INSERT
INTO
t1
VALUES
(
1
),
(
3
),
(
5
),
(
7
);
INSERT
INTO
t1
VALUES
(
NULL
);
CREATE
TABLE
t2
(
a
int
);
INSERT
INTO
t2
VALUES
(
1
),(
2
),(
3
);
EXPLAIN
SELECT
a
,
a
IN
(
SELECT
a
FROM
t1
)
FROM
t2
;
SELECT
a
,
a
IN
(
SELECT
a
FROM
t1
)
FROM
t2
;
DROP
TABLE
t1
,
t2
;
# End of 4.1 tests
# End of 4.1 tests
#
#
...
...
sql/item_subselect.cc
View file @
2ab34bac
...
@@ -667,6 +667,7 @@ double Item_in_subselect::val_real()
...
@@ -667,6 +667,7 @@ double Item_in_subselect::val_real()
*/
*/
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
null_value
=
0
;
if
(
exec
())
if
(
exec
())
{
{
reset
();
reset
();
...
@@ -687,6 +688,7 @@ longlong Item_in_subselect::val_int()
...
@@ -687,6 +688,7 @@ longlong Item_in_subselect::val_int()
*/
*/
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
null_value
=
0
;
if
(
exec
())
if
(
exec
())
{
{
reset
();
reset
();
...
@@ -707,6 +709,7 @@ String *Item_in_subselect::val_str(String *str)
...
@@ -707,6 +709,7 @@ String *Item_in_subselect::val_str(String *str)
*/
*/
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
null_value
=
0
;
if
(
exec
())
if
(
exec
())
{
{
reset
();
reset
();
...
@@ -726,6 +729,7 @@ String *Item_in_subselect::val_str(String *str)
...
@@ -726,6 +729,7 @@ String *Item_in_subselect::val_str(String *str)
bool
Item_in_subselect
::
val_bool
()
bool
Item_in_subselect
::
val_bool
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
null_value
=
0
;
if
(
exec
())
if
(
exec
())
{
{
reset
();
reset
();
...
@@ -744,6 +748,7 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value)
...
@@ -744,6 +748,7 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value)
method should not be used
method should not be used
*/
*/
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
null_value
=
0
;
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
exec
())
if
(
exec
())
{
{
...
...
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