summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-02-21 01:58:50 +0200
committerMichael Widenius <monty@askmonty.org>2012-02-21 01:58:50 +0200
commit5e748392a804d7a6c519ac6943f8a143c269c77c (patch)
treea1e008c4e92b63efa9cea54ed5ab837fa2b7e229 /mysql-test
parent1f56feb28523167875c3c8c35b8c5a4d3004d514 (diff)
parent4c39c0614213d6002b1e19230af4907bff3bf055 (diff)
downloadmariadb-git-5e748392a804d7a6c519ac6943f8a143c269c77c.tar.gz
Merge with MariaDB 5.2
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_cases.pm7
-rwxr-xr-xmysql-test/mysql-test-run.pl19
-rw-r--r--mysql-test/r/archive.result19
-rw-r--r--mysql-test/r/key_cache.result16
-rw-r--r--mysql-test/r/mysqlcheck.result1
-rw-r--r--mysql-test/r/range.result15
-rw-r--r--mysql-test/r/range_mrr_icp.result15
-rw-r--r--mysql-test/suite/innodb/r/innodb.result5
-rw-r--r--mysql-test/suite/innodb/t/innodb.test11
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb.result11
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb.test11
-rw-r--r--mysql-test/suite/maria/suite.pm2
-rw-r--r--mysql-test/t/archive.test14
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/key_cache.test16
-rw-r--r--mysql-test/t/merge.test10
-rw-r--r--mysql-test/t/mysqlcheck.test1
-rw-r--r--mysql-test/t/range.test15
18 files changed, 177 insertions, 12 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 6acbe623e22..a4c37c69d4c 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -931,6 +931,13 @@ sub collect_one_test_case {
$tinfo->{'long_test'}= 1;
}
+ if ( ! $tinfo->{'big_test'} and $::opt_big_test > 1 )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Small test";
+ return $tinfo
+ }
+
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{
$tinfo->{'skip'}= 1;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index a8edcc6b8ec..c4d22dba60a 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -990,7 +990,7 @@ sub command_line_setup {
'skip-test=s' => \&collect_option,
'do-test=s' => \&collect_option,
'start-from=s' => \&collect_option,
- 'big-test' => \$opt_big_test,
+ 'big-test+' => \$opt_big_test,
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \@opt_experimentals,
@@ -1761,8 +1761,11 @@ sub collect_mysqld_features {
# Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{
- # print "$1=\"$2\"\n";
- $mysqld_variables{$1}= $2;
+ my $name= $1;
+ my $value=$2;
+ $name =~ s/_/-/g;
+ # print "$name=\"$value\"\n";
+ $mysqld_variables{$name}= $value;
}
else
{
@@ -1816,8 +1819,11 @@ sub collect_mysqld_features_from_running_server ()
# Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{
- # print "$1=\"$2\"\n";
- $mysqld_variables{$1}= $2;
+ my $name= $1;
+ my $value=$2;
+ $name =~ s/_/-/g;
+ # print "$name=\"$value\"\n";
+ $mysqld_variables{$name}= $value;
}
}
@@ -6007,7 +6013,8 @@ Options to control what test suites or cases to run
list of suite names.
The default is: "$DEFAULT_SUITES"
skip-rpl Skip the replication test cases.
- big-test Also run tests marked as "big"
+ big-test Also run tests marked as "big". Repeat this option
+ twice to run only "big" tests.
staging-run Run a limited number of tests (no slow tests). Used
for running staging trees with valgrind.
enable-disabled Run also tests marked as disabled
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 347635abb82..0ec84efa842 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12782,3 +12782,22 @@ a b c d e f
-1 b c d e 1
DROP TABLE t1;
SET sort_buffer_size=DEFAULT;
+#
+# BUG#11758979 - 51252: ARCHIVE TABLES CAUSE 100% CPU USAGE
+# AND HANG IN SHOW TABLE STATUS
+# (to be executed with valgrind)
+CREATE TABLE t1(a BLOB, b VARCHAR(200)) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(NULL, '');
+FLUSH TABLE t1;
+# we need this select to workaround BUG#11764364
+SELECT * FROM t1;
+a b
+NULL
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 286155052
+FLUSH TABLE t1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index 7b3ded8d050..4a7589c3446 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -367,6 +367,22 @@ Variable_name Value
key_cache_block_size 1536
SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size;
DROP TABLE t1;
+#
+# Bug#12361113: crash when load index into cache
+#
+# Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1, 1);
+CACHE INDEX t1 in key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+# The bug crashed the server at LOAD INDEX below. Now it will succeed
+# since the default cache is used due to CACHE INDEX failed for
+# key_cache_none.
+LOAD INDEX INTO CACHE t1;
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+DROP TABLE t1;
set global key_buffer_size=@save_key_buffer_size;
set global key_cache_block_size=@save_key_cache_block_size;
select @@key_buffer_size;
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 8aa121f9854..c3139f4d5ca 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -140,6 +140,7 @@ CREATE TABLE `я` (a INT);
SET NAMES DEFAULT;
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
mysqlcheck --default-character-set="latin1" --databases test
+call mtr.add_suppression("Can't find file: '..test.@003f.frm'");
test.?
Error : Table doesn't exist
status : Operation failed
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 09da355be1c..32dfaf417c0 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1769,6 +1769,21 @@ SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
pk i4 pk i4
DROP TABLE t1;
End of 5.1 tests
+#
+# LP Bug #533117: Wrong use_count in SEL_ARG trees
+# (Bug #58731)
+#
+create table t1 (a int, b int, c int, key idx (a,b,c));
+insert into t1 values (0,0,0), (2,2,0), (1,1,1), (2,2,1);
+explain
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx idx 5 NULL 3 Using where; Using index
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+a b c
+2 2 0
+2 2 1
+drop table t1;
create table t1 (f1 datetime, key (f1));
insert into t1 values ('2000-03-09 15:56:59'),('2000-05-05 23:24:28'),('2000-06-13 13:12:06');
select min(f1) from t1 where f1 >= '2006-05-25 07:00:20' and f1 between '2003-11-23 10:00:09' and '2010-01-01 01:01:01' and f1 > '2001-01-01 01:01:01';
diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result
index cb9ea051ae0..4e1eb416a2c 100644
--- a/mysql-test/r/range_mrr_icp.result
+++ b/mysql-test/r/range_mrr_icp.result
@@ -1771,6 +1771,21 @@ SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
pk i4 pk i4
DROP TABLE t1;
End of 5.1 tests
+#
+# LP Bug #533117: Wrong use_count in SEL_ARG trees
+# (Bug #58731)
+#
+create table t1 (a int, b int, c int, key idx (a,b,c));
+insert into t1 values (0,0,0), (2,2,0), (1,1,1), (2,2,1);
+explain
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx idx 5 NULL 3 Using where; Using index
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+a b c
+2 2 0
+2 2 1
+drop table t1;
create table t1 (f1 datetime, key (f1));
insert into t1 values ('2000-03-09 15:56:59'),('2000-05-05 23:24:28'),('2000-06-13 13:12:06');
select min(f1) from t1 where f1 >= '2006-05-25 07:00:20' and f1 between '2003-11-23 10:00:09' and '2010-01-01 01:01:01' and f1 > '2001-01-01 01:01:01';
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 80ff21230fb..94644ddffbe 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2371,3 +2371,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
set storage_engine=MyISAM;
+Variable_name Value
+Handler_read_key 0
+f1
+Variable_name Value
+Handler_read_key 0
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 72893f562c1..5df7347c552 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -1394,6 +1394,17 @@ eval set storage_engine=$default;
-- disable_query_log
SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
+#
+# Test fix for bug 13117023. InnoDB increments HA_READ_KEY_COUNT (aka
+# HANDLER_READ_KEY) when it should not.
+#
+create table t1 (f1 integer primary key) engine=innodb;
+flush status;
+show status like "handler_read_key";
+select f1 from t1;
+show status like "handler_read_key";
+drop table t1;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/innodb_plugin/r/innodb.result b/mysql-test/suite/innodb_plugin/r/innodb.result
index cb2185e7a0e..46e2c3a4896 100644
--- a/mysql-test/suite/innodb_plugin/r/innodb.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb.result
@@ -3259,3 +3259,14 @@ Variable_name Value
Handler_delete 1
set optimizer_switch=default;
DROP TABLE bug58912;
+create table t1 (f1 integer primary key) engine=innodb;
+flush status;
+show status like "handler_read_key";
+Variable_name Value
+Handler_read_key 0
+select f1 from t1;
+f1
+show status like "handler_read_key";
+Variable_name Value
+Handler_read_key 0
+drop table t1;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test
index f5bcf999cd3..8916bdee5a8 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb.test
@@ -2576,6 +2576,17 @@ set optimizer_switch=default;
# Clean up after the Bug#55284/Bug#58912 test case.
DROP TABLE bug58912;
+#
+# Test fix for bug 13117023. InnoDB increments HA_READ_KEY_COUNT (aka
+# HANDLER_READ_KEY) when it should not.
+#
+create table t1 (f1 integer primary key) engine=innodb;
+flush status;
+show status like "handler_read_key";
+select f1 from t1;
+show status like "handler_read_key";
+drop table t1;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/maria/suite.pm b/mysql-test/suite/maria/suite.pm
index e6efcdca829..3176782404b 100644
--- a/mysql-test/suite/maria/suite.pm
+++ b/mysql-test/suite/maria/suite.pm
@@ -2,7 +2,7 @@ package My::Suite::Maria;
@ISA = qw(My::Suite);
-return "Need Aria engine" unless $::mysqld_variables{'aria'} eq "ON";
+return "Need Aria engine" unless $::mysqld_variables{'aria-block-size'} > 0;
bless { };
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 9ecbee1ac9f..6f788fc3cc6 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1713,3 +1713,17 @@ INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6;
SELECT * FROM t1 ORDER BY f LIMIT 1;
DROP TABLE t1;
SET sort_buffer_size=DEFAULT;
+
+--echo #
+--echo # BUG#11758979 - 51252: ARCHIVE TABLES CAUSE 100% CPU USAGE
+--echo # AND HANG IN SHOW TABLE STATUS
+--echo # (to be executed with valgrind)
+CREATE TABLE t1(a BLOB, b VARCHAR(200)) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(NULL, '');
+FLUSH TABLE t1;
+--echo # we need this select to workaround BUG#11764364
+SELECT * FROM t1;
+CHECKSUM TABLE t1 EXTENDED;
+FLUSH TABLE t1;
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 84c981c08c1..d8ef026914d 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -12,4 +12,3 @@
kill : Bug#11748945 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
main.log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
-
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index f415d670bf1..c19509ef945 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -251,6 +251,22 @@ DROP TABLE t1;
# End of 4.1 tests
+--echo #
+--echo # Bug#12361113: crash when load index into cache
+--echo #
+
+--echo # Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1, 1);
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 in key_cache_none;
+--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed
+--echo # since the default cache is used due to CACHE INDEX failed for
+--echo # key_cache_none.
+LOAD INDEX INTO CACHE t1;
+DROP TABLE t1;
+
# End of 5.1 tests
#
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 90386a97fc6..eecf892869f 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1848,9 +1848,13 @@ CREATE TABLE t1(a INT);
--echo # Test reattach merge failure
LOCK TABLES m1 READ;
--echo # Replace 't1' with 't3' table using file operations.
-remove_file $MYSQLD_DATADIR/test/t1.frm;
-remove_file $MYSQLD_DATADIR/test/t1.MYI;
-remove_file $MYSQLD_DATADIR/test/t1.MYD;
+# move + remove is a work around for windows.
+move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm;
+move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI;
+move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD;
+remove_file $MYSQLD_DATADIR/test/oldt1.frm;
+remove_file $MYSQLD_DATADIR/test/oldt1.MYI;
+remove_file $MYSQLD_DATADIR/test/oldt1.MYD;
copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI;
copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD;
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index ce6e3dc8bf7..fe4745624ce 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -139,6 +139,7 @@ SET NAMES DEFAULT;
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
--echo mysqlcheck --default-character-set="latin1" --databases test
# Error returned depends on platform, replace it with "Table doesn't exist"
+call mtr.add_suppression("Can't find file: '..test.@003f.frm'");
--replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist"
--exec $MYSQL_CHECK --default-character-set="latin1" --databases test
--echo mysqlcheck --default-character-set="utf8" --databases test
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 746d6bad896..e4e26da7031 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1406,6 +1406,20 @@ DROP TABLE t1;
--echo End of 5.1 tests
+--echo #
+--echo # LP Bug #533117: Wrong use_count in SEL_ARG trees
+--echo # (Bug #58731)
+--echo #
+
+create table t1 (a int, b int, c int, key idx (a,b,c));
+insert into t1 values (0,0,0), (2,2,0), (1,1,1), (2,2,1);
+
+explain
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+select * from t1 force index (idx) where a >=1 and c <= 1 and a=b and b > 1;
+
+drop table t1;
+
#
# lp:750117 Bogus warning with aggregate and datetime column
#
@@ -1459,4 +1473,3 @@ SELECT * FROM t1 ignore index(d) WHERE d = 'q' OR d >= 'q' OR (d IN ( 'j' , 's'
SELECT * FROM t1 force index(d) WHERE d = 'q' OR d >= 'q' OR (d IN ( 'j' , 's' , 'i' ) AND ( b = 102 ));
DROP TABLE t1;
-