mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Some fixes for CREATE / INSERT FROM UNIO >..
This commit is contained in:
@ -271,9 +271,35 @@ insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
|||||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||||
create table t3 select a,b from t1 union select a,b from t2;
|
create table t3 select a,b from t1 union select a,b from t2;
|
||||||
create table t4 (select a,b from t1) union (select a,b from t2) limit 2;
|
create table t4 (select a,b from t1) union (select a,b from t2);
|
||||||
insert into t4 select a,b from t1 union select a,b from t2;
|
insert into t4 select a,b from t1 union select a,b from t2;
|
||||||
insert into t3 (select a,b from t1) union (select a,b from t2) limit 2;
|
insert into t3 (select a,b from t1) union (select a,b from t2);
|
||||||
select * from t3;
|
select * from t3;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
4 d
|
||||||
|
5 f
|
||||||
|
6 e
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
4 d
|
||||||
|
5 f
|
||||||
|
6 e
|
||||||
select * from t4;
|
select * from t4;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
4 d
|
||||||
|
5 f
|
||||||
|
6 e
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
4 d
|
||||||
|
5 f
|
||||||
|
6 e
|
||||||
drop table t1,t2,t3,t4;
|
drop table t1,t2,t3,t4;
|
||||||
|
@ -72,5 +72,5 @@ delete from mysql.tables_priv where user='mysqltest_1';
|
|||||||
delete from mysql.columns_priv where user='mysqltest_1';
|
delete from mysql.columns_priv where user='mysqltest_1';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
--error 1054
|
--error 1221
|
||||||
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
||||||
|
@ -164,9 +164,9 @@ insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
|||||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||||
create table t3 select a,b from t1 union select a,b from t2;
|
create table t3 select a,b from t1 union select a,b from t2;
|
||||||
create table t4 (select a,b from t1) union (select a,b from t2) limit 2;
|
create table t4 (select a,b from t1) union (select a,b from t2);
|
||||||
insert into t4 select a,b from t1 union select a,b from t2;
|
insert into t4 select a,b from t1 union select a,b from t2;
|
||||||
insert into t3 (select a,b from t1) union (select a,b from t2) limit 2;
|
insert into t3 (select a,b from t1) union (select a,b from t2);
|
||||||
select * from t3;
|
select * from t3;
|
||||||
select * from t4;
|
select * from t4;
|
||||||
drop table t1,t2,t3,t4;
|
drop table t1,t2,t3,t4;
|
||||||
|
@ -597,7 +597,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||||||
table_to_table_list table_to_table opt_table_list opt_as
|
table_to_table_list table_to_table opt_table_list opt_as
|
||||||
handler_rkey_function handler_read_or_scan
|
handler_rkey_function handler_read_or_scan
|
||||||
single_multi table_wild_list table_wild_one opt_wild opt_union union_list
|
single_multi table_wild_list table_wild_one opt_wild opt_union union_list
|
||||||
precision union_option
|
precision union_option opt_and
|
||||||
END_OF_INPUT
|
END_OF_INPUT
|
||||||
|
|
||||||
%type <NONE>
|
%type <NONE>
|
||||||
@ -2640,9 +2640,7 @@ insert_field_spec:
|
|||||||
lex->many_values.push_back(lex->insert_list))
|
lex->many_values.push_back(lex->insert_list))
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
ident_eq_list
|
ident_eq_list;
|
||||||
| select_for_insert {}
|
|
||||||
;
|
|
||||||
|
|
||||||
opt_field_spec:
|
opt_field_spec:
|
||||||
/* empty */ { }
|
/* empty */ { }
|
||||||
@ -2651,8 +2649,7 @@ opt_field_spec:
|
|||||||
|
|
||||||
fields:
|
fields:
|
||||||
fields ',' insert_ident { Lex->field_list.push_back($3); }
|
fields ',' insert_ident { Lex->field_list.push_back($3); }
|
||||||
| insert_ident { Lex->field_list.push_back($1); }
|
| insert_ident { Lex->field_list.push_back($1); };
|
||||||
;
|
|
||||||
|
|
||||||
insert_values:
|
insert_values:
|
||||||
VALUES values_list {}
|
VALUES values_list {}
|
||||||
|
Reference in New Issue
Block a user