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
7777d2b8
Commit
7777d2b8
authored
Oct 27, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed union rexecution bug
parent
8ec9edac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+3
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-1
sql/sql_lex.h
sql/sql_lex.h
+3
-2
sql/sql_union.cc
sql/sql_union.cc
+6
-2
No files found.
mysql-test/r/subselect.result
View file @
7777d2b8
...
...
@@ -5,6 +5,9 @@ SELECT (SELECT 1) UNION SELECT (SELECT 2);
(SELECT 1)
1
2
SELECT (SELECT (SELECT 0 UNION SELECT 0));
(SELECT (SELECT 0 UNION SELECT 0))
0
drop table if exists t1,t2,t3,t4,t5,attend,clinic,inscrit;
create table t1 (a int);
create table t2 (a int, b int);
...
...
mysql-test/t/subselect.test
View file @
7777d2b8
select
(
select
2
);
SELECT
(
SELECT
1
)
UNION
SELECT
(
SELECT
2
);
SELECT
(
SELECT
(
SELECT
0
UNION
SELECT
0
));
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
attend
,
clinic
,
inscrit
;
create
table
t1
(
a
int
);
create
table
t2
(
a
int
,
b
int
);
...
...
sql/sql_lex.cc
View file @
7777d2b8
...
...
@@ -945,7 +945,7 @@ void st_select_lex_unit::init_query()
select_limit_cnt
=
HA_POS_ERROR
;
offset_limit_cnt
=
0
;
union_option
=
0
;
prepared
=
optimized
=
0
;
prepared
=
optimized
=
executed
=
0
;
item
=
0
;
}
...
...
sql/sql_lex.h
View file @
7777d2b8
...
...
@@ -227,8 +227,9 @@ protected:
select_result
*
result
;
int
res
;
bool
describe
,
found_rows_for_union
,
prepared
,
//prepare phase already performed for UNION (unit)
optimized
;
// optimize phase already performed for UNION (unit)
prepared
,
// prepare phase already performed for UNION (unit)
optimized
,
// optimize phase already performed for UNION (unit)
executed
;
// already executed
public:
/*
Pointer to 'last' select or pointer to unit where stored
...
...
sql/sql_union.cc
View file @
7777d2b8
...
...
@@ -199,8 +199,12 @@ int st_select_lex_unit::exec()
{
DBUG_ENTER
(
"st_select_lex_unit::exec"
);
SELECT_LEX
*
lex_select_save
=
thd
->
lex
.
select
;
if
(
depended
||
!
item
||
!
item
->
assigned
())
if
(
executed
&&
!
depended
)
DBUG_RETURN
(
0
);
executed
=
1
;
if
(
depended
||
!
item
||
!
item
->
assigned
())
{
if
(
optimized
&&
item
&&
item
->
assigned
())
item
->
assigned
(
0
);
// We will reinit & rexecute unit
...
...
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