summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/col_opt_default.test
blob: 6f91ee7ca9a9f32347002490e3878d13ca8c9318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--source include/have_rocksdb.inc

# 
# Check whether DEFAULT column attribute 
# is supported in CREATE and ALTER TABLE.
# If the attribute is supported at all, it will be covered
# in more details in col_option_null and col_option_not_null tests.
#

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1 (a INT PRIMARY KEY DEFAULT '0') ENGINE=rocksdb;
SHOW COLUMNS IN t1;

INSERT INTO t1 (a) VALUES (1);
SELECT a FROM t1;

ALTER TABLE t1 ADD COLUMN b CHAR(8) DEFAULT '';
SHOW COLUMNS IN t1;

INSERT INTO t1 (b) VALUES ('a');
SELECT a,b FROM t1 ORDER BY a,b;

DROP TABLE t1;