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
0bf6e3ae
Commit
0bf6e3ae
authored
Jan 26, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed cleanup of result object of subqueries. (BUG#8125)
parent
6d71acf0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+12
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+14
-0
sql/item_subselect.cc
sql/item_subselect.cc
+6
-0
sql/sql_class.cc
sql/sql_class.cc
+8
-0
sql/sql_class.h
sql/sql_class.h
+1
-0
No files found.
mysql-test/r/subselect.result
View file @
0bf6e3ae
...
@@ -2196,3 +2196,15 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
...
@@ -2196,3 +2196,15 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
drop table t1;
drop table t1;
CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES (1,1,1);
INSERT INTO t2 VALUES (1,1,1);
PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having
count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)";
EXECUTE my_stmt;
b count(*)
EXECUTE my_stmt;
b count(*)
deallocate prepare my_stmt;
drop table t1,t2;
mysql-test/t/subselect.test
View file @
0bf6e3ae
...
@@ -1465,3 +1465,17 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
...
@@ -1465,3 +1465,17 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
--
error
1247
--
error
1247
select
1
=
ALL
(
select
1
from
t1
where
1
=
xx
),
1
as
xx
from
DUAL
;
select
1
=
ALL
(
select
1
from
t1
where
1
=
xx
),
1
as
xx
from
DUAL
;
drop
table
t1
;
drop
table
t1
;
#
# cleaning up of results of subselects (BUG#8125)
#
CREATE
TABLE
`t1`
(
`a`
char
(
3
)
NOT
NULL
default
''
,
`b`
char
(
3
)
NOT
NULL
default
''
,
`c`
char
(
3
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
`a`
,
`b`
,
`c`
))
ENGINE
=
InnoDB
;
CREATE
TABLE
t2
LIKE
t1
;
INSERT
INTO
t1
VALUES
(
1
,
1
,
1
);
INSERT
INTO
t2
VALUES
(
1
,
1
,
1
);
PREPARE
my_stmt
FROM
"SELECT t1.b, count(*) FROM t1 group by t1.b having
count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"
;
EXECUTE
my_stmt
;
EXECUTE
my_stmt
;
deallocate
prepare
my_stmt
;
drop
table
t1
,
t2
;
sql/item_subselect.cc
View file @
0bf6e3ae
...
@@ -1127,6 +1127,7 @@ void subselect_single_select_engine::cleanup()
...
@@ -1127,6 +1127,7 @@ void subselect_single_select_engine::cleanup()
DBUG_ENTER
(
"subselect_single_select_engine::cleanup"
);
DBUG_ENTER
(
"subselect_single_select_engine::cleanup"
);
prepared
=
optimized
=
executed
=
0
;
prepared
=
optimized
=
executed
=
0
;
join
=
0
;
join
=
0
;
result
->
cleanup
();
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -1135,6 +1136,7 @@ void subselect_union_engine::cleanup()
...
@@ -1135,6 +1136,7 @@ void subselect_union_engine::cleanup()
{
{
DBUG_ENTER
(
"subselect_union_engine::cleanup"
);
DBUG_ENTER
(
"subselect_union_engine::cleanup"
);
unit
->
reinit_exec_mechanism
();
unit
->
reinit_exec_mechanism
();
result
->
cleanup
();
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -1142,6 +1144,10 @@ void subselect_union_engine::cleanup()
...
@@ -1142,6 +1144,10 @@ void subselect_union_engine::cleanup()
void
subselect_uniquesubquery_engine
::
cleanup
()
void
subselect_uniquesubquery_engine
::
cleanup
()
{
{
DBUG_ENTER
(
"subselect_uniquesubquery_engine::cleanup"
);
DBUG_ENTER
(
"subselect_uniquesubquery_engine::cleanup"
);
/*
subselect_uniquesubquery_engine have not 'result' assigbed, so we do not
cleanup() it
*/
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
sql/sql_class.cc
View file @
0bf6e3ae
...
@@ -1240,6 +1240,14 @@ bool select_singlerow_subselect::send_data(List<Item> &items)
...
@@ -1240,6 +1240,14 @@ bool select_singlerow_subselect::send_data(List<Item> &items)
}
}
void
select_max_min_finder_subselect
::
cleanup
()
{
DBUG_ENTER
(
"select_max_min_finder_subselect::cleanup"
);
cache
=
0
;
DBUG_VOID_RETURN
;
}
bool
select_max_min_finder_subselect
::
send_data
(
List
<
Item
>
&
items
)
bool
select_max_min_finder_subselect
::
send_data
(
List
<
Item
>
&
items
)
{
{
DBUG_ENTER
(
"select_max_min_finder_subselect::send_data"
);
DBUG_ENTER
(
"select_max_min_finder_subselect::send_data"
);
...
...
sql/sql_class.h
View file @
0bf6e3ae
...
@@ -1381,6 +1381,7 @@ public:
...
@@ -1381,6 +1381,7 @@ public:
select_max_min_finder_subselect
(
Item_subselect
*
item
,
bool
mx
)
select_max_min_finder_subselect
(
Item_subselect
*
item
,
bool
mx
)
:
select_subselect
(
item
),
cache
(
0
),
fmax
(
mx
)
:
select_subselect
(
item
),
cache
(
0
),
fmax
(
mx
)
{}
{}
void
cleanup
();
bool
send_data
(
List
<
Item
>
&
items
);
bool
send_data
(
List
<
Item
>
&
items
);
bool
cmp_real
();
bool
cmp_real
();
bool
cmp_int
();
bool
cmp_int
();
...
...
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