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
e2a082aa
Commit
e2a082aa
authored
Jul 26, 2006
by
gkodinov/kgeorge@rakia.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B20792-4.1-opt
parents
dd7ae38d
565d4959
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
mysql-test/r/subselect2.result
mysql-test/r/subselect2.result
+12
-0
mysql-test/t/subselect2.test
mysql-test/t/subselect2.test
+18
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-2
No files found.
mysql-test/r/subselect2.result
View file @
e2a082aa
...
@@ -130,3 +130,15 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -130,3 +130,15 @@ id select_type table type possible_keys key key_len ref rows Extra
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
drop table t1, t2, t3, t4;
drop table t1, t2, t3, t4;
CREATE TABLE t1 (a int(10) , PRIMARY KEY (a)) Engine=InnoDB;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (a int(10), PRIMARY KEY (a)) Engine=InnoDB;
INSERT INTO t2 VALUES (1);
CREATE TABLE t3 (a int(10), b int(10), c int(10),
PRIMARY KEY (a)) Engine=InnoDB;
INSERT INTO t3 VALUES (1,2,1);
SELECT t1.* FROM t1 WHERE (SELECT COUNT(*) FROM t3,t2 WHERE t3.c=t2.a
and t2.a='1' AND t1.a=t3.b) > 0;
a
2
DROP TABLE t1,t2,t3;
mysql-test/t/subselect2.test
View file @
e2a082aa
...
@@ -150,3 +150,21 @@ EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JO
...
@@ -150,3 +150,21 @@ EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JO
drop
table
t1
,
t2
,
t3
,
t4
;
drop
table
t1
,
t2
,
t3
,
t4
;
# End of 4.1 tests
# End of 4.1 tests
#
# Bug #20792: Incorrect results from aggregate subquery
#
CREATE
TABLE
t1
(
a
int
(
10
)
,
PRIMARY
KEY
(
a
))
Engine
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
TABLE
t2
(
a
int
(
10
),
PRIMARY
KEY
(
a
))
Engine
=
InnoDB
;
INSERT
INTO
t2
VALUES
(
1
);
CREATE
TABLE
t3
(
a
int
(
10
),
b
int
(
10
),
c
int
(
10
),
PRIMARY
KEY
(
a
))
Engine
=
InnoDB
;
INSERT
INTO
t3
VALUES
(
1
,
2
,
1
);
SELECT
t1
.*
FROM
t1
WHERE
(
SELECT
COUNT
(
*
)
FROM
t3
,
t2
WHERE
t3
.
c
=
t2
.
a
and
t2
.
a
=
'1'
AND
t1
.
a
=
t3
.
b
)
>
0
;
DROP
TABLE
t1
,
t2
,
t3
;
sql/sql_select.cc
View file @
e2a082aa
...
@@ -4470,10 +4470,16 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
...
@@ -4470,10 +4470,16 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
/*
used only in JOIN::clear
*/
static
void
clear_tables
(
JOIN
*
join
)
static
void
clear_tables
(
JOIN
*
join
)
{
{
for
(
uint
i
=
0
;
i
<
join
->
tables
;
i
++
)
/*
must clear only the non-const tables, as const tables
are not re-calculated.
*/
for
(
uint
i
=
join
->
const_tables
;
i
<
join
->
tables
;
i
++
)
mark_as_null_row
(
join
->
table
[
i
]);
// All fields are NULL
mark_as_null_row
(
join
->
table
[
i
]);
// All fields are NULL
}
}
...
...
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