Commit 80de816d authored by Sergei Golubchik's avatar Sergei Golubchik

test for ALTER TABLE ... SET DEFAULT

parent 3687edee
......@@ -3076,3 +3076,23 @@ a b c
1 2 1
1 2 NULL
drop table t1;
create table t1 (a int default 1, b int default (1+1), c int);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT '1',
`b` int(11) DEFAULT (1+1),
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 alter a set default (2+3), alter b set default 4,
alter c set default (-a);
alter table t1 alter a set default 1+2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '+2' at line 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT (2+3),
`b` int(11) DEFAULT '4',
`c` int(11) DEFAULT (-a)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
......@@ -1849,3 +1849,15 @@ insert t1 (c) values (a);
insert t1 (c) values (b);
select * from t1;
drop table t1;
#
# ALTER ... SET DEFAULT
#
create table t1 (a int default 1, b int default (1+1), c int);
show create table t1;
alter table t1 alter a set default (2+3), alter b set default 4,
alter c set default (-a);
--error ER_PARSE_ERROR
alter table t1 alter a set default 1+2;
show create table t1;
drop table t1;
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