mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
TODO: enable MDEV-13049 optimization for 10.3
This commit is contained in:
@@ -8,3 +8,17 @@ create index idx1 on t1(a(3073));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
set @@sql_mode=default;
|
||||
|
||||
#
|
||||
# MDEV-14081 ALTER TABLE CHANGE COLUMN Corrupts Index Leading to Crashes in 10.2
|
||||
#
|
||||
create table t1 (
|
||||
id1 int(11) not null auto_increment,
|
||||
id2 varchar(30) not null,
|
||||
id3 datetime not null default current_timestamp,
|
||||
primary key (id1),
|
||||
unique key unique_id2 (id2)
|
||||
) engine=innodb;
|
||||
alter table t1 change column id2 id4 varchar(100) not null;
|
||||
select * from t1 where id4 like 'a';
|
||||
drop table t1;
|
||||
|
@@ -318,10 +318,10 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
|
||||
# because the UNDO records will be smaller.
|
||||
|
||||
CREATE INDEX t1f ON t1 (f(767));
|
||||
--error 1713
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
|
||||
ROLLBACK;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
|
||||
@@ -361,8 +361,9 @@ UPDATE t1 SET s=@e;
|
||||
# that CANNOT be updated.
|
||||
|
||||
CREATE INDEX t1t ON t1 (t(767));
|
||||
--error 1713
|
||||
BEGIN;
|
||||
UPDATE t1 SET t=@e;
|
||||
ROLLBACK;
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
@@ -490,9 +491,10 @@ INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
|
||||
COMMIT;
|
||||
|
||||
# The following used to cause a hang while doing infinite undo log allocation.
|
||||
--error 1713
|
||||
BEGIN;
|
||||
UPDATE bug12547647 SET c = REPEAT('b',16928);
|
||||
SHOW WARNINGS;
|
||||
ROLLBACK;
|
||||
DROP TABLE bug12547647;
|
||||
|
||||
SET SESSION innodb_strict_mode = on;
|
||||
|
@@ -282,13 +282,14 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
|
||||
|
||||
CREATE INDEX t1f17 ON t1 (v(767));
|
||||
|
||||
--error 1713
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
|
||||
v=@d,w=@d,x=@d,y=@d,z=@d,
|
||||
aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
|
||||
ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
|
||||
va=@d,wa=@d,xa=@d,ya=@d,za=@d;
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
|
@@ -292,7 +292,7 @@ COMMIT;
|
||||
|
||||
CREATE INDEX tg1f2 ON t1 (ia(767),ja(767));
|
||||
|
||||
--error 1713
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
|
||||
v=@d,w=@d,x=@d,y=@d,z=@d,
|
||||
@@ -305,6 +305,7 @@ UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
ac=@d,bc=@d,cc=@d,dc=@d,ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d,
|
||||
kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d,qc=@d,rc=@d,sc=@d,tc=@d,uc=@d,
|
||||
vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
--source include/innodb_page_size.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
#
|
||||
# MMDEV-8386: MariaDB creates very big tmp file and hangs on xtradb
|
||||
@@ -171,3 +172,35 @@ ALTER TABLE ticket
|
||||
SHOW CREATE TABLE ticket;
|
||||
|
||||
DROP TABLE ticket;
|
||||
|
||||
#
|
||||
# MDEV-13838: Wrong result after altering a partitioned table
|
||||
#
|
||||
|
||||
CREATE TABLE t (
|
||||
id bigint(20) unsigned NOT NULL auto_increment,
|
||||
d date NOT NULL,
|
||||
a bigint(20) unsigned NOT NULL,
|
||||
b smallint(5) unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (id,d)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs STATS_SAMPLE_PAGES=2
|
||||
PARTITION BY RANGE COLUMNS(d)
|
||||
(
|
||||
PARTITION p20170914 VALUES LESS THAN ('2017-09-15') ENGINE = InnoDB,
|
||||
PARTITION p99991231 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB);
|
||||
|
||||
insert into t(d,a,b) values ('2017-09-15',rand()*10000,rand()*10);
|
||||
insert into t(d,a,b) values ('2017-09-15',rand()*10000,rand()*10);
|
||||
|
||||
replace into t(d,a,b) select '2017-09-15',rand()*10000,rand()*10 from t t1, t t2, t t3, t t4;
|
||||
|
||||
select count(*) from t where d ='2017-09-15';
|
||||
|
||||
ALTER TABLE t CHANGE b c smallint(5) unsigned , ADD KEY idx_d_a (d, a);
|
||||
SHOW CREATE TABLE t;
|
||||
analyze table t;
|
||||
|
||||
select count(*) from t where d ='2017-09-15';
|
||||
select count(*) from t force index(primary) where d ='2017-09-15';
|
||||
|
||||
DROP TABLE t;
|
||||
|
@@ -298,21 +298,12 @@ SHOW CREATE TABLE t1n;
|
||||
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
|
||||
--error ER_KEY_COLUMN_DOES_NOT_EXITS
|
||||
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
|
||||
# FIXME: MDEV-13668 InnoDB unnecessarily rebuilds table
|
||||
# when renaming a column and adding index
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
|
||||
ALTER TABLE t1n CHANGE c2 c4 INT, LOCK=NONE;
|
||||
ALTER TABLE t1n ADD INDEX(c4), LOCK=NONE;
|
||||
SHOW CREATE TABLE t1n;
|
||||
ALTER TABLE t1n DROP INDEX c4;
|
||||
--error ER_DUP_FIELDNAME
|
||||
ALTER TABLE t1n CHANGE c4 c1 INT, ADD INDEX(c1), ALGORITHM=INPLACE;
|
||||
# FIXME: MDEV-13668
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1n CHANGE c4 c11 INT, ADD INDEX(c11), ALGORITHM=INPLACE;
|
||||
ALTER TABLE t1n CHANGE c4 c11 INT, LOCK=NONE;
|
||||
ALTER TABLE t1n ADD INDEX(c11), LOCK=NONE;
|
||||
|
||||
SHOW CREATE TABLE t1n;
|
||||
DROP TABLE t1n;
|
||||
@@ -370,16 +361,8 @@ CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL;
|
||||
|
||||
ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id);
|
||||
|
||||
# FIXME: MDEV-9469 'Incorrect key file' on ALTER TABLE
|
||||
call mtr.add_suppression("InnoDB: No matching column for `FTS_DOC_ID` in index `ct` of table `test`\\.`t1o`");
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
|
||||
ADD FULLTEXT INDEX(ct);
|
||||
# FIXME: MDEV-9469 (enable this)
|
||||
#--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
#ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
|
||||
#ALGORITHM=INPLACE;
|
||||
#end of MDEV-9469 FIXME
|
||||
|
||||
DROP TABLE sys_indexes;
|
||||
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
@@ -494,6 +477,41 @@ eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace;
|
||||
eval DROP TABLE $source_db.t1;
|
||||
eval DROP DATABASE $source_db;
|
||||
eval DROP DATABASE $dest_db;
|
||||
USE test;
|
||||
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
|
||||
iNSERT INTO t1 VALUES (10);
|
||||
--error ER_WARN_DATA_OUT_OF_RANGE
|
||||
ALTER TABLE t1 ADD b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# DATETIME-to-DATE truncation is OK
|
||||
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
|
||||
iNSERT INTO t1 VALUES (10);
|
||||
--enable_info
|
||||
ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
|
||||
--disable_info
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# DATETIME-to-TIME truncation is OK
|
||||
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
|
||||
iNSERT INTO t1 VALUES (10);
|
||||
--enable_info
|
||||
ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
|
||||
--disable_info
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
@@ -40,6 +40,11 @@ CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `rep
|
||||
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
|
||||
# These should be ignored in innodb_read_only mode.
|
||||
SET GLOBAL innodb_buffer_pool_load_now = ON;
|
||||
SET GLOBAL innodb_buffer_pool_dump_now = ON;
|
||||
SET GLOBAL innodb_buffer_pool_load_abort = ON;
|
||||
|
||||
-- let $restart_parameters=
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
|
@@ -19,3 +19,13 @@ ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, LOCK=SHARED;
|
||||
show warnings;
|
||||
show errors;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
||||
ALTER TABLE t1 ADD COLUMN b LINESTRING DEFAULT POINT(1,1);
|
||||
DESCRIBE t1;
|
||||
DROP TABLE t1;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
--disable_query_log
|
||||
# These values can change during the test
|
||||
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
LET $regexp=/FTS_([0-9a-f_]+)([A-Z0-9_]+)\.ibd/FTS_AUX_\2.ibd/;
|
||||
LET $regexp=/FTS_[0-9a-f_]+([A-Z0-9_]+)\.([islbd]{3})/FTS_AUX_\1.\2/;
|
||||
|
||||
# Set up some variables
|
||||
LET $MYSQL_DATA_DIR = `select @@datadir`;
|
||||
@@ -447,12 +447,7 @@ ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
|
||||
--error ER_KEY_COLUMN_DOES_NOT_EXITS
|
||||
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
|
||||
|
||||
# FIXME: MDEV-13668 InnoDB unnecessarily rebuilds table
|
||||
# when renaming a column and adding index
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
|
||||
ALTER TABLE t1n CHANGE c2 c4 INT, LOCK=NONE;
|
||||
ALTER TABLE t1n ADD INDEX(c4), LOCK=NONE;
|
||||
|
||||
--echo ### files in MYSQL_DATA_DIR/test
|
||||
--replace_regex $regexp
|
||||
@@ -474,11 +469,7 @@ ALTER TABLE t1n DROP INDEX c4;
|
||||
|
||||
--error ER_DUP_FIELDNAME
|
||||
ALTER TABLE t1n CHANGE c4 c1 INT, ADD INDEX(c1), ALGORITHM=INPLACE;
|
||||
# FIXME: MDEV-13668
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1n CHANGE c4 c11 INT, ADD INDEX(c11), ALGORITHM=INPLACE;
|
||||
ALTER TABLE t1n CHANGE c4 c11 INT, LOCK=NONE;
|
||||
ALTER TABLE t1n ADD INDEX(c11), LOCK=NONE;
|
||||
|
||||
--echo ### files in MYSQL_DATA_DIR/test
|
||||
--replace_regex $regexp
|
||||
@@ -500,18 +491,10 @@ ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL;
|
||||
--replace_regex $regexp
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
# FIXME: MDEV-9469 'Incorrect key file' on ALTER TABLE
|
||||
call mtr.add_suppression("Error: no matching column for .FTS_DOC_ID. in index .ct.--temporary-- of table .test...t1o");
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
|
||||
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
|
||||
ALGORITHM=INPLACE;
|
||||
|
||||
--echo # The following would crash 10.2. Re-enable this and test after merge!
|
||||
ALTER TABLE t1o CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL, LOCK=NONE;
|
||||
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), ALGORITHM=INPLACE;
|
||||
# end of MDEV-9469 FIXME
|
||||
|
||||
--echo ### files in MYSQL_DATA_DIR/test
|
||||
--replace_regex $regexp
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
@@ -520,11 +503,9 @@ ALTER TABLE t1o ADD FULLTEXT INDEX(ct), ALGORITHM=INPLACE;
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
# This would create a hidden FTS_DOC_ID column, which cannot be done online.
|
||||
# FIXME: MDEV-9469 (enable this)
|
||||
#--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
#ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
|
||||
#LOCK=NONE;
|
||||
#end of MDEV-9469 FIXME
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
|
||||
LOCK=NONE;
|
||||
|
||||
# This should not show duplicates.
|
||||
SELECT sc.pos FROM information_schema.innodb_sys_columns sc
|
||||
@@ -535,7 +516,6 @@ WHERE st.NAME='test/t1o' AND sc.NAME='FTS_DOC_ID';
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t1o;
|
||||
|
||||
# FIXME: MDEV-13668
|
||||
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
|
||||
DROP INDEX ct, LOCK=NONE;
|
||||
|
||||
@@ -573,15 +553,9 @@ ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id);
|
||||
--replace_regex $regexp
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
# FIXME: MDEV-9469 'Incorrect key file' on ALTER TABLE
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
|
||||
ADD FULLTEXT INDEX(ct);
|
||||
|
||||
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL, LOCK=NONE;
|
||||
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), ALGORITHM=INPLACE;
|
||||
#end of MDEV-9469 FIXME
|
||||
|
||||
--echo ### files in MYSQL_DATA_DIR/test
|
||||
--replace_regex $regexp
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
|
@@ -16,7 +16,26 @@ select @@global.innodb_stats_persistent;
|
||||
set global innodb_defragment_stats_accuracy = 80;
|
||||
|
||||
# Create table.
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
|
||||
#
|
||||
# TODO: Currently we do not defragment spatial indexes,
|
||||
# because doing it properly would require
|
||||
# appropriate logic around the SSN (split
|
||||
# sequence number).
|
||||
#
|
||||
# Also do not defragment auxiliary tables related to FULLTEXT INDEX.
|
||||
#
|
||||
# Both types added to this test to make sure they do not cause
|
||||
# problems.
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b VARCHAR(256),
|
||||
c INT,
|
||||
g GEOMETRY NOT NULL,
|
||||
t VARCHAR(256),
|
||||
KEY second(a, b),
|
||||
KEY third(c),
|
||||
SPATIAL gk(g),
|
||||
FULLTEXT INDEX fti(t)) ENGINE=INNODB;
|
||||
|
||||
connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
@@ -36,7 +55,7 @@ let $i = $data_size;
|
||||
while ($i)
|
||||
{
|
||||
eval
|
||||
INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i);
|
||||
INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i, Point($i,$i), 'This is a test message.');
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
@@ -69,10 +88,10 @@ connection con1;
|
||||
--send optimize table t1;
|
||||
|
||||
connection default;
|
||||
--send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);
|
||||
--send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000, Point(1,1),'More like a test but different.');
|
||||
|
||||
connection con2;
|
||||
--send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);
|
||||
--send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000, Point(1,1),'Totally different text book.');
|
||||
|
||||
connection con3;
|
||||
--send DELETE FROM t1 where a between 1 and 100;
|
||||
@@ -103,6 +122,7 @@ disconnect con3;
|
||||
disconnect con4;
|
||||
|
||||
optimize table t1;
|
||||
check table t1 extended;
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t1 force index (second);
|
||||
|
@@ -23,14 +23,33 @@ call mtr.add_suppression("InnoDB: Log file .*ib_logfile[01].* size");
|
||||
call mtr.add_suppression("InnoDB: Unable to open .*ib_logfile0. to check native AIO read support");
|
||||
FLUSH TABLES;
|
||||
--enable_query_log
|
||||
let MYSQLD_DATADIR= `select @@datadir`;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile.old
|
||||
write_file $MYSQLD_DATADIR/ib_logfile0;
|
||||
EOF
|
||||
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
|
||||
--let $restart_parameters= --innodb-thread-concurrency=1 --innodb-log-file-size=1m --innodb-log-files-in-group=2
|
||||
--source include/restart_mysqld.inc
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
eval $check_no_innodb;
|
||||
--remove_file $MYSQLD_DATADIR/ib_logfile0
|
||||
--move_file $MYSQLD_DATADIR/ib_logfile.old $MYSQLD_DATADIR/ib_logfile.0
|
||||
--source include/shutdown_mysqld.inc
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 0 is too small;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--source include/start_mysqld.inc
|
||||
CHECK TABLE t1;
|
||||
|
||||
--let $restart_parameters= --innodb-thread-concurrency=100 --innodb-log-file-size=10M --innodb-log-files-in-group=2
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (42);
|
||||
|
||||
@@ -52,9 +71,7 @@ SELECT * FROM t1;
|
||||
|
||||
INSERT INTO t1 VALUES (0),(123);
|
||||
|
||||
let MYSQLD_DATADIR= `select @@datadir`;
|
||||
let SEARCH_ABORT = NOT FOUND;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
|
||||
BEGIN;
|
||||
DELETE FROM t1 WHERE a>0;
|
||||
|
@@ -0,0 +1 @@
|
||||
--innodb-open-files=13
|
66
mysql-test/suite/innodb/t/table_definition_cache_debug.test
Normal file
66
mysql-test/suite/innodb/t/table_definition_cache_debug.test
Normal file
@@ -0,0 +1,66 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
SET @save_tdc= @@GLOBAL.table_definition_cache;
|
||||
SET @save_toc= @@GLOBAL.table_open_cache;
|
||||
|
||||
# InnoDB plugin essentially ignores table_definition_cache size
|
||||
# and hard-wires it to 400, which also is the minimum allowed value.
|
||||
SET GLOBAL table_definition_cache= 400;
|
||||
SET GLOBAL table_open_cache= 1024;
|
||||
|
||||
CREATE TABLE to_be_evicted(a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB;
|
||||
INSERT INTO to_be_evicted VALUES(1,2),(2,1);
|
||||
|
||||
connect(ddl,localhost,root,,);
|
||||
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL scanned WAIT_FOR got_duplicate';
|
||||
--send
|
||||
ALTER TABLE to_be_evicted ADD UNIQUE INDEX(b);
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
|
||||
|
||||
# During the ADD UNIQUE INDEX, start a transaction that inserts a duplicate
|
||||
# and then hogs the table lock, so that the unique index cannot be dropped.
|
||||
BEGIN;
|
||||
INSERT INTO to_be_evicted VALUES(3, 2);
|
||||
SET DEBUG_SYNC = 'now SIGNAL got_duplicate';
|
||||
|
||||
connection ddl;
|
||||
--error ER_DUP_ENTRY
|
||||
reap;
|
||||
|
||||
disconnect ddl;
|
||||
connection default;
|
||||
# Release the table lock.
|
||||
COMMIT;
|
||||
SET DEBUG_SYNC = RESET;
|
||||
|
||||
# Allow cache eviction.
|
||||
FLUSH TABLES;
|
||||
--disable_query_log
|
||||
|
||||
# Pollute the cache with many tables, so that our table will be evicted.
|
||||
let $N=1000;
|
||||
let $loop=$N;
|
||||
while ($loop)
|
||||
{
|
||||
eval CREATE TABLE t_$loop(id INT)ENGINE=InnoDB;
|
||||
dec $loop;
|
||||
}
|
||||
|
||||
# Hopefully let InnoDB evict the tables.
|
||||
sleep 10;
|
||||
|
||||
let $loop=$N;
|
||||
while ($loop)
|
||||
{
|
||||
eval DROP TABLE t_$loop;
|
||||
dec $loop;
|
||||
}
|
||||
|
||||
SET GLOBAL table_definition_cache= @save_tdc;
|
||||
SET GLOBAL table_open_cache= @save_toc;
|
||||
|
||||
DROP TABLE to_be_evicted;
|
139
mysql-test/suite/innodb/t/undo_log.test
Normal file
139
mysql-test/suite/innodb/t/undo_log.test
Normal file
@@ -0,0 +1,139 @@
|
||||
--source include/have_innodb.inc
|
||||
CREATE TABLE test_tab (
|
||||
a_str_18 mediumtext,
|
||||
b_str_3 varchar(32) DEFAULT NULL,
|
||||
a_str_13 mediumtext,
|
||||
b_str_5 varchar(40) DEFAULT NULL,
|
||||
b_str_6 varchar(50) DEFAULT NULL,
|
||||
b_str_7 char(32) DEFAULT NULL,
|
||||
b_str_8 varchar(32) DEFAULT NULL,
|
||||
b_str_9 varchar(255) DEFAULT NULL,
|
||||
a_str_28 char(255) DEFAULT NULL,
|
||||
a_str_27 varchar(255) DEFAULT NULL,
|
||||
b_str_10 varchar(32) DEFAULT NULL,
|
||||
a_str_26 varchar(255) DEFAULT NULL,
|
||||
a_str_6 varchar(50) DEFAULT NULL,
|
||||
b_str_11 varchar(32) DEFAULT NULL,
|
||||
b_str_12 varchar(255) DEFAULT NULL,
|
||||
b_str_13 char(32) DEFAULT NULL,
|
||||
b_str_14 varchar(32) DEFAULT NULL,
|
||||
b_str_15 char(32) DEFAULT NULL,
|
||||
b_str_16 char(32) DEFAULT NULL,
|
||||
b_str_17 varchar(32) DEFAULT NULL,
|
||||
b_str_18 varchar(32) DEFAULT NULL,
|
||||
a_str_25 varchar(40) DEFAULT NULL,
|
||||
b_str_19 varchar(255) DEFAULT NULL,
|
||||
a_str_23 varchar(40) DEFAULT NULL,
|
||||
b_str_20 varchar(32) DEFAULT NULL,
|
||||
a_str_21 varchar(255) DEFAULT NULL,
|
||||
a_str_20 varchar(255) DEFAULT NULL,
|
||||
a_str_39 varchar(255) DEFAULT NULL,
|
||||
a_str_38 varchar(255) DEFAULT NULL,
|
||||
a_str_37 varchar(255) DEFAULT NULL,
|
||||
b_str_21 char(32) DEFAULT NULL,
|
||||
b_str_23 varchar(80) DEFAULT NULL,
|
||||
b_str_24 varchar(32) DEFAULT NULL,
|
||||
b_str_25 varchar(32) DEFAULT NULL,
|
||||
b_str_26 char(32) NOT NULL DEFAULT '',
|
||||
b_str_27 varchar(255) DEFAULT NULL,
|
||||
a_str_36 varchar(255) DEFAULT NULL,
|
||||
a_str_33 varchar(100) DEFAULT NULL,
|
||||
a_ref_10 char(32) DEFAULT NULL,
|
||||
b_str_28 char(32) DEFAULT NULL,
|
||||
b_str_29 char(32) DEFAULT NULL,
|
||||
a_ref_6 char(32) DEFAULT NULL,
|
||||
a_ref_12 varchar(32) DEFAULT NULL,
|
||||
a_ref_11 varchar(32) DEFAULT NULL,
|
||||
a_str_49 varchar(40) DEFAULT NULL,
|
||||
b_str_30 varchar(32) DEFAULT NULL,
|
||||
a_ref_3 varchar(32) DEFAULT NULL,
|
||||
a_str_48 varchar(40) DEFAULT NULL,
|
||||
a_ref_1 char(32) DEFAULT NULL,
|
||||
b_str_31 varchar(32) DEFAULT NULL,
|
||||
b_str_32 varchar(255) DEFAULT NULL,
|
||||
b_str_33 char(32) DEFAULT NULL,
|
||||
b_str_34 varchar(32) DEFAULT NULL,
|
||||
a_str_47 varchar(40) DEFAULT NULL,
|
||||
b_str_36 varchar(255) DEFAULT NULL,
|
||||
a_str_46 varchar(40) DEFAULT NULL,
|
||||
a_str_45 varchar(255) DEFAULT NULL,
|
||||
b_str_38 varchar(32) DEFAULT NULL,
|
||||
b_str_39 char(32) DEFAULT NULL,
|
||||
b_str_40 varchar(32) DEFAULT NULL,
|
||||
a_str_41 varchar(255) DEFAULT NULL,
|
||||
b_str_41 varchar(32) DEFAULT NULL,
|
||||
PRIMARY KEY (b_str_26),
|
||||
UNIQUE KEY a_str_47 (a_str_47),
|
||||
UNIQUE KEY a_str_49 (a_str_49),
|
||||
UNIQUE KEY a_str_33 (a_str_33),
|
||||
UNIQUE KEY a_str_46 (a_str_46),
|
||||
UNIQUE KEY a_str_48 (a_str_48),
|
||||
KEY b_str_18 (b_str_18),
|
||||
KEY a_str_26 (a_str_26),
|
||||
KEY b_str_27 (b_str_27,b_str_19),
|
||||
KEY b_str_41 (b_str_41),
|
||||
KEY b_str_15 (b_str_15),
|
||||
KEY a_str_20 (a_str_20),
|
||||
KEY b_str_17 (b_str_17),
|
||||
KEY b_str_40 (b_str_40),
|
||||
KEY b_str_24 (b_str_24),
|
||||
KEY b_str_10 (b_str_10),
|
||||
KEY b_str_16 (b_str_16),
|
||||
KEY b_str_29 (b_str_29),
|
||||
KEY a_str_41 (a_str_41),
|
||||
KEY b_str_7 (b_str_7),
|
||||
KEY a_str_45 (a_str_45),
|
||||
KEY a_str_28 (a_str_28),
|
||||
KEY a_str_37 (a_str_37),
|
||||
KEY b_str_6 (b_str_6),
|
||||
KEY a_ref_6 (a_ref_6),
|
||||
KEY b_str_34 (b_str_34),
|
||||
KEY b_str_38 (b_str_38),
|
||||
KEY a_ref_10 (a_ref_10),
|
||||
KEY b_str_21 (b_str_21),
|
||||
KEY b_str_23 (b_str_23,b_str_19),
|
||||
KEY b_str_33 (b_str_33),
|
||||
KEY a_ref_12 (a_ref_12),
|
||||
KEY a_str_18 (a_str_18(255)),
|
||||
KEY a_str_39 (a_str_39),
|
||||
KEY a_str_27 (a_str_27),
|
||||
KEY a_str_25 (a_str_25),
|
||||
KEY b_str_9 (b_str_9),
|
||||
KEY a_str_23 (a_str_23),
|
||||
KEY b_str_8 (b_str_8),
|
||||
KEY a_str_21 (a_str_21),
|
||||
KEY b_str_3 (b_str_3),
|
||||
KEY b_str_30 (b_str_30),
|
||||
KEY b_str_12 (b_str_12),
|
||||
KEY b_str_25 (b_str_25),
|
||||
KEY b_str_13 (b_str_13),
|
||||
KEY a_str_38 (a_str_38),
|
||||
KEY a_str_13 (a_str_13(255)),
|
||||
KEY a_str_36 (a_str_36),
|
||||
KEY b_str_28 (b_str_28),
|
||||
KEY b_str_19 (b_str_19),
|
||||
KEY b_str_11 (b_str_11),
|
||||
KEY a_ref_1 (a_ref_1),
|
||||
KEY b_str_20 (b_str_20),
|
||||
KEY b_str_14 (b_str_14),
|
||||
KEY a_ref_3 (a_ref_3),
|
||||
KEY b_str_39 (b_str_39),
|
||||
KEY b_str_32 (b_str_32),
|
||||
KEY a_str_6 (a_str_6),
|
||||
KEY b_str_5 (b_str_5),
|
||||
KEY b_str_31 (b_str_31),
|
||||
KEY a_ref_11 (a_ref_11)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO test_tab (b_str_26, a_str_13, a_str_18) VALUES
|
||||
('a', REPEAT('f',4031), REPEAT('g', 4031));
|
||||
|
||||
UPDATE test_tab SET a_str_13=REPEAT('h',4032), a_str_18=REPEAT('i',4032);
|
||||
SELECT 'Reducing length to 4030';
|
||||
UPDATE test_tab SET a_str_13=REPEAT('j',4030), a_str_18=REPEAT('k',4030);
|
||||
UPDATE test_tab SET a_str_13=REPEAT('l',4031), a_str_18=REPEAT('m',4031);
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) FROM test_tab;
|
||||
CHECK TABLE test_tab;
|
||||
DROP TABLE test_tab;
|
Reference in New Issue
Block a user