Commit e65c93a5 authored by Alice Sherepa's avatar Alice Sherepa

innodb suite <=ibuf_not_empty

parent b28aa4e8
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 4096`)
{
--skip Test requires InnoDB with 4k Page size.
}
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 8192`)
{
--skip Test requires InnoDB with 8k Page size.
}
if (`SELECT @@GLOBAL.innodb_checksum_algorithm like 'strict_%'`)
{
--skip This test cannot be run when innodb_checksum_algorithm is in strict mode
}
......@@ -7,3 +7,24 @@ insert into t1 values ('w'), ('w');
create unique index index_t1 on t1(f1(4));
ERROR 23000: Duplicate entry 'w' for key 'index_t1'
drop table t1;
#
#BUG#21326304 INNODB ONLINE ATER TABLE ENDS IN CRASH ON DISK FULL
#
CREATE TABLE t1(f1 CHAR(255) NOT NULL, f2 CHAR(255) NOT NULL, f3
CHAR(255) NOT NULL, f4 CHAR(255) NOT NULL, f5 CHAR(255) NOT NULL,f6
CHAR(255) NOT NULL, f7 CHAR(255) NOT NULL, f8 CHAR(255) NOT NULL,f9
CHAR(255) NOT NULL, f10 CHAR(255) NOT NULL, f11 CHAR(255) NOT NULL,f12
CHAR(255) NOT NULL, f13 CHAR(255) NOT NULL, f14 CHAR(255) NOT NULL,f15
CHAR(255) NOT NULL, f16 CHAR(255) NOT NULL, f17 CHAR(255) NOT NULL,f18
CHAR(255) NOT NULL)ENGINE=INNODB;
INSERT INTO t1
VALUES('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r');
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
set debug_dbug="+d,disk_is_full";
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
ERROR HY000: The table 't1' is full
set debug_dbug="-d,disk_is_full";
DROP TABLE t1;
\ No newline at end of file
......@@ -32,5 +32,4 @@ FLUSH TABLES t2 FOR EXPORT;
UNLOCK TABLES;
SET GLOBAL innodb_disable_background_merge=OFF;
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
SET GLOBAL innodb_stats_persistent=ON;
DROP TABLE t1,t2;
#
# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
# ADD FOREIGN KEY
#
CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT,
PRIMARY KEY (`department_id`)) engine=innodb;
CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT,
`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb;
CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb;
ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES
`people` (`people_id`);
ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people`
(`people_id`);
ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people`
(`people_id`);
drop table title, department, people;
......@@ -6,11 +6,11 @@ create table t1 (f1 int primary key) engine=InnoDB;
create table t2 (f1 int primary key,
constraint c1 foreign key (f1) references t1(f1),
constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
ERROR HY000: Cannot add foreign key constraint
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
create table t2 (f1 int primary key,
constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
ERROR 23000: Can't write; duplicate key in table '#sql-temporary'
ERROR HY000: Can't create table `test`.`#sql-2565_3` (errno: 121 "Duplicate key on write or update")
set foreign_key_checks = 0;
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
ERROR HY000: Duplicate foreign key constraint name 'test/c1'
......
......@@ -24,7 +24,7 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
# Stop server
# Restart server.
insert into t1 values(0,'y',1);
ERROR HY000: Can't lock file (errno: 165 - Table is read only)
ERROR HY000: Table 't1' is read only
# Stop server
# Restart server.
DROP TABLE t1;
......@@ -1627,6 +1627,7 @@ a
drop table t1;
create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
analyze table t1;
select * from t1 order by a,b,c,d;
a b c d e
1 1 a 1 1
......@@ -1710,6 +1711,73 @@ variable_value - @innodb_row_lock_time_max_orig
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value - @innodb_row_lock_time_avg_orig
0
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 30
set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 1000
set global innodb_sync_spin_loops=0;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 0
set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 0
set global innodb_thread_concurrency=1001;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001'
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 1000
set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 0
set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 16
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 5000
set global innodb_concurrency_tickets=1000;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1000
set global innodb_concurrency_tickets=0;
Warnings:
Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1
set global innodb_concurrency_tickets=5000;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 5000
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 10000
set global innodb_thread_sleep_delay=100000;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 100000
set global innodb_thread_sleep_delay=0;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 0
set global innodb_thread_sleep_delay=10000;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 10000
set global innodb_thread_sleep_delay=0;
set storage_engine=INNODB;
drop table if exists t1,t2,t3;
--- Testing varchar ---
......@@ -3143,3 +3211,83 @@ show status like "handler_read_key";
Variable_name Value
Handler_read_key 0
drop table t1;
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (c1 INT) ENGINE=InnoDB;
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(0);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
ROLLBACK;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1
START TRANSACTION READ ONLY;
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
INSERT INTO t2 VALUES(1);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
COMMIT;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1
1
3
DROP TABLE t2;
CREATE TEMPORARY TABLE t2 (
c1 INT AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
ROLLBACK;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1 c2
START TRANSACTION READ ONLY;
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction.
COMMIT;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1 c2
4 1
7 1
5 2
8 2
6 3
9 3
DROP TABLE t1;
DROP TABLE t2;
......@@ -9,7 +9,7 @@ call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
BEGIN;
INSERT INTO t1 VALUES(1), (2), (3), (4);
SET SESSION debug="+d,crash_commit_before";
set debug_dbug="+d,crash_commit_before";
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
SELECT COUNT(*) IN (0,4) yes FROM t1;
......
......@@ -8,14 +8,14 @@ insert into t3 values (20);
alter table t2 add constraint c1 foreign key (f1)
references t1(f1) on update cascade;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
KEY `k1` (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) DEFAULT NULL,
`f2` int(11) DEFAULT NULL,
KEY `f1` (`f1`),
......@@ -23,8 +23,8 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `c1` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
Table Create Table
t3 CREATE TABLE `t3` (
`f2` int(11) DEFAULT NULL,
KEY `f2` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
......@@ -37,7 +37,7 @@ SET DEBUG_SYNC='innodb_row_update_for_mysql_begin
SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze
WAIT_FOR foreign_free_cache';
update ignore t1 set f1 = 20;
ERROR HY000: Error on rename of './test/t2' to '#sql2-temporary' (errno: 183 - Table is being used in foreign key check)
ERROR HY000: Error on rename of './test/t2' to '#sql2-temporary' (errno: 183 "Table is being used in foreign key check")
SET DEBUG_SYNC='now SIGNAL foreign_free_cache';
drop table t2;
drop table t1;
......
......@@ -18,7 +18,7 @@ SET DEBUG_SYNC = 'foreign_constraint_check_for_ins WAIT_FOR drop_done';
# connection default: replace the underlying index of FOREIGN KEY
CREATE INDEX idx1 ON parent(b, c);
Warnings:
Note 1831 Duplicate index 'idx1' defined on the table 'test.parent'. This is deprecated and will be disallowed in a future release.
Note 1831 Duplicate index `idx1`. This is deprecated and will be disallowed in a future release.
DROP INDEX b ON parent;
SET DEBUG_SYNC = 'now SIGNAL drop_done';
/* con1 reap */ INSERT INTO child VALUES (1, 5, 'khD','khD');
......@@ -44,7 +44,7 @@ COMMIT;
# connection default: no locks on table child
CREATE INDEX idx ON child(b, c);
Warnings:
Note 1831 Duplicate index 'idx' defined on the table 'test.child'. This is deprecated and will be disallowed in a future release.
Note 1831 Duplicate index `idx`. This is deprecated and will be disallowed in a future release.
DROP INDEX b ON child;
SELECT * FROM child;
a d b c
......
......@@ -15,5 +15,6 @@ EVENT_NAME COUNT_STAR
wait/io/file/innodb/innodb_data_file 5
wait/io/file/innodb/innodb_log_file 5
wait/io/file/innodb/innodb_temp_file 5
wait/io/file/innodb/innodb_bmp_file 5
USE test;
DROP table t1;
CREATE TABLE autorecalc (a INT, PRIMARY KEY (a)) ENGINE=INNODB;
SELECT n_rows, clustered_index_size FROM mysql.innodb_table_stats WHERE table_name = 'autorecalc';
n_rows 0
clustered_index_size 1
SELECT index_name, stat_name, stat_value FROM mysql.innodb_index_stats WHERE table_name = 'autorecalc';
index_name PRIMARY
stat_name n_diff_pfx01
stat_value 0
index_name PRIMARY
stat_name n_leaf_pages
stat_value 1
index_name PRIMARY
stat_name size
stat_value 1
INSERT INTO autorecalc VALUES (1);
INSERT INTO autorecalc VALUES (2);
Timeout in wait_condition.inc for SELECT stat_value = 2 FROM mysql.innodb_index_stats WHERE table_name = 'autorecalc' AND index_name = 'PRIMARY' AND stat_name = 'n_diff_pfx01'
Id 7
User root
Host localhost
db test
Command Query
Time 0
State init
Info show full processlist
Progress 0.000
SELECT n_rows, clustered_index_size FROM mysql.innodb_table_stats WHERE table_name = 'autorecalc';
n_rows 2
clustered_index_size 1
SELECT index_name, stat_name, stat_value FROM mysql.innodb_index_stats WHERE table_name = 'autorecalc';
index_name PRIMARY
stat_name n_diff_pfx01
stat_value 2
index_name PRIMARY
stat_name n_leaf_pages
stat_value 1
index_name PRIMARY
stat_name size
stat_value 1
DELETE FROM autorecalc;
Timeout in wait_condition.inc for SELECT stat_value = 0 FROM mysql.innodb_index_stats WHERE table_name = 'autorecalc' AND index_name = 'PRIMARY' AND stat_name = 'n_diff_pfx01'
Id 7
User root
Host localhost
db test
Command Query
Time 0
State init
Info show full processlist
Progress 0.000
SELECT n_rows, clustered_index_size FROM mysql.innodb_table_stats WHERE table_name = 'autorecalc';
n_rows 0
clustered_index_size 1
SELECT index_name, stat_name, stat_value FROM mysql.innodb_index_stats WHERE table_name = 'autorecalc';
index_name PRIMARY
stat_name n_diff_pfx01
stat_value 0
index_name PRIMARY
stat_name n_leaf_pages
stat_value 1
index_name PRIMARY
stat_name size
stat_value 1
DROP TABLE autorecalc;
......@@ -2,33 +2,33 @@ CREATE TABLE arddl (a INT, b INT, PRIMARY KEY (a)) ENGINE=INNODB;
INSERT INTO arddl VALUES (1, 10);
INSERT INTO arddl VALUES (2, 10);
ALTER TABLE arddl ADD INDEX (b);
Timeout in wait_condition.inc for SELECT stat_value = 2 FROM mysql.innodb_index_stats WHERE table_name = 'arddl' AND index_name = 'PRIMARY' AND stat_name = 'n_diff_pfx01'
Id 3
User root
Host localhost
db test
Command Query
Time 0
State init
Info show full processlist
Progress 0.000
SELECT n_rows FROM mysql.innodb_table_stats WHERE table_name = 'arddl' ORDER BY 1;
n_rows 2
SELECT index_name, stat_name, stat_value FROM mysql.innodb_index_stats WHERE table_name = 'arddl' AND index_name = 'PRIMARY' ORDER BY 1, 2, 3;
index_name PRIMARY
stat_name n_diff_pfx01
stat_value 2
index_name PRIMARY
stat_name n_leaf_pages
stat_value 1
index_name PRIMARY
stat_name size
stat_value 1
DROP TABLE arddl;
CREATE TABLE arddl (a INT, b INT, PRIMARY KEY (a), KEY (b)) ENGINE=INNODB;
INSERT INTO arddl VALUES (3, 10);
INSERT INTO arddl VALUES (4, 10);
ALTER TABLE arddl DROP INDEX b;
Timeout in wait_condition.inc for SELECT stat_value = 2 FROM mysql.innodb_index_stats WHERE table_name = 'arddl' AND index_name = 'PRIMARY' AND stat_name = 'n_diff_pfx01'
Id 3
User root
Host localhost
db test
Command Query
Time 0
State init
Info show full processlist
Progress 0.000
SELECT n_rows FROM mysql.innodb_table_stats WHERE table_name = 'arddl' ORDER BY 1;
n_rows 2
SELECT index_name, stat_name, stat_value FROM mysql.innodb_index_stats WHERE table_name = 'arddl' AND index_name = 'PRIMARY' ORDER BY 1, 2, 3;
index_name PRIMARY
stat_name n_diff_pfx01
stat_value 2
index_name PRIMARY
stat_name n_leaf_pages
stat_value 1
index_name PRIMARY
stat_name size
stat_value 1
DROP TABLE arddl;
Test with default setting
CREATE TABLE t (a INT, PRIMARY KEY (a)) ENGINE=INNODB;
SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE table_name = 't';
COUNT(*) 1
COUNT(*) 0
SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 3
COUNT(*) 0
FLUSH TABLE t;
DELETE FROM mysql.innodb_index_stats WHERE table_name = 't';
DELETE FROM mysql.innodb_table_stats WHERE table_name = 't';
......@@ -13,16 +13,16 @@ SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 0
SELECT * FROM t;
SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE table_name = 't';
COUNT(*) 1
COUNT(*) 0
SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 3
COUNT(*) 0
DROP TABLE t;
Test with explicit enable
CREATE TABLE t (a INT, PRIMARY KEY (a)) ENGINE=INNODB STATS_AUTO_RECALC=1;
SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE table_name = 't';
COUNT(*) 1
COUNT(*) 0
SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 3
COUNT(*) 0
FLUSH TABLE t;
DELETE FROM mysql.innodb_index_stats WHERE table_name = 't';
DELETE FROM mysql.innodb_table_stats WHERE table_name = 't';
......@@ -32,16 +32,16 @@ SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 0
SELECT * FROM t;
SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE table_name = 't';
COUNT(*) 1
COUNT(*) 0
SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 3
COUNT(*) 0
DROP TABLE t;
Test with explicit disable
CREATE TABLE t (a INT, PRIMARY KEY (a)) ENGINE=INNODB STATS_AUTO_RECALC=0;
SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE table_name = 't';
COUNT(*) 1
COUNT(*) 0
SELECT COUNT(*) FROM mysql.innodb_index_stats WHERE table_name = 't';
COUNT(*) 3
COUNT(*) 0
FLUSH TABLE t;
DELETE FROM mysql.innodb_index_stats WHERE table_name = 't';
DELETE FROM mysql.innodb_table_stats WHERE table_name = 't';
......
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options
create_options
ALTER TABLE test_ps_sample_pages STATS_SAMPLE_PAGES=12345;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_SAMPLE_PAGES=12345
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options stats_sample_pages=12345
create_options stats_sample_pages=12345
DROP TABLE test_ps_sample_pages;
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=default;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options
create_options
DROP TABLE test_ps_sample_pages;
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=-5;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-5' at line 2
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-5' at line 2
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=0;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' at line 2
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0' at line 2
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=67000;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '67000' at line 2
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '67000' at line 2
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=670000;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '670000' at line 2
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '670000' at line 2
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=65536;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '65536' at line 2
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '65536' at line 2
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=65535;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_SAMPLE_PAGES=65535
......@@ -58,34 +58,34 @@ DROP TABLE test_ps_sample_pages;
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=1;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_SAMPLE_PAGES=1
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options stats_sample_pages=1
create_options stats_sample_pages=1
DROP TABLE test_ps_sample_pages;
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB
STATS_SAMPLE_PAGES=5678;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_SAMPLE_PAGES=5678
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options stats_sample_pages=5678
create_options stats_sample_pages=5678
ALTER TABLE test_ps_sample_pages STATS_SAMPLE_PAGES=default;
SHOW CREATE TABLE test_ps_sample_pages;
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
Table test_ps_sample_pages
Create Table CREATE TABLE `test_ps_sample_pages` (
`a` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT create_options FROM information_schema.tables
WHERE table_name='test_ps_sample_pages';
create_options
create_options
DROP TABLE test_ps_sample_pages;
......@@ -7,9 +7,9 @@ FOREIGN KEY (a) REFERENCES parent(a) ON DELETE CASCADE
) ENGINE=INNODB;
INSERT INTO parent VALUES (1);
INSERT INTO child VALUES (1);
SET SESSION DEBUG='+d,test_upd_stats_if_needed_not_inited';
set debug_dbug='+d,test_upd_stats_if_needed_not_inited';
DELETE FROM parent;
SET SESSION DEBUG='-d,test_upd_stats_if_needed_not_inited';
set debug_dbug='-d,test_upd_stats_if_needed_not_inited';
test_upd_stats_if_needed_not_inited was executed
DROP TABLE child;
DROP TABLE parent;
CREATE TABLE t (c INT) ENGINE=INNODB;
SET SESSION DEBUG='+d,test_ut_format_name';
set debug_dbug='+d,test_ut_format_name';
DROP TABLE t;
SET SESSION DEBUG='-d,test_ut_format_name';
set debug_dbug='-d,test_ut_format_name';
......@@ -207,6 +207,10 @@ dml_reads disabled
dml_inserts disabled
dml_deletes disabled
dml_updates disabled
dml_system_reads disabled
dml_system_inserts disabled
dml_system_deletes disabled
dml_system_updates disabled
ddl_background_drop_indexes disabled
ddl_background_drop_tables disabled
ddl_online_create_index disabled
......@@ -429,6 +433,10 @@ dml_reads 4 NULL 4 4 NULL 4 enabled
dml_inserts 1 NULL 1 1 NULL 1 enabled
dml_deletes 0 NULL 0 0 NULL 0 enabled
dml_updates 2 NULL 2 2 NULL 2 enabled
dml_system_reads 0 NULL 0 0 NULL 0 enabled
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
dml_system_updates 0 NULL 0 0 NULL 0 enabled
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
......@@ -439,6 +447,10 @@ dml_reads 6 NULL 6 6 NULL 6 enabled
dml_inserts 1 NULL 1 1 NULL 1 enabled
dml_deletes 2 NULL 2 2 NULL 2 enabled
dml_updates 2 NULL 2 2 NULL 2 enabled
dml_system_reads 0 NULL 0 0 NULL 0 enabled
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
dml_system_updates 0 NULL 0 0 NULL 0 enabled
set global innodb_monitor_reset = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
......@@ -449,6 +461,10 @@ dml_reads 6 NULL 6 0 NULL 0 enabled
dml_inserts 1 NULL 1 0 NULL 0 enabled
dml_deletes 2 NULL 2 0 NULL 0 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled
dml_system_reads 0 NULL 0 0 NULL 0 enabled
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
dml_system_updates 0 NULL 0 0 NULL 0 enabled
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
......@@ -461,6 +477,10 @@ dml_reads 8 NULL 8 2 NULL 2 enabled
dml_inserts 3 NULL 3 2 NULL 2 enabled
dml_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled
dml_system_reads 0 NULL 0 0 NULL 0 enabled
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
dml_system_updates 0 NULL 0 0 NULL 0 enabled
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
......@@ -471,6 +491,10 @@ dml_reads 8 NULL 8 2 NULL 2 enabled
dml_inserts 3 NULL 3 2 NULL 2 enabled
dml_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled
dml_system_reads 0 NULL 0 0 NULL 0 enabled
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
dml_system_updates 0 NULL 0 0 NULL 0 enabled
set global innodb_monitor_disable = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
......@@ -481,6 +505,10 @@ dml_reads 8 NULL 8 2 NULL 2 disabled
dml_inserts 3 NULL 3 2 NULL 2 disabled
dml_deletes 4 NULL 4 2 NULL 2 disabled
dml_updates 2 NULL 2 0 NULL 0 disabled
dml_system_reads 0 NULL 0 0 NULL 0 disabled
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
dml_system_updates 0 NULL 0 0 NULL 0 disabled
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
......@@ -491,6 +519,10 @@ dml_reads NULL NULL 0 NULL NULL 0 disabled
dml_inserts NULL NULL 0 NULL NULL 0 disabled
dml_deletes NULL NULL 0 NULL NULL 0 disabled
dml_updates NULL NULL 0 NULL NULL 0 disabled
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
set global innodb_monitor_enable = dml_inserts;
insert into monitor_test values(9);
insert into monitor_test values(1);
......@@ -504,6 +536,10 @@ dml_reads NULL NULL 0 NULL NULL 0 disabled
dml_inserts 2 NULL 2 2 NULL 2 enabled
dml_deletes NULL NULL 0 NULL NULL 0 disabled
dml_updates NULL NULL 0 NULL NULL 0 disabled
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
set global innodb_monitor_disable = module_dml;
drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
......
......@@ -14,6 +14,7 @@ a b
1 abc
2 def
3 ghi
"Unexpected count: 0"
DROP TABLE t1;
SET GLOBAL innodb_stats_persistent = default;
SET GLOBAL innodb_stats_auto_recalc = default;
......
......@@ -10,6 +10,7 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: innodb_checksum_algorithm is set
select count(*) from t1;
count(*)
0
FOUND /\[Warning\] InnoDB: innodb_checksum_algorithm is set to "strict_innodb" but the page \[page id: space=\d+, page number=\d+\] contains a valid checksum .*. Accepting the page as valid. Change innodb_checksum_algorithm to .* to silently accept such pages or rewrite all pages so that they contain .* checksum./ in my_restart.err
insert into t1 values(2),(3),(4);
# Restart the server with --log-error
set global innodb_checksum_algorithm=strict_none;
......@@ -17,6 +18,7 @@ set global innodb_limit_optimistic_insert_debug = 2;
select count(*) from t1;
count(*)
3
FOUND /\[Warning\] InnoDB: innodb_checksum_algorithm is set to "strict_none" but the page \[page id: space=\d+, page number=\d+\] contains a valid checksum .*. Accepting the page as valid. Change innodb_checksum_algorithm to .* to silently accept such pages or rewrite all pages so that they contain .* checksum./ in my_restart.err
insert into t1 values(5),(6),(7);
select count(*) from t1;
count(*)
......
# Start mysqld to create tablespaces according to my.cnf
aria_log.00000001
aria_log_control
ib_logfile0
ib_logfile1
ib_logfile2
......
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################
......@@ -45,6 +45,5 @@ UNLOCK TABLES;
SET GLOBAL innodb_disable_background_merge=OFF;
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
SET GLOBAL innodb_stats_persistent=ON;
DROP TABLE t1,t2;
......@@ -6,7 +6,7 @@
--echo #
create table t1 (f1 int primary key) engine=InnoDB;
--error ER_CANNOT_ADD_FOREIGN
--error ER_CANT_CREATE_TABLE
create table t2 (f1 int primary key,
constraint c1 foreign key (f1) references t1(f1),
constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
......@@ -14,7 +14,7 @@ create table t2 (f1 int primary key,
constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
--replace_regex /#sql-[0-9a-f_]*'/#sql-temporary'/
--error ER_DUP_KEY
--error ER_CANT_CREATE_TABLE
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
set foreign_key_checks = 0;
......
......@@ -67,7 +67,7 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
# Turn off reconnect again
--disable_reconnect
--error ER_CANT_LOCK
--error ER_OPEN_AS_READONLY
insert into t1 values(0,'y',1);
# Restart the server in force recovery mode
......
--source include/have_innodb.inc
CREATE TABLE worklog5743 (col_1_CHAR CHAR(255) , col_2_CHAR CHAR(255) ,
PRIMARY KEY (col_1_CHAR)) engine = innodb;
INSERT INTO worklog5743 VALUES(repeat("a", 200) , repeat("o", 200));
......
......@@ -36,7 +36,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# for deterministic reasons simple data should be inserted.
# insert some 100 records
===============
......@@ -1719,7 +1719,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# for determintic resons simple data should be inserted.
#insert some 100 records
===============
......@@ -1951,7 +1951,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed page and check the stats
===============
Fetch Records
......@@ -1977,7 +1977,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed same page once again and check the stats
# the stat figures should be same as above query
===============
......@@ -2004,7 +2004,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# Restarting server
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
......@@ -3408,7 +3408,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# for determintic resons simple data should be inserted.
#insert some 100 records
===============
......@@ -3640,7 +3640,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed page and check the stats
===============
Fetch Records
......@@ -3666,7 +3666,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed same page once again and check the stats
# the stat figures should be same as above query
===============
......@@ -3693,7 +3693,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
DROP TABLE tab5;
#reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
......@@ -4639,7 +4639,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# for determintic resons simple data should be inserted.
#insert some 100 records
===============
......@@ -4870,7 +4870,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed page and check the stats
===============
Fetch Records
......@@ -4896,7 +4896,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed same page once again and check the stats
# the stat figures should be same as above query
===============
......@@ -4923,7 +4923,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# Restarting server
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
......@@ -6300,7 +6300,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# for determintic resons simple data should be inserted.
#insert some 100 records
===============
......@@ -6531,7 +6531,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed page and check the stats
===============
Fetch Records
......@@ -6557,7 +6557,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# fetch the compressed same page once again and check the stats
# the stat figures should be same as above query
===============
......@@ -6584,7 +6584,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
AND table_name='tab5' AND database_name='test'
AND index_name like 'idx%' ;
compress_stat 1
The size of the tab5.ibd file: 65536
The size of the tab5.ibd file: 5242880
# Restarting server
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
......
--innodb-sys-indexes
--innodb-sys-tables
\ No newline at end of file
......@@ -45,7 +45,7 @@ SELECT variable_value FROM information_schema.global_status
--let $rep_table_1 = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/slave_master_info'`
--let $rep_table_2 = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/slave_relay_log_info'`
--let $rep_table_3 = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/slave_worker_info'`
--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id, $rep_table_1, $rep_table_2, $rep_table_3)
--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id, $rep_table_1, $rep_table_2, $rep_table_3);
--enable_query_log
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment