Commit 41332426 authored by Alice Sherepa's avatar Alice Sherepa

stats_table_flag

parent b0bccac1
#
-- echo =====
-- echo === Test ANALYZE behavior after default creation
-- echo =====
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB STATS_PERSISTENT=default;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
#
-- echo =====
-- echo === Test ANALYZE behavior after creation with explicit PS=OFF
-- echo =====
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB STATS_PERSISTENT=0;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
#
-- echo =====
-- echo === Test ANALYZE behavior after creation with explicit PS=ON
-- echo =====
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB STATS_PERSISTENT=1;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
#
-- echo =====
-- echo === Test ANALYZE behavior after creation with explicit PS=OFF,
-- echo === then ALTER to ON, then ALTER to OFF, then ALTER to default
-- echo =====
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB STATS_PERSISTENT=0;
ALTER TABLE test_ps_flag STATS_PERSISTENT=1;
# also check that the change from the ALTER TABLE survives server restart
-- source include/restart_mysqld.inc
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
ALTER TABLE test_ps_flag STATS_PERSISTENT=0;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
ALTER TABLE test_ps_flag STATS_PERSISTENT=default;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
#
-- echo =====
-- echo === Test ANALYZE behavior after creation with explicit PS=ON,
-- echo === then ALTER to OFF, then ALTER to ON, then ALTER to default
-- echo =====
CREATE TABLE test_ps_flag (a INT) ENGINE=INNODB STATS_PERSISTENT=1;
ALTER TABLE test_ps_flag STATS_PERSISTENT=0;
# also check that the change from the ALTER TABLE survives server restart
-- source include/restart_mysqld.inc
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
ALTER TABLE test_ps_flag STATS_PERSISTENT=1;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
ALTER TABLE test_ps_flag STATS_PERSISTENT=default;
-- source suite/innodb/include/innodb_stats_table_flag_analyze.inc
DROP TABLE test_ps_flag;
SHOW CREATE TABLE test_ps_flag;
DELETE FROM mysql.innodb_index_stats WHERE table_name = 'test_ps_flag';
DELETE FROM mysql.innodb_table_stats WHERE table_name = 'test_ps_flag';
# must be 0, we have just deleted the rows
SELECT COUNT(*) AS cnt_before FROM mysql.innodb_table_stats WHERE table_name = 'test_ps_flag';
ANALYZE TABLE test_ps_flag;
# if the table is PS enabled, then this should be 1 and 0 otherwise
SELECT COUNT(*) AS cnt_after FROM mysql.innodb_table_stats WHERE table_name = 'test_ps_flag';
......@@ -15,6 +15,5 @@ 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;
......@@ -103,7 +103,7 @@ id INT NOT NULL PRIMARY KEY,
b INT,
FOREIGN KEY (b) REFERENCES test.t1(id)
) 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")
DROP TABLE t1;
create table t1 (col1 varchar(2000), index (col1(767)))
character set = latin1 engine = innodb;
......@@ -211,13 +211,13 @@ drop table t1;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
ERROR HY000: Cannot add foreign key constraint
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
set foreign_key_checks=1;
drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
ERROR HY000: Cannot add foreign key constraint
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
set foreign_key_checks=1;
drop table t1;
set foreign_key_checks=0;
......@@ -237,7 +237,7 @@ set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
rename table t3 to t1;
ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150 - Foreign key constraint is incorrectly formed)
ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed")
set foreign_key_checks=1;
drop table t2,t3;
create table t1(a int primary key) row_format=redundant engine=innodb;
......@@ -580,7 +580,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Can't update table 't2' while 't10' is being created.
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
......
......@@ -129,7 +129,7 @@ CREATE TABLE t1
id INT PRIMARY KEY
) ENGINE=InnoDB;
--error ER_CANNOT_ADD_FOREIGN
--error ER_CANT_CREATE_TABLE
CREATE TEMPORARY TABLE t2
(
id INT NOT NULL PRIMARY KEY,
......@@ -279,7 +279,7 @@ disconnect b;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
--error ER_CANNOT_ADD_FOREIGN
--error ER_CANT_CREATE_TABLE
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
drop table t2;
......@@ -289,7 +289,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
--error ER_CANNOT_ADD_FOREIGN
--error ER_CANT_CREATE_TABLE
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
drop table t1;
......@@ -858,7 +858,8 @@ connection i;
reap;
connection j;
--error ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT
#--error ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection a;
......
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