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
7ba19ba3
Commit
7ba19ba3
authored
Jun 30, 2017
by
Galina Shalygina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mistakes corrected, test file corrected.
parent
615da8f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
8 deletions
+26
-8
mysql-test/t/table_value_const.test
mysql-test/t/table_value_const.test
+7
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_tvc.h
sql/sql_tvc.h
+4
-0
sql/sql_union.cc
sql/sql_union.cc
+11
-6
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-1
No files found.
mysql-test/t/table_value_const.test
View file @
7ba19ba3
create
table
t1
(
a
int
,
b
int
);
insert
into
t1
values
(
1
,
2
),(
4
,
6
),(
9
,
7
),(
1
,
1
),(
2
,
5
),(
7
,
8
);
values
(
1
,
2
);
select
1
,
2
union
values
(
1
,
2
);
values
(
1
,
2
)
union
select
(
1
,
2
);
values
(
1
,
2
),
(
3
,
4
)
union
select
1
,
2
;
select
*
from
t1
where
(
t1
.
a
,
t1
.
b
)
in
(
select
5
,
7
union
values
(
1
,
2
),(
2
,
3
));
select
*
from
t1
where
(
t1
.
a
,
t1
.
b
)
in
(
values
(
1
,
2
),(
2
,
3
)
union
select
5
,
7
);
...
...
@@ -26,5 +32,5 @@ create view v1 as select 1,2 union values (3,4),(5,6);
eval
$drop_view
;
drop
table
t1
;
sql/sql_lex.cc
View file @
7ba19ba3
...
...
@@ -2262,6 +2262,7 @@ void st_select_lex::init_select()
with_dep
=
0
;
join
=
0
;
lock_type
=
TL_READ_DEFAULT
;
tvc
=
0
;
}
/*
...
...
sql/sql_tvc.h
View file @
7ba19ba3
...
...
@@ -19,6 +19,10 @@ class table_value_constr : public Sql_alloc
List
<
List_item
>
lists_of_values
;
select_result
*
result
;
table_value_constr
(
List
<
List_item
>
tvc_values
)
:
lists_of_values
(
tvc_values
),
result
(
0
)
{
}
bool
prepare
(
THD
*
thd_arg
,
SELECT_LEX
*
sl
,
select_result
*
tmp_result
);
bool
exec
();
...
...
sql/sql_union.cc
View file @
7ba19ba3
...
...
@@ -1357,17 +1357,21 @@ bool st_select_lex_unit::exec()
we don't calculate found_rows() per union part.
Otherwise, SQL_CALC_FOUND_ROWS should be done on all sub parts.
*/
sl
->
join
->
select_options
=
(
select_limit_cnt
==
HA_POS_ERROR
||
sl
->
braces
)
?
sl
->
options
&
~
OPTION_FOUND_ROWS
:
sl
->
options
|
found_rows_for_union
;
saved_error
=
sl
->
join
->
optimize
();
if
(
!
sl
->
tvc
)
{
sl
->
join
->
select_options
=
(
select_limit_cnt
==
HA_POS_ERROR
||
sl
->
braces
)
?
sl
->
options
&
~
OPTION_FOUND_ROWS
:
sl
->
options
|
found_rows_for_union
;
saved_error
=
sl
->
join
->
optimize
();
}
}
if
(
!
saved_error
)
{
records_at_start
=
table
->
file
->
stats
.
records
;
if
(
sl
->
tvc
)
sl
->
tvc
->
exec
();
sl
->
join
->
exec
();
else
sl
->
join
->
exec
();
if
(
sl
==
union_distinct
&&
!
(
with_element
&&
with_element
->
is_recursive
))
{
// This is UNION DISTINCT, so there should be a fake_select_lex
...
...
@@ -1376,7 +1380,8 @@ bool st_select_lex_unit::exec()
DBUG_RETURN
(
TRUE
);
table
->
no_keyread
=
1
;
}
saved_error
=
sl
->
join
->
error
;
if
(
!
sl
->
tvc
)
saved_error
=
sl
->
join
->
error
;
offset_limit_cnt
=
(
ha_rows
)(
sl
->
offset_limit
?
sl
->
offset_limit
->
val_uint
()
:
0
);
...
...
sql/sql_yacc.yy
View file @
7ba19ba3
...
...
@@ -67,6 +67,7 @@
#include "lex_token.h"
#include "sql_lex.h"
#include "sql_sequence.h"
#include "sql_tvc.h"
/* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER
...
...
@@ -16277,7 +16278,8 @@ table_value_constructor:
LEX *lex=Lex;
$$= Lex->current_select;
mysql_init_select(Lex);
$$->tvc->lists_of_values= lex->many_values;
table_value_constr tvc(lex->many_values);
$$->tvc= &tvc;
}
;
...
...
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