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
e359c568
Commit
e359c568
authored
Jun 30, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new syntax:
CREATE TABLE ...(SELECT ...) UNION ... INSERT ... (SELECT ...) UNION ...
parent
9e6471ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
18 deletions
+30
-18
sql/sql_yacc.yy
sql/sql_yacc.yy
+30
-18
No files found.
sql/sql_yacc.yy
View file @
e359c568
...
@@ -803,18 +803,35 @@ create:
...
@@ -803,18 +803,35 @@ create:
};
};
create2:
create2:
'('
field_list ')' opt_create_table_options create3
{}
'('
create2a
{}
| opt_create_table_options create3 {};
| opt_create_table_options create3 {};
create2a:
field_list ')' opt_create_table_options create3 {}
| create_select ')' { Select->braces= 1;} union_opt {}
;
create3:
create3:
/* empty */ {}
/* empty */ {}
| opt_duplicate opt_as SELECT_SYM
| opt_duplicate opt_as create_select
{ Select->braces= 0;} opt_union {}
| opt_duplicate opt_as '(' create_select ')'
{ Select->braces= 1;} union_opt {}
;
create_select:
SELECT_SYM
{
{
LEX *lex=Lex;
LEX *lex=Lex;
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
switch(lex->sql_command) {
case SQLCOM_INSERT: lex->sql_command=SQLCOM_INSERT_SELECT; break;
case SQLCOM_REPLACE: lex->sql_command=SQLCOM_REPLACE_SELECT; break;
}
mysql_init_select(lex);
mysql_init_select(lex);
}
}
select_options select_item_list opt_select_from opt_union {};
select_options select_item_list opt_select_from
;
opt_as:
opt_as:
/* empty */ {}
/* empty */ {}
...
@@ -1490,7 +1507,7 @@ select:
...
@@ -1490,7 +1507,7 @@ select:
select_init:
select_init:
SELECT_SYM select_part2 { Select->braces= 0; } opt_union
SELECT_SYM select_part2 { Select->braces= 0; } opt_union
|
|
'(' SELECT_SYM
select_part2 ')' { Select->braces= 1;} union_opt;
'(' SELECT_SYM select_part2 ')' { Select->braces= 1;} union_opt;
select_part2:
select_part2:
...
@@ -2565,7 +2582,7 @@ opt_temporary:
...
@@ -2565,7 +2582,7 @@ opt_temporary:
insert:
insert:
INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option
INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option
opt_ignore insert2
opt_ignore insert2
{
{
set_lock_for_tables($3);
set_lock_for_tables($3);
}
}
...
@@ -2576,7 +2593,7 @@ insert:
...
@@ -2576,7 +2593,7 @@ insert:
replace:
replace:
REPLACE
REPLACE
{
{
LEX *lex=Lex;
LEX *lex=Lex;
lex->sql_command = SQLCOM_REPLACE;
lex->sql_command = SQLCOM_REPLACE;
lex->duplicates= DUP_REPLACE;
lex->duplicates= DUP_REPLACE;
}
}
...
@@ -2593,7 +2610,7 @@ insert_lock_option:
...
@@ -2593,7 +2610,7 @@ insert_lock_option:
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
| DELAYED_SYM { $$= TL_WRITE_DELAYED; }
| DELAYED_SYM { $$= TL_WRITE_DELAYED; }
| HIGH_PRIORITY { $$= TL_WRITE; }
| HIGH_PRIORITY { $$= TL_WRITE; }
;
;
replace_lock_option:
replace_lock_option:
opt_low_priority { $$= $1; }
opt_low_priority { $$= $1; }
...
@@ -2613,7 +2630,9 @@ insert_table:
...
@@ -2613,7 +2630,9 @@ insert_table:
};
};
insert_field_spec:
insert_field_spec:
opt_field_spec insert_values {}
insert_values {}
| '(' ')' insert_values {}
| '(' fields ')' insert_values {}
| SET
| SET
{
{
LEX *lex=Lex;
LEX *lex=Lex;
...
@@ -2634,16 +2653,9 @@ fields:
...
@@ -2634,16 +2653,9 @@ fields:
insert_values:
insert_values:
VALUES values_list {}
VALUES values_list {}
| SELECT_SYM
| create_select { Select->braces= 0;} opt_union {}
{
| '(' create_select ')' { Select->braces= 1;} union_opt {}
LEX *lex=Lex;
;
lex->sql_command = (lex->sql_command == SQLCOM_INSERT ?
SQLCOM_INSERT_SELECT : SQLCOM_REPLACE_SELECT);
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(lex);
}
select_options select_item_list select_from select_lock_type
opt_union {};
values_list:
values_list:
values_list ',' no_braces
values_list ',' no_braces
...
...
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