diff options
Diffstat (limited to 'mysql-test')
22 files changed, 302 insertions, 14 deletions
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index ef7e9f60dd7..6b0493cdb08 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -1,4 +1,5 @@ # Copyright (c) 2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc. +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/include/have_perfschema.inc b/mysql-test/include/have_perfschema.inc index 6b558e07c20..d932ce0f9bd 100644 --- a/mysql-test/include/have_perfschema.inc +++ b/mysql-test/include/have_perfschema.inc @@ -1,4 +1,5 @@ # Copyright (C) 2010 Sun Microsystems, Inc. +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm index 6fc9832ac43..140885b6273 100644 --- a/mysql-test/lib/mtr_match.pm +++ b/mysql-test/lib/mtr_match.pm @@ -1,5 +1,6 @@ # -*- cperl -*- # Copyright (C) 2004-2008 MySQL AB +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2e0ad39ee5f..7ad12dbb0c8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. -# Copyright (c) 2009, 2013, Monty Program Ab +# Copyright (c) 2004, 2014, Oracle and/or its affiliates. +# Copyright (c) 2009, 2014, Monty Program Ab # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -469,7 +469,6 @@ sub main { ); mtr_error("Could not create testcase server port: $!") unless $server; my $server_port = $server->sockport(); - mtr_report("Using server port $server_port"); if ($opt_resfile) { resfile_init("$opt_vardir/mtr-results.txt"); @@ -513,15 +512,17 @@ sub main { # Send Ctrl-C to any children still running kill("INT", keys(%children)); - # Wait for childs to exit - foreach my $pid (keys %children) - { - my $ret_pid= waitpid($pid, 0); - if ($ret_pid != $pid){ - mtr_report("Unknown process $ret_pid exited"); - } - else { - delete $children{$ret_pid}; + if (!IS_WINDOWS) { + # Wait for children to exit + foreach my $pid (keys %children) + { + my $ret_pid= waitpid($pid, 0); + if ($ret_pid != $pid){ + mtr_report("Unknown process $ret_pid exited"); + } + else { + delete $children{$ret_pid}; + } } } diff --git a/mysql-test/purify.supp b/mysql-test/purify.supp index 230dae20140..0bb31d00277 100644 --- a/mysql-test/purify.supp +++ b/mysql-test/purify.supp @@ -1,4 +1,5 @@ # Copyright (C) 2005, 2007 MySQL AB +# Use is subject to license terms # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index a4dfab4bf81..915ace0c1b4 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -618,3 +618,28 @@ DROP TABLE t1, t2, t3; # # End of 5.1 tests # +# +# Bug#17075846 : unquoted file names for variable values are +# accepted but parsed incorrectly +# +SET default_storage_engine=a.myisam; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = .a.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = a.b.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.`MyISAM`; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +set default_storage_engine = "a.MYISAM"; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = 'a.MYISAM'; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = `a.MYISAM`; +ERROR 42000: Unknown storage engine 'a.MYISAM' +CREATE TABLE t1 (s VARCHAR(100)); +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +ERROR 42S22: Unknown column 'INNODB' in 'NEW' +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/blob-update-debug.result b/mysql-test/suite/innodb/r/blob-update-debug.result new file mode 100644 index 00000000000..1360745b7e6 --- /dev/null +++ b/mysql-test/suite/innodb/r/blob-update-debug.result @@ -0,0 +1,15 @@ +# +# Bug#18185930 UPD_NODE_INSERT_BLOB CAUSES BTR_EXTERN_OWNER_FLAG +# ASSERTION +# +create table t1 (f1 int primary key, f2 blob) engine = innodb; +insert into t1 values (1, repeat('*', 50000)); +select f1, substring(f2, 1, 40) from t1; +f1 substring(f2, 1, 40) +1 **************************************** +set debug_dbug = 'd,row_ins_index_entry_timeout'; +update t1 set f1 = 3; +select f1, substring(f2, 1, 40) from t1; +f1 substring(f2, 1, 40) +3 **************************************** +drop table t1; diff --git a/mysql-test/suite/innodb/r/create-index.result b/mysql-test/suite/innodb/r/create-index.result new file mode 100644 index 00000000000..ad358a86329 --- /dev/null +++ b/mysql-test/suite/innodb/r/create-index.result @@ -0,0 +1,9 @@ +# +# Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING +# ASSERTION: FLEN == LEN +# +create table t1 (f1 binary(5)) engine=innodb; +insert into t1 values ('w'), ('w'); +create unique index index_t1 on t1(f1(4)); +ERROR 23000: Duplicate entry 'w' for key 'index_t1' +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index c4504f6d348..6a232cf434e 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -1309,3 +1309,30 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# Bug #14049391 INNODB MISCALCULATES AUTO-INCREMENT +# AFTER CHANGING AUTO_INCREMENT_INCREMEMENT +# +CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=InnoDB; +SET auto_increment_increment = 300; +INSERT INTO t VALUES (NULL), (NULL); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + KEY `i` (`i`) +) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=latin1 +SET auto_increment_increment = 50; +INSERT INTO t VALUES (NULL); +SELECT * FROM t; +i +1 +301 +351 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + KEY `i` (`i`) +) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1 +DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/innodb-update-insert.result b/mysql-test/suite/innodb/r/innodb-update-insert.result new file mode 100644 index 00000000000..cd0fed101ab --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-update-insert.result @@ -0,0 +1,43 @@ +# +# Bug#14668683 ASSERT REC_GET_DELETED_FLAG(REC, PAGE_IS_COMP(PAGE)) +# +create table t1(f1 char(1) primary key, f2 int not null, f3 blob) +engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` char(1) NOT NULL, + `f2` int(11) NOT NULL, + `f3` blob, + PRIMARY KEY (`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a', 0, repeat('b',8102)); +select f1 from t1; +f1 +a +update t1 set f1='A'; +select f1 from t1; +f1 +A +drop table t1; +# +# Another test case +# +create table t1 (f1 char(1), f2 longblob, f3 blob, primary key(f1)) +charset=utf8 engine=innodb; +replace into t1 set f1=0xa3; +Warnings: +Warning 1366 Incorrect string value: '\xA3' for column 'f1' at row 1 +select f1 from t1; +f1 + +update t1 set f1=0x6a; +update t1 set f3=repeat(0xb1,8103); +update t1 set f1=0x4a; +update t1 set f1=0x82; +Warnings: +Warning 1366 Incorrect string value: '\x82' for column 'f1' at row 1 +select f1 from t1; +f1 + +drop table t1; diff --git a/mysql-test/suite/innodb/t/blob-update-debug.test b/mysql-test/suite/innodb/t/blob-update-debug.test new file mode 100644 index 00000000000..948cd749148 --- /dev/null +++ b/mysql-test/suite/innodb/t/blob-update-debug.test @@ -0,0 +1,17 @@ +# This file contains tests involving update operations on blob data type. + +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # Bug#18185930 UPD_NODE_INSERT_BLOB CAUSES BTR_EXTERN_OWNER_FLAG +--echo # ASSERTION +--echo # + +create table t1 (f1 int primary key, f2 blob) engine = innodb; +insert into t1 values (1, repeat('*', 50000)); +select f1, substring(f2, 1, 40) from t1; +set debug_dbug = 'd,row_ins_index_entry_timeout'; +update t1 set f1 = 3; +select f1, substring(f2, 1, 40) from t1; +drop table t1; diff --git a/mysql-test/suite/innodb/t/create-index.test b/mysql-test/suite/innodb/t/create-index.test new file mode 100644 index 00000000000..e1e5b856aca --- /dev/null +++ b/mysql-test/suite/innodb/t/create-index.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING +--echo # ASSERTION: FLEN == LEN +--echo # +create table t1 (f1 binary(5)) engine=innodb; +insert into t1 values ('w'), ('w'); +--error ER_DUP_ENTRY +create unique index index_t1 on t1(f1(4)); +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index 17df8877ad4..fd40b50ebbc 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -1,3 +1,8 @@ +if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier +} + --source include/have_innodb.inc # embedded server ignores 'delayed', so skip this -- source include/not_embedded.inc @@ -666,3 +671,16 @@ SELECT * FROM t1; SHOW CREATE TABLE t1; DROP TABLE t1; +--echo # +--echo # Bug #14049391 INNODB MISCALCULATES AUTO-INCREMENT +--echo # AFTER CHANGING AUTO_INCREMENT_INCREMEMENT +--echo # +CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=InnoDB; +SET auto_increment_increment = 300; +INSERT INTO t VALUES (NULL), (NULL); +SHOW CREATE TABLE t; +SET auto_increment_increment = 50; +INSERT INTO t VALUES (NULL); +SELECT * FROM t; +SHOW CREATE TABLE t; +DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/innodb-update-insert.test b/mysql-test/suite/innodb/t/innodb-update-insert.test new file mode 100644 index 00000000000..95387e0564e --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-update-insert.test @@ -0,0 +1,38 @@ +# +# Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. +# + +# This file contains test cases for checking the functionality "update by +# delete + insert". + +--source include/have_innodb.inc + +--echo # +--echo # Bug#14668683 ASSERT REC_GET_DELETED_FLAG(REC, PAGE_IS_COMP(PAGE)) +--echo # + +create table t1(f1 char(1) primary key, f2 int not null, f3 blob) +engine=innodb; +show create table t1; + +insert into t1 values ('a', 0, repeat('b',8102)); +select f1 from t1; +update t1 set f1='A'; +select f1 from t1; +drop table t1; + +--echo # +--echo # Another test case +--echo # +create table t1 (f1 char(1), f2 longblob, f3 blob, primary key(f1)) +charset=utf8 engine=innodb; + +replace into t1 set f1=0xa3; +select f1 from t1; +update t1 set f1=0x6a; +update t1 set f3=repeat(0xb1,8103); +update t1 set f1=0x4a; +update t1 set f1=0x82; +select f1 from t1; + +drop table t1; diff --git a/mysql-test/suite/perfschema_stress/README b/mysql-test/suite/perfschema_stress/README index d28287f9735..25101f429e5 100644 --- a/mysql-test/suite/perfschema_stress/README +++ b/mysql-test/suite/perfschema_stress/README @@ -1,4 +1,5 @@ # Copyright (c) 2009, 2010 Sun Microsystems, Inc. +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/suite/sys_vars/r/general_log_file_basic.result b/mysql-test/suite/sys_vars/r/general_log_file_basic.result index 0f211c6b321..369ef7844db 100644 --- a/mysql-test/suite/sys_vars/r/general_log_file_basic.result +++ b/mysql-test/suite/sys_vars/r/general_log_file_basic.result @@ -9,6 +9,7 @@ SELECT @@global.general_log_file; mysqld.log '#--------------------FN_DYNVARS_004_02------------------------#' SET @@global.general_log_file = mytest.log; +ERROR 42000: Incorrect argument type to variable 'general_log_file' SET @@global.general_log_file = 12; ERROR 42000: Incorrect argument type to variable 'general_log_file' '#----------------------FN_DYNVARS_004_03------------------------#' diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result index fb7093ec3b3..0335db8e859 100644 --- a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result @@ -41,6 +41,8 @@ set global innodb_thread_sleep_delay=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' set global innodb_thread_sleep_delay="foo"; ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' +set global innodb_thread_sleep_delay=18446744073709551616; +ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' set global innodb_thread_sleep_delay=-7; Warnings: Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7' @@ -50,6 +52,34 @@ select @@global.innodb_thread_sleep_delay; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; VARIABLE_NAME VARIABLE_VALUE INNODB_THREAD_SLEEP_DELAY 0 +set global innodb_thread_sleep_delay=0; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +0 +set global innodb_thread_sleep_delay=1000; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000 +set global innodb_thread_sleep_delay=1000000; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=1000001; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '1000001' +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=4294967295; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '4294967295' +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=555; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +555 SET @@global.innodb_thread_sleep_delay = @start_global_value; SELECT @@global.innodb_thread_sleep_delay; @@global.innodb_thread_sleep_delay diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result index f74c0030465..f45c568ff4a 100644 --- a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result +++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result @@ -6,6 +6,7 @@ SELECT @@global.slow_query_log_file; mysqld-slow.log '#--------------------FN_DYNVARS_004_02------------------------#' SET @@global.slow_query_log_file = mytest.log; +ERROR 42000: Incorrect argument type to variable 'slow_query_log_file' SET @@global.slow_query_log_file = 12; ERROR 42000: Incorrect argument type to variable 'slow_query_log_file' '#----------------------FN_DYNVARS_004_03------------------------#' diff --git a/mysql-test/suite/sys_vars/t/general_log_file_basic.test b/mysql-test/suite/sys_vars/t/general_log_file_basic.test index 3cc1eb80822..12362fa123c 100644 --- a/mysql-test/suite/sys_vars/t/general_log_file_basic.test +++ b/mysql-test/suite/sys_vars/t/general_log_file_basic.test @@ -53,7 +53,7 @@ SELECT @@global.general_log_file; # Change the value of general_log_file to a invalid value # ####################################################################### -# Assumed text if no quotes or numbers. +--error ER_WRONG_TYPE_FOR_VAR SET @@global.general_log_file = mytest.log; --error ER_WRONG_TYPE_FOR_VAR SET @@global.general_log_file = 12; diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test index 7156f309a64..782fb475140 100644 --- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test @@ -1,3 +1,7 @@ +if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier +} # # 2010-01-27 - Added @@ -40,12 +44,30 @@ set global innodb_thread_sleep_delay=1.1; set global innodb_thread_sleep_delay=1e1; --error ER_WRONG_TYPE_FOR_VAR set global innodb_thread_sleep_delay="foo"; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_thread_sleep_delay=18446744073709551616; set global innodb_thread_sleep_delay=-7; select @@global.innodb_thread_sleep_delay; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; # +# correct/overflowed values +# +set global innodb_thread_sleep_delay=0; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000000; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000001; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=4294967295; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=555; +select @@global.innodb_thread_sleep_delay; + +# # cleanup # SET @@global.innodb_thread_sleep_delay = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test index cea0baa3cfc..28fc17f6077 100644 --- a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test +++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test @@ -51,7 +51,7 @@ SELECT @@global.slow_query_log_file; # Change the value of slow_query_log_file to a invalid value # ####################################################################### -# Assumed text if no quotes or numbers. +--error ER_WRONG_TYPE_FOR_VAR SET @@global.slow_query_log_file = mytest.log; --error ER_WRONG_TYPE_FOR_VAR SET @@global.slow_query_log_file = 12; diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index d477843b22b..6899e2876a6 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -733,3 +733,28 @@ DROP TABLE t1, t2, t3; --echo # End of 5.1 tests --echo # +--echo # +--echo # Bug#17075846 : unquoted file names for variable values are +--echo # accepted but parsed incorrectly +--echo # +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine=a.myisam; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = .a.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = a.b.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.`MyISAM`; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = "a.MYISAM"; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = 'a.MYISAM'; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = `a.MYISAM`; +CREATE TABLE t1 (s VARCHAR(100)); +--ERROR ER_BAD_FIELD_ERROR +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +DROP TABLE t1; |