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

📄 myisam.test

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 TEST
📖 第 1 页 / 共 4 页
字号:
flush tables;# Open t2 and (implicitly) t1.select * from t2;# Truncate after flush works (unless another threads reopens t2 in between).flush tables;truncate table t1;insert into t1 values (1);# Close all tables.flush tables;# Open t2 and (implicitly) t1.select * from t2;# Truncate t1, wich was not recognized as open without the bugfix.# Now, it should fail with a table-in-use error message.--error 1105truncate table t1;# The insert used to fail on the crashed table.insert into t1 values (1);drop table t1,t2;## bug9188 - Corruption Can't open file: 'table.MYI' (errno: 145)#create table t1 (c1 int, c2 varchar(4) not null default '',                 key(c2(3))) default charset=utf8;insert into t1 values (1,'A'), (2, 'B'), (3, 'A');update t1 set c2='A  B' where c1=2;check table t1;drop table t1;## Bug#12296 - CHECKSUM TABLE reports 0 for the table# This happened if the first record was marked as deleted.#create table t1 (c1 int);insert into t1 values (1),(2),(3),(4);checksum table t1;delete from t1 where c1 = 1;create table t2 as select * from t1;# The following returns 0 with the bug in place.checksum table t1;# The above should give the same number as the following.checksum table t2;drop table t1, t2;## BUG#12232: New myisam_stats_method variable.#show variables like 'myisam_stats_method';create table t1 (a int, key(a));insert into t1 values (0),(1),(2),(3),(4);insert into t1 select NULL from t1;# default: NULLs considered inequalanalyze table t1; show index from t1;insert into t1 values (11);delete from t1 where a=11;check table t1;show index from t1;# Set nulls to be equal:set myisam_stats_method=nulls_equal;show variables like 'myisam_stats_method';insert into t1 values (11);delete from t1 where a=11;analyze table t1; show index from t1;insert into t1 values (11);delete from t1 where a=11;check table t1;show index from t1;# Set nulls back to be equal set myisam_stats_method=DEFAULT;show variables like 'myisam_stats_method';insert into t1 values (11);delete from t1 where a=11;analyze table t1; show index from t1;insert into t1 values (11);delete from t1 where a=11;check table t1;show index from t1;drop table t1;# WL#2609, CSC#XXXX: MyISAM set myisam_stats_method=nulls_ignored;show variables like 'myisam_stats_method';create table t1 (  a char(3), b char(4), c char(5), d char(6),  key(a,b,c,d));insert into t1 values ('bcd','def1', NULL, 'zz');insert into t1 values ('bcd','def2', NULL, 'zz');insert into t1 values ('bce','def1', 'yuu', NULL);insert into t1 values ('bce','def2', NULL, 'quux');analyze table t1;show index from t1;delete from t1;analyze table t1;show index from t1;set myisam_stats_method=DEFAULT;drop table t1;# BUG#13814 - key value packed incorrectly for TINYBLOBscreate table t1(  cip INT NOT NULL,  time TIME NOT NULL,  score INT NOT NULL DEFAULT 0,  bob TINYBLOB);insert into t1 (cip, time) VALUES (1, '00:01'), (2, '00:02'), (3,'00:03');insert into t1 (cip, bob, time) VALUES (4, 'a', '00:04'), (5, 'b', '00:05'),                                        (6, 'c', '00:06');select * from t1 where bob is null and cip=1;create index bug on t1 (bob(22), cip, time);select * from t1 where bob is null and cip=1;drop table t1;## Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX#create table t1 (  id1 int not null auto_increment,  id2 int not null default '0',  t text not null,  primary key  (id1),  key x (id2, t(32))) engine=myisam;insert into t1 (id2, t) values(10, 'abc'), (10, 'abc'), (10, 'abc'),(20, 'abc'), (20, 'abc'), (20, 'def'),(10, 'abc'), (10, 'abc');select count(*)   from t1 where id2 = 10;select count(id1) from t1 where id2 = 10;drop table t1;## BUG##20357 - Got error 124 from storage engine using MIN and MAX functions#              in queries#CREATE TABLE t1(a TINYINT, KEY(a)) ENGINE=MyISAM;INSERT INTO t1 VALUES(1);SELECT MAX(a) FROM t1 IGNORE INDEX(a);ALTER TABLE t1 DISABLE KEYS;SELECT MAX(a) FROM t1;SELECT MAX(a) FROM t1 IGNORE INDEX(a);DROP TABLE t1;## BUG#18036 - update of table joined to self reports table as crashed#CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';SELECT * FROM t1;DROP TABLE t1;## Bug#8283 - OPTIMIZE TABLE causes data loss#SET @@myisam_repair_threads=2;SHOW VARIABLES LIKE 'myisam_repair%';## Test OPTIMIZE. This creates a new data file.CREATE TABLE t1 (  `_id` int(11) NOT NULL default '0',  `url` text,  `email` text,  `description` text,  `loverlap` int(11) default NULL,  `roverlap` int(11) default NULL,  `lneighbor_id` int(11) default NULL,  `rneighbor_id` int(11) default NULL,  `length_` int(11) default NULL,  `sequence` mediumtext,  `name` text,  `_obj_class` text NOT NULL,  PRIMARY KEY  (`_id`),  UNIQUE KEY `sequence_name_index` (`name`(50)),  KEY (`length_`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;#INSERT INTO t1 VALUES  (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),  (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),  (3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),  (4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),  (5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),  (6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),  (7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),  (8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),  (9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');#SELECT _id FROM t1;DELETE FROM t1 WHERE _id < 8;--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #SHOW TABLE STATUS LIKE 't1';CHECK TABLE t1 EXTENDED;OPTIMIZE TABLE t1;CHECK TABLE t1 EXTENDED;--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #SHOW TABLE STATUS LIKE 't1';SELECT _id FROM t1;DROP TABLE t1;## Test REPAIR QUICK. This retains the old data file.CREATE TABLE t1 (  `_id` int(11) NOT NULL default '0',  `url` text,  `email` text,  `description` text,  `loverlap` int(11) default NULL,  `roverlap` int(11) default NULL,  `lneighbor_id` int(11) default NULL,  `rneighbor_id` int(11) default NULL,  `length_` int(11) default NULL,  `sequence` mediumtext,  `name` text,  `_obj_class` text NOT NULL,  PRIMARY KEY  (`_id`),  UNIQUE KEY `sequence_name_index` (`name`(50)),  KEY (`length_`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;#INSERT INTO t1 VALUES  (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),  (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),  (3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),  (4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),  (5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),  (6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),  (7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),  (8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),  (9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');#SELECT _id FROM t1;DELETE FROM t1 WHERE _id < 8;--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #SHOW TABLE STATUS LIKE 't1';CHECK TABLE t1 EXTENDED;REPAIR TABLE t1 QUICK;CHECK TABLE t1 EXTENDED;--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #SHOW TABLE STATUS LIKE 't1';SELECT _id FROM t1;DROP TABLE t1;#SET @@myisam_repair_threads=1;SHOW VARIABLES LIKE 'myisam_repair%';## BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage#             engine## A simplified test case that reflect crashed table issue.CREATE TABLE t1(a VARCHAR(16));INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';SELECT * FROM t1;DROP TABLE t1;# A test case that reflect wrong result set.CREATE TABLE t1(a INT);INSERT INTO t1 VALUES(1),(2);UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;SELECT * FROM t1 ORDER BY a;DROP TABLE t1;## Bug#24607 - MyISAM pointer size determined incorrectly#CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;--replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 XSHOW TABLE STATUS LIKE 't1';DROP TABLE t1;

⌨️ 快捷键说明

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