config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/innodb/t/

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
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/innodb/t/innodb-alter-wl6554.test

--source include/have_innodb.inc


--echo #
--echo # Bug#15863023 SUPPORT IN-PLACE EXTENSION OF VARCHAR COLUMN
--echo #
CREATE TABLE t1 (pk VARCHAR(2) PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (fk VARCHAR(2), FOREIGN KEY (fk) REFERENCES t1 (pk))
ENGINE=InnoDB;
INSERT INTO t1 VALUES ('aa'), ('bb');
INSERT INTO t2 VALUES ('aa'), ('bb');
ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN pk pk VARCHAR(5);
INSERT INTO t1 VALUES ('co');

INSERT INTO t2 VALUES ('co');
INSERT IGNORE INTO t2 VALUES ('code');
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(7);
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES ('code');
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES ('coastal');
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES ('coast');
INSERT INTO t1 VALUES ('coast');
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES ('coastal');
INSERT INTO t2 VALUES ('coast');

DROP TABLE t2, t1;

CREATE TABLE t1 (pk VARCHAR(2) PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (fk VARCHAR(2),
CONSTRAINT fk FOREIGN KEY (fk) REFERENCES t1 (pk))
ENGINE=InnoDB;
INSERT INTO t1 VALUES ('aa'), ('bb');
INSERT INTO t2 VALUES ('aa'), ('bb');
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(6);
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(255);
--echo # We cannot shrink the size or cross the 256-byte boundary.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(6);
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(256);
--echo # ALGORITHM=COPY has more limitations with FOREIGN KEY.
--error ER_FK_COLUMN_CANNOT_CHANGE
ALTER TABLE t2 CHANGE COLUMN fk fk VARCHAR(256);
ALTER TABLE t2 ALGORITHM=INPLACE, DROP FOREIGN KEY fk;
ALTER TABLE t2 CHANGE COLUMN fk fk VARCHAR(256);
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(300);
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
--error ER_BLOB_KEY_WITHOUT_LENGTH
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(99999);
ALTER TABLE t2 ALGORITHM=INPLACE, DROP INDEX fk;
--echo # Type change from VARCHAR to BLOB is not supported.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t2 ALGORITHM=INPLACE, CHANGE COLUMN fk fk VARCHAR(99999);
DROP TABLE t2, t1;
SET sql_mode = default;

Man Man