mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
95e772b656
BitKeeper/etc/logging_ok: auto-union client/mysqldump.c: Auto merged include/Makefile.am: Auto merged include/my_base.h: Auto merged include/my_sys.h: Auto merged include/sslopt-case.h: Auto merged libmysql/libmysql.c: Auto merged libmysql/libmysql.def: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/ft_boolean_search.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_create.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/type_set.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/myisam.test: Auto merged sql/Makefile.am: Auto merged sql/filesort.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/net_pkg.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/share/english/errmsg.txt: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/sql_union.cc: Auto merged sql/unireg.h: Auto merged sql/sql_cache.cc: Code cleanup (removed ifdef)
116 lines
4.4 KiB
Text
116 lines
4.4 KiB
Text
#
|
|
# Test bugs in the MyISAM code
|
|
#
|
|
|
|
drop table if exists t1;
|
|
CREATE TABLE t1 (
|
|
STRING_DATA char(255) default NULL,
|
|
K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GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG');
|
|
INSERT INTO t1 VALUES ('HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH');
|
|
INSERT INTO t1 VALUES ('WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW');
|
|
CHECK TABLE t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test problem with rows that are 65517-65520 bytes long
|
|
#
|
|
|
|
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a));
|
|
|
|
let $1=100;
|
|
disable_query_log;
|
|
while ($1)
|
|
{
|
|
eval insert into t1 (b) values(repeat(char(65+$1),65550-$1));
|
|
dec $1;
|
|
}
|
|
enable_query_log;
|
|
check table t1;
|
|
repair table t1;
|
|
delete from t1 where (a & 1);
|
|
check table t1;
|
|
repair table t1;
|
|
check table t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test bug: Two optimize in a row reset index cardinality
|
|
#
|
|
|
|
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
|
|
insert into t1 (b) values (1),(2),(2),(2),(2);
|
|
optimize table t1;
|
|
show index from t1;
|
|
optimize table t1;
|
|
show index from t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test of how ORDER BY works when doing it on the whole table
|
|
#
|
|
|
|
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=myisam;
|
|
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
|
|
explain select * from t1 order by a;
|
|
explain select * from t1 order by b;
|
|
explain select * from t1 order by c;
|
|
explain select a from t1 order by a;
|
|
explain select b from t1 order by b;
|
|
explain select a,b from t1 order by b;
|
|
explain select a,b from t1;
|
|
explain select a,b,c from t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test of REPAIR that once failed
|
|
#
|
|
CREATE TABLE `t1` (
|
|
`post_id` mediumint(8) unsigned NOT NULL auto_increment,
|
|
`topic_id` mediumint(8) unsigned NOT NULL default '0',
|
|
`post_time` datetime NOT NULL default '0000-00-00 00:00:00',
|
|
`post_text` text NOT NULL,
|
|
`icon_url` varchar(10) NOT NULL default '',
|
|
`sign` tinyint(1) unsigned NOT NULL default '0',
|
|
`post_edit` varchar(150) NOT NULL default '',
|
|
`poster_login` varchar(35) NOT NULL default '',
|
|
`ip` varchar(15) NOT NULL default '',
|
|
PRIMARY KEY (`post_id`),
|
|
KEY `post_time` (`post_time`),
|
|
KEY `ip` (`ip`),
|
|
KEY `poster_login` (`poster_login`),
|
|
KEY `topic_id` (`topic_id`),
|
|
FULLTEXT KEY `post_text` (`post_text`)
|
|
) TYPE=MyISAM;
|
|
|
|
INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
|
|
|
|
REPAIR TABLE t1;
|
|
CHECK TABLE t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test of OPTIMIZE of locked and modified tables
|
|
#
|
|
CREATE TABLE t1 (a INT);
|
|
INSERT INTO t1 VALUES (1), (2), (3);
|
|
LOCK TABLES t1 WRITE;
|
|
INSERT INTO t1 VALUES (1), (2), (3);
|
|
OPTIMIZE TABLE t1;
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Test of creating table with too long key
|
|
#
|
|
|
|
--error 1071
|
|
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c));
|
|
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
|
|
--error 1071
|
|
ALTER TABLE t1 ADD INDEX t1 (a, b, c);
|
|
DROP TABLE t1;
|