54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
CREATE PROCEDURE populate_t1()
|
|
BEGIN
|
|
DECLARE i int DEFAULT 1;
|
|
START TRANSACTION;
|
|
WHILE (i <= 10000) DO
|
|
INSERT INTO t1 VALUES (i, i, CONCAT('a', i));
|
|
SET i = i + 1;
|
|
END WHILE;
|
|
COMMIT;
|
|
END|
|
|
CREATE TABLE t1(
|
|
class INT,
|
|
id INT,
|
|
title VARCHAR(100)
|
|
) ENGINE=InnoDB;
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
10000
|
|
SET SESSION debug="+d,ib_index_build_fail_before_flush";
|
|
CREATE INDEX idx_id ON t1(id);
|
|
ERROR HY000: Got error 1000 - 'InnoDB error' from storage engine
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
CREATE INDEX idx_title ON t1(title);
|
|
ERROR HY000: Got error 1000 - 'InnoDB error' from storage engine
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
CREATE FULLTEXT INDEX fidx_title ON t1(title);
|
|
ERROR HY000: Got error 1000 - 'InnoDB error' from storage engine
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
ALTER TABLE t1 ADD COLUMN content TEXT, ALGORITHM=INPLACE;
|
|
ERROR HY000: Got error 1000 - 'InnoDB error' from storage engine
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
SET SESSION debug="-d,ib_index_build_fail_before_flush";
|
|
INSERT INTO t1 VALUES(10001, 10001, 'a10000');
|
|
ALTER TABLE t1 ADD UNIQUE INDEX idx_title(title);
|
|
ERROR 23000: Duplicate entry 'a10000' for key 'idx_title'
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
ALTER TABLE t1 ADD UNIQUE INDEX idx_id(id), ADD UNIQUE INDEX idx_title(title);
|
|
ERROR 23000: Duplicate entry 'a10000' for key 'idx_title'
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check status OK
|
|
DROP TABLE t1;
|
|
DROP PROCEDURE populate_t1;
|