summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authortsmith@siva.hindu.god <>2007-01-18 09:53:30 -0700
committertsmith@siva.hindu.god <>2007-01-18 09:53:30 -0700
commit6fd02a439fd9547d97206e668a56802cf2f5f1a9 (patch)
tree9c084839005e545b4fd1cc5cf22982af85b39f8c /mysql-test
parent2dc96063b4f1075046c432d54a97ecbb645d2c10 (diff)
parentc9a0cccc23b2506cb91a1a03076f48d43cc31cdf (diff)
downloadmariadb-git-6fd02a439fd9547d97206e668a56802cf2f5f1a9.tar.gz
Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/41
into siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/41
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_cases.pl7
-rw-r--r--mysql-test/lib/mtr_process.pl3
-rwxr-xr-xmysql-test/mysql-test-run.pl51
-rw-r--r--mysql-test/r/ctype_hebrew.result11
-rw-r--r--mysql-test/r/myisam.result22
-rw-r--r--mysql-test/r/symlink.result22
-rw-r--r--mysql-test/r/type_ranges.result6
-rw-r--r--mysql-test/r/type_timestamp.result18
-rw-r--r--mysql-test/r/windows.result6
-rw-r--r--mysql-test/t/ctype_hebrew.test16
-rw-r--r--mysql-test/t/kill.test5
-rw-r--r--mysql-test/t/myisam.test37
-rw-r--r--mysql-test/t/mysqladmin.test4
-rw-r--r--mysql-test/t/symlink.test39
-rw-r--r--mysql-test/t/windows.test9
15 files changed, 168 insertions, 88 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 9e943fec9ef..a00d06d2e60 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -288,6 +288,7 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work
$tinfo->{'slave_num'}= 0; # Default, no slave
+ $tinfo->{'master_num'}= 1; # Default, 1 master
if ( defined mtr_match_prefix($tname,"rpl") )
{
if ( $::opt_skip_rpl )
@@ -297,13 +298,8 @@ sub collect_one_test_case($$$$$$$) {
return;
}
-
$tinfo->{'slave_num'}= 1; # Default for rpl* tests, use one slave
- if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' )
- {
- # $tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange
- }
}
if ( defined mtr_match_prefix($tname,"federated") )
@@ -582,6 +578,7 @@ our @tags=
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1],
+ ["include/have_multi_ndb.inc", "master_num", 2],
["require_manager", "require_manager", 1],
);
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index cf0dc0dc6f8..9cf013d4e9d 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -220,7 +220,8 @@ sub spawn_parent_impl {
my $ret_pid= waitpid($pid,0);
if ( $ret_pid != $pid )
{
- mtr_error("$path ($pid) got lost somehow");
+ mtr_error("waitpid($pid, 0) returned $ret_pid " .
+ "when waiting for '$path'");
}
return mtr_process_exit_status($?);
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 5002f778da5..b3a7427c359 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -222,10 +222,12 @@ our $opt_ndbconnectstring_slave;
our $opt_record;
our $opt_report_features;
our $opt_check_testcases;
+our $opt_mark_progress;
our $opt_skip;
our $opt_skip_rpl;
our $max_slave_num= 0;
+our $max_master_num= 0;
our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
@@ -403,6 +405,15 @@ sub main () {
$max_slave_num= $test->{slave_num};
mtr_error("Too many slaves") if $max_slave_num > 3;
}
+
+ # Count max number of masters used by a test case
+ if ( $test->{master_num} > $max_master_num)
+ {
+ $max_master_num= $test->{master_num};
+ mtr_error("Too many masters") if $max_master_num > 2;
+ mtr_error("Too few masters") if $max_master_num < 1;
+ }
+
$use_innodb||= $test->{'innodb_test'};
}
@@ -555,6 +566,7 @@ sub command_line_setup () {
# Test case authoring
'record' => \$opt_record,
'check-testcases' => \$opt_check_testcases,
+ 'mark-progress' => \$opt_mark_progress,
# Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
@@ -1215,14 +1227,28 @@ sub command_line_setup () {
$path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
+
+ if ( $opt_valgrind and $opt_debug )
+ {
+ # When both --valgrind and --debug is selected, send
+ # all output to the trace file, making it possible to
+ # see the exact location where valgrind complains
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
+ $mysqld->{path_myerr}=
+ "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
+ }
+ }
}
sub datadir_list_setup () {
# Make a list of all data_dirs
- @data_dir_lst = (
- $master->[0]->{'path_myddir'},
- $master->[1]->{'path_myddir'});
+ for (my $idx= 0; $idx < $max_master_num; $idx++)
+ {
+ push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
+ }
for (my $idx= 0; $idx < $max_slave_num; $idx++)
{
@@ -2629,8 +2655,10 @@ sub mysql_install_db () {
install_db('master', $master->[0]->{'path_myddir'});
- # FIXME check if testcase really is using second master
- copy_install_db('master', $master->[1]->{'path_myddir'});
+ if ($max_master_num)
+ {
+ copy_install_db('master', $master->[1]->{'path_myddir'});
+ }
# Install the number of slave databses needed
for (my $idx= 0; $idx < $max_slave_num; $idx++)
@@ -3432,11 +3460,10 @@ sub mysqld_arguments ($$$$$) {
if ( $glob_use_embedded_server )
{
$prefix= "--server-arg=";
- } else {
- # We can't pass embedded server --no-defaults
- mtr_add_arg($args, "--no-defaults");
}
+ mtr_add_arg($args, "%s--no-defaults", $prefix);
+
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
@@ -4165,7 +4192,8 @@ sub run_testcase_start_servers($) {
}
- if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} )
+ if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
+ $tinfo->{'master_num'} > 1 )
{
# Test needs cluster, start an extra mysqld connected to cluster
@@ -4376,6 +4404,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+ # Log line number and time for each line in .test file
+ mtr_add_arg($args, "--mark-progress")
+ if $opt_mark_progress;
+
if ($tinfo->{'component_id'} eq 'im')
{
mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
@@ -4829,6 +4861,7 @@ Options for test case authoring
record TESTNAME (Re)genereate the result file for TESTNAME
check-testcases Check testcases for sideeffects
+ mark-progress Log line number and elapsed time to <testname>.progress
Options that pass on options
diff --git a/mysql-test/r/ctype_hebrew.result b/mysql-test/r/ctype_hebrew.result
new file mode 100644
index 00000000000..d938b2e47f3
--- /dev/null
+++ b/mysql-test/r/ctype_hebrew.result
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS t1;
+SET NAMES hebrew;
+CREATE TABLE t1 (a char(1)) DEFAULT CHARSET=hebrew;
+INSERT INTO t1 VALUES (0xFD),(0xFE);
+ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
+SELECT HEX(a) FROM t1;
+HEX(a)
+E2808E
+E2808F
+DROP TABLE t1;
+End of 4.1 tests
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index b34c127595f..0fd14b08a41 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -923,24 +923,4 @@ SET @@myisam_repair_threads=1;
SHOW VARIABLES LIKE 'myisam_repair%';
Variable_name Value
myisam_repair_threads 1
-show create table t1;
-Table Create Table
-t1 CREATE TEMPORARY TABLE `t1` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
-show create table t1;
-Table Create Table
-t1 CREATE TEMPORARY TABLE `t1` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
-create table t1 (a int) engine=myisam select 42 a;
-select * from t1;
-a
-9
-select * from t1;
-a
-99
-select * from t1;
-a
-42
-drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index f6779689133..bc7d3275754 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -102,3 +102,25 @@ t1 CREATE TABLE `t1` (
`i` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+show create table t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
+show create table t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
+create table t1 (a int) engine=myisam select 42 a;
+select * from t1;
+a
+9
+select * from t1;
+a
+99
+select * from t1;
+a
+42
+drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 90207f39417..2e8fa4c26b7 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -54,7 +54,7 @@ ushort smallint(5) unsigned zerofill NULL MUL 00000 #
umedium mediumint(8) unsigned NULL MUL 0 #
ulong int(11) unsigned NULL MUL 0 #
ulonglong bigint(13) unsigned NULL MUL 0 #
-time_stamp timestamp NULL YES CURRENT_TIMESTAMP #
+time_stamp timestamp NULL CURRENT_TIMESTAMP #
date_field date NULL YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@@ -222,7 +222,7 @@ ushort smallint(5) unsigned zerofill NULL 00000 #
umedium mediumint(8) unsigned NULL MUL 0 #
ulong int(11) unsigned NULL MUL 0 #
ulonglong bigint(13) unsigned NULL MUL 0 #
-time_stamp timestamp NULL YES CURRENT_TIMESTAMP #
+time_stamp timestamp NULL CURRENT_TIMESTAMP #
date_field varchar(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@@ -248,7 +248,7 @@ ushort smallint(5) unsigned zerofill NULL 00000 #
umedium mediumint(8) unsigned NULL 0 #
ulong int(11) unsigned NULL 0 #
ulonglong bigint(13) unsigned NULL 0 #
-time_stamp timestamp NULL YES 0000-00-00 00:00:00 #
+time_stamp timestamp NULL 0000-00-00 00:00:00 #
date_field varchar(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index c0396e4640d..4e71d76785a 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -188,9 +188,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES 2003-01-01 00:00:00
+t1 timestamp 2003-01-01 00:00:00
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
SET TIMESTAMP=1000000002;
@@ -212,9 +212,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp CURRENT_TIMESTAMP
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
SET TIMESTAMP=1000000004;
@@ -238,7 +238,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES 2003-01-01 00:00:00
+t1 timestamp 2003-01-01 00:00:00
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp default now() on update now(), t2 datetime);
@@ -263,7 +263,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp CURRENT_TIMESTAMP
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
@@ -289,9 +289,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp CURRENT_TIMESTAMP
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
SET TIMESTAMP=1000000009;
@@ -315,7 +315,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp CURRENT_TIMESTAMP
t2 datetime YES NULL
delete from t1;
insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
index 039c5b1476e..1702fd28c18 100644
--- a/mysql-test/r/windows.result
+++ b/mysql-test/r/windows.result
@@ -6,3 +6,9 @@ use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;
+drop table if exists t1;
+CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM;
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+drop table t1;
diff --git a/mysql-test/t/ctype_hebrew.test b/mysql-test/t/ctype_hebrew.test
new file mode 100644
index 00000000000..f786d05141d
--- /dev/null
+++ b/mysql-test/t/ctype_hebrew.test
@@ -0,0 +1,16 @@
+#
+# BUG #24037: Lossy Hebrew to Unicode conversion
+#
+# Test if LRM and RLM characters are correctly converted to UTF-8
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+SET NAMES hebrew;
+CREATE TABLE t1 (a char(1)) DEFAULT CHARSET=hebrew;
+INSERT INTO t1 VALUES (0xFD),(0xFE);
+ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 50c4239b45e..1cf871d5f9f 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -70,11 +70,14 @@ insert into t2 select id from t1;
create table t3 (kill_id int);
insert into t3 values(connection_id());
+connect (conn2, localhost, root,,);
+connection conn2;
+
+connection conn1;
-- disable_result_log
send select id from t1 where id in (select distinct id from t2);
-- enable_result_log
-connect (conn2, localhost, root,,);
connection conn2;
select ((@id := kill_id) - kill_id) from t3;
-- sleep 1
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 745e3a2e377..082f9c1f844 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -854,40 +854,5 @@ DROP TABLE t1;
#
SET @@myisam_repair_threads=1;
SHOW VARIABLES LIKE 'myisam_repair%';
-# Bug#8706 - temporary table with data directory option fails
-#
-connect (session1,localhost,root,,);
-connect (session2,localhost,root,,);
-
-connection session1;
-disable_query_log;
-eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a;
-enable_query_log;
-# If running test suite with a non standard tmp dir, the "show create table"
-# will print "DATA_DIRECTORY=". Use replace_result to mask it out
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-show create table t1;
-
-connection session2;
-disable_query_log;
-eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a;
-enable_query_log;
-# If running test suite with a non standard tmp dir, the "show create table"
-# will print "DATA_DIRECTORY=". Use replace_result to mask it out
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-show create table t1;
-
-connection default;
-create table t1 (a int) engine=myisam select 42 a;
-
-connection session1;
-select * from t1;
-disconnect session1;
-connection session2;
-select * from t1;
-disconnect session2;
-connection default;
-select * from t1;
-drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test
index cc75c5168e6..3fa03fa910e 100644
--- a/mysql-test/t/mysqladmin.test
+++ b/mysql-test/t/mysqladmin.test
@@ -17,7 +17,7 @@
database=db1
EOF
---replace_regex /\/.*mysqladmin/mysqladmin/
+--replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/
--error 7
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
@@ -29,6 +29,6 @@ EOF
loose-database=db2
EOF
---replace_regex /Warning: .*mysqladmin/Warning: mysqladmin/
+--replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index c0c1db3d553..23fd779ee13 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -133,4 +133,41 @@ enable_query_log;
show create table t1;
drop table t1;
-# End of 4.1 tests
+#
+# Bug#8706 - temporary table with data directory option fails
+#
+connect (session1,localhost,root,,);
+connect (session2,localhost,root,,);
+
+connection session1;
+disable_query_log;
+eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a;
+enable_query_log;
+# If running test suite with a non standard tmp dir, the "show create table"
+# will print "DATA_DIRECTORY=". Use replace_result to mask it out
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+show create table t1;
+
+connection session2;
+disable_query_log;
+eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a;
+enable_query_log;
+# If running test suite with a non standard tmp dir, the "show create table"
+# will print "DATA_DIRECTORY=". Use replace_result to mask it out
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+show create table t1;
+
+connection default;
+create table t1 (a int) engine=myisam select 42 a;
+
+connection session1;
+select * from t1;
+disconnect session1;
+connection session2;
+select * from t1;
+disconnect session2;
+connection default;
+select * from t1;
+drop table t1;
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index d6bcfeb8cb3..b5377a9b9b0 100644
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -17,4 +17,13 @@ use prn;
create table nu (a int);
drop table nu;
+#
+# Bug17489: ailed to put data file in custom directory use "data directory" option
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM;
+drop table t1;
+
# End of 4.1 tests