⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 innodb.test

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 TEST
📖 第 1 页 / 共 5 页
字号:
# BUG#7709 test case - Boolean fulltext query against unsupported #                      engines does not fail#CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;--error 1214SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);DROP TABLE t1;## check null values #1#--disable_warningsCREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;INSERT INTO t1 VALUES (1),(2),(3);CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY  (b_id), KEY  (b_a),                 CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;--enable_warningsINSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;DROP TABLE t2;DROP TABLE t1;## Bug#11816 - Truncate table doesn't work with temporary innodb tables# This is not an innodb bug, but we test it using innodb.#create temporary table t1 (a int) engine=innodb;insert into t1 values (4711);truncate t1;insert into t1 values (42);select * from t1;drop table t1;# Show that it works with permanent tables too.create table t1 (a int) engine=innodb;insert into t1 values (4711);truncate t1;insert into t1 values (42);select * from t1;drop table t1;## Bug #13025  Server crash during filesort	#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);select * from t1 order by a,b,c,d;explain select * from t1 order by a,b,c,d;drop table t1;## BUG#11039,#13218 Wrong key length in min()#create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;insert into t1 values ('8', '6'), ('4', '7');select min(a) from t1;select min(b) from t1 where a='8';drop table t1;# End of 4.1 tests## range optimizer problem#create table t1 (x bigint unsigned not null primary key) engine=innodb;insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);select * from t1;select count(*) from t1 where x>0;select count(*) from t1 where x=0;select count(*) from t1 where x<0;select count(*) from t1 where x < -16;select count(*) from t1 where x = -16;explain select count(*) from t1 where x > -16;select count(*) from t1 where x > -16;select * from t1 where x > -16;select count(*) from t1 where x = 18446744073709551601;drop table t1;# Test for testable InnoDB status variables. This test# uses previous ones(pages_created, rows_deleted, ...).show status like "Innodb_buffer_pool_pages_total";show status like "Innodb_page_size";show status like "Innodb_rows_deleted";show status like "Innodb_rows_inserted";show status like "Innodb_rows_updated";# Test for row locks InnoDB status variables.show status like "Innodb_row_lock_waits";show status like "Innodb_row_lock_current_waits";show status like "Innodb_row_lock_time";show status like "Innodb_row_lock_time_max";show status like "Innodb_row_lock_time_avg";# Test for innodb_sync_spin_loops variableshow variables like "innodb_sync_spin_loops";set global innodb_sync_spin_loops=1000;show variables like "innodb_sync_spin_loops";set global innodb_sync_spin_loops=0;show variables like "innodb_sync_spin_loops";set global innodb_sync_spin_loops=20;show variables like "innodb_sync_spin_loops";# Test for innodb_thread_concurrency variableshow variables like "innodb_thread_concurrency";set global innodb_thread_concurrency=1001;show variables like "innodb_thread_concurrency";set global innodb_thread_concurrency=0;show variables like "innodb_thread_concurrency";set global innodb_thread_concurrency=16;show variables like "innodb_thread_concurrency";# Test for innodb_concurrency_tickets variableshow variables like "innodb_concurrency_tickets";set global innodb_concurrency_tickets=1000;show variables like "innodb_concurrency_tickets";set global innodb_concurrency_tickets=0;show variables like "innodb_concurrency_tickets";set global innodb_concurrency_tickets=500;show variables like "innodb_concurrency_tickets";# Test for innodb_thread_sleep_delay variableshow variables like "innodb_thread_sleep_delay";set global innodb_thread_sleep_delay=100000;show variables like "innodb_thread_sleep_delay";set global innodb_thread_sleep_delay=0;show variables like "innodb_thread_sleep_delay";set global innodb_thread_sleep_delay=10000;show variables like "innodb_thread_sleep_delay";## Test varchar#let $default=`select @@storage_engine`;set storage_engine=INNODB;source include/varchar.inc;## Some errors/warnings on create## Clean up filename -- embedded server reports whole path without .frm,# regular server reports relative path with .frm (argh!)--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t1.frm t1create table t1 (v varchar(65530), key(v));drop table t1;create table t1 (v varchar(65536));show create table t1;drop table t1;create table t1 (v varchar(65530) character set utf8);show create table t1;drop table t1;eval set storage_engine=$default;# InnoDB specific varchar testscreate table t1 (v varchar(16384)) engine=innodb;drop table t1;## BUG#11039 Wrong key length in min()#create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;insert into t1 values ('8', '6'), ('4', '7');select min(a) from t1;select min(b) from t1 where a='8';drop table t1;## Bug #11080 & #11005  Multi-row REPLACE fails on a duplicate key error#CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY  (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;insert into t1 (b) values (1);replace into t1 (b) values (2), (1), (3);select * from t1;truncate table t1;insert into t1 (b) values (1);replace into t1 (b) values (2);replace into t1 (b) values (1);replace into t1 (b) values (3);select * from t1;drop table t1;create table t1 (rowid int not null auto_increment, val int not null,primarykey (rowid), unique(val)) engine=innodb;replace into t1 (val) values ('1'),('2');replace into t1 (val) values ('1'),('2');--error 1062insert into t1 (val) values ('1'),('2');select * from t1;drop table t1;## Test that update does not change internal auto-increment value#create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;insert into t1 (val) values (1);update t1 set a=2 where a=1;# We should get the following error because InnoDB does not update the counter--error 1062insert into t1 (val) values (1);select * from t1;drop table t1;## Bug #10465#--disable_warningsCREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;--enable_warningsINSERT INTO t1 (GRADE) VALUES (151),(252),(343);SELECT GRADE  FROM t1 WHERE GRADE > 160 AND GRADE < 300;SELECT GRADE  FROM t1 WHERE GRADE= 151;DROP TABLE t1;## Bug #12340 multitable delete deletes only one record#create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;insert into t2 values ('aa','cc');insert into t1 values ('aa','bb'),('aa','cc');delete t1 from t1,t2 where f1=f3 and f4='cc';select * from t1;drop table t1,t2;## Test that the slow TRUNCATE implementation resets autoincrement columns# (bug #11946)#CREATE TABLE t1 (id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)) ENGINE=InnoDB;CREATE TABLE t2 (id INTEGER NOT NULL,FOREIGN KEY (id) REFERENCES t1 (id)) ENGINE=InnoDB;INSERT INTO t1 (id) VALUES (NULL);SELECT * FROM t1;TRUNCATE t1;INSERT INTO t1 (id) VALUES (NULL);SELECT * FROM t1;# continued from above; test that doing a slow TRUNCATE on a table with 0# rows resets autoincrement columnsDELETE FROM t1;TRUNCATE t1;INSERT INTO t1 (id) VALUES (NULL);SELECT * FROM t1;DROP TABLE t2, t1;# Test that foreign keys in temporary tables are not accepted (bug #12084)CREATE TABLE t1( id INT PRIMARY KEY) ENGINE=InnoDB;--error 1005,1005CREATE TEMPORARY TABLE t2( id INT NOT NULL PRIMARY KEY, b INT, FOREIGN KEY (b) REFERENCES test.t1(id)) ENGINE=InnoDB;DROP TABLE t1;## Test that index column max sizes are honored (bug #13315)## prefix indexcreate table t1 (col1 varchar(2000), index (col1(767))) character set = latin1 engine = innodb;# normal indexescreate table t2 (col1 char(255), index (col1)) character set = latin1 engine = innodb;create table t3 (col1 binary(255), index (col1)) character set = latin1 engine = innodb;create table t4 (col1 varchar(767), index (col1)) character set = latin1 engine = innodb;create table t5 (col1 varchar(767) primary key) character set = latin1 engine = innodb;create table t6 (col1 varbinary(767) primary key) character set = latin1 engine = innodb;create table t7 (col1 text, index(col1(767))) character set = latin1 engine = innodb;create table t8 (col1 blob, index(col1(767))) character set = latin1 engine = innodb;# multi-column indexes are allowed to be longercreate table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2)) character set = latin1 engine = innodb;show create table t9;drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;# these should have their index length trimmedcreate table t1 (col1 varchar(768), index(col1)) character set = latin1 engine = innodb;create table t2 (col1 varbinary(768), index(col1)) character set = latin1 engine = innodb;create table t3 (col1 text, index(col1(768))) character set = latin1 engine = innodb;create table t4 (col1 blob, index(col1(768))) character set = latin1 engine = innodb;show create table t1;drop table t1, t2, t3, t4;# these should be refused--error 1071create table t1 (col1 varchar(768) primary key) character set = latin1 engine = innodb;--error 1071create table t2 (col1 varbinary(768) primary key) character set = latin1 engine = innodb;--error 1071create table t3 (col1 text, primary key(col1(768))) character set = latin1 engine = innodb;--error 1071create table t4 (col1 blob, primary key(col1(768))) character set = latin1 engine = innodb;## Test improved foreign key error messages (bug #3443)#CREATE TABLE t1( id INT PRIMARY KEY) ENGINE=InnoDB;CREATE TABLE t2( v INT, CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)) ENGINE=InnoDB;--error 1452INSERT INTO t2 VALUES(2);INSERT INTO t1 VALUES(1);INSERT INTO t2 VALUES(1);--error 1451DELETE FROM t1 WHERE id = 1;--error 1217DROP TABLE t1;SET FOREIGN_KEY_CHECKS=0;DROP TABLE t1;SET FOREIGN_KEY_CHECKS=1;--error 1452INSERT INTO t2 VALUES(3);DROP TABLE t2;## Test that checksum table uses a consistent read Bug #12669#connect (a,localhost,root,,);connect (b,localhost,root,,);connection a;create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;insert into t1 values (1),(2);set autocommit=0;checksum table t1;connection b;insert into t1 values(3);connection a;## Here checksum should not see insert#checksum table t1;connection a;commit;checksum table t1;commit;drop table t1;## autocommit = 1#connection a;create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;insert into t1 values (1),(2);set autocommit=1;checksum table t1;connection b;set autocommit=1;insert into t1 values(3);connection a;## Here checksum sees insert#

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -