Commit 417c571b authored by unknown's avatar unknown

Some fixes for CREATE / INSERT FROM UNIO >..

parent 65d79805
......@@ -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);
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 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 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;
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;
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;
......@@ -72,5 +72,5 @@ delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1';
flush privileges;
drop table t1;
--error 1054
--error 1221
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);
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 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 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 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
handler_rkey_function handler_read_or_scan
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
%type <NONE>
......@@ -2640,9 +2640,7 @@ insert_field_spec:
lex->many_values.push_back(lex->insert_list))
YYABORT;
}
ident_eq_list
| select_for_insert {}
;
ident_eq_list;
opt_field_spec:
/* empty */ { }
......@@ -2651,8 +2649,7 @@ opt_field_spec:
fields:
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:
VALUES values_list {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment