Current Path : /home/usr.opt/mysql57/mysql-test/suite/innodb/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/innodb/r/innodb-alter-nullable.result |
CREATE TABLE t (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 INT) ENGINE=InnoDB; INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9); ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE; ERROR 42000: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE t CHANGE c2 c2 INT, CHANGE c2 c2 INT NOT NULL; ERROR 42S22: Unknown column 'c2' in 't' ALTER TABLE t MODIFY c2 INT, MODIFY c2 INT NOT NULL; ERROR 42S22: Unknown column 'c2' in 't' ALTER TABLE t MODIFY c2 INT UNSIGNED, MODIFY c2 INT; ERROR 42S22: Unknown column 'c2' in 't' ALTER TABLE t MODIFY c2 CHAR(1) NOT NULL, MODIFY c2 INT NOT NULL; ERROR 42S22: Unknown column 'c2' in 't' ALTER TABLE t CHANGE c2 c2 INT NOT NULL; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE t MODIFY c2 INT NOT NULL; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 UPDATE t SET c2=NULL; ERROR 23000: Column 'c2' cannot be null SELECT * FROM t; c1 c2 c3 1 2 3 4 5 6 7 8 9 ALTER TABLE t MODIFY c2 INT, ALGORITHM=INPLACE; BEGIN; UPDATE t SET c2=NULL; SELECT * FROM t; c1 c2 c3 1 NULL 3 4 NULL 6 7 NULL 9 ROLLBACK; SELECT * FROM t; c1 c2 c3 1 2 3 4 5 6 7 8 9 ALTER TABLE t MODIFY c2 INT NULL, ALGORITHM=INPLACE; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/t'; TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE # test/t 33 6 # Barracuda Dynamic 0 Single DROP TABLE t;