mariadb/mysql-test/suite/storage_engine/col_opt_default.result

21 lines
459 B
Text
Raw Normal View History

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN> DEFAULT '0') ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a int(11) # 0
INSERT INTO t1 (a) VALUES (1);
SELECT a FROM t1;
a
1
ALTER TABLE t1 ADD COLUMN b <CHAR_COLUMN> DEFAULT '';
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a int(11) # 0
b char(8) #
INSERT INTO t1 (b) VALUES ('a');
SELECT a,b FROM t1;
a b
0 a
1
DROP TABLE t1;