summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-01-29 17:20:18 +0100
committerunknown <istruewing@chilla.local>2007-01-29 17:20:18 +0100
commitd308799383bdbcaad568c9844b34708462dd74e7 (patch)
tree9ecca7943a964140be08bdfb8a54f9b76b89e592 /mysql-test
parent9403c7ca67535aa2a7610c4887b6e9276f5cb333 (diff)
parentfddf3c397913f3254bd2adf0d1d7ad4cde586355 (diff)
downloadmariadb-git-d308799383bdbcaad568c9844b34708462dd74e7.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into chilla.local:/home/mydev/mysql-4.1-axmrg mysql-test/r/symlink.result: Auto merged mysql-test/t/symlink.test: Auto merged mysql-test/r/myisam.result: Manual merged mysql-test/t/myisam.test: Manual merged
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.pl57
-rw-r--r--mysql-test/r/ctype_hebrew.result11
-rw-r--r--mysql-test/r/ctype_utf8.result24
-rw-r--r--mysql-test/r/delete.result7
-rw-r--r--mysql-test/r/fulltext_left_join.result40
-rw-r--r--mysql-test/r/func_str.result14
-rw-r--r--mysql-test/r/myisam.result1
-rw-r--r--mysql-test/r/mysqldump.result62
-rw-r--r--mysql-test/r/ndb_types.result1
-rw-r--r--mysql-test/r/order_by.result8
-rw-r--r--mysql-test/r/ps.result67
-rw-r--r--mysql-test/r/range.result43
-rw-r--r--mysql-test/r/rpl_locale.result16
-rw-r--r--mysql-test/r/subselect.result13
-rw-r--r--mysql-test/r/symlink.result1
-rw-r--r--mysql-test/r/type_ranges.result6
-rw-r--r--mysql-test/r/type_timestamp.result18
-rw-r--r--mysql-test/r/variables.result57
-rw-r--r--mysql-test/r/windows.result6
-rw-r--r--mysql-test/t/backup.test1
-rw-r--r--mysql-test/t/ctype_hebrew.test16
-rw-r--r--mysql-test/t/ctype_utf8.test20
-rw-r--r--mysql-test/t/delayed.test2
-rw-r--r--mysql-test/t/delete.test10
-rw-r--r--mysql-test/t/distinct.test2
-rw-r--r--mysql-test/t/fulltext_left_join.test41
-rw-r--r--mysql-test/t/func_str.test8
-rw-r--r--mysql-test/t/grant_cache.test14
-rw-r--r--mysql-test/t/innodb.test3
-rw-r--r--mysql-test/t/kill.test5
-rw-r--r--mysql-test/t/myisam.test4
-rw-r--r--mysql-test/t/mysqladmin.test6
-rw-r--r--mysql-test/t/mysqldump.test15
-rw-r--r--mysql-test/t/ndb_types.test10
-rw-r--r--mysql-test/t/order_by.test15
-rw-r--r--mysql-test/t/ps.test77
-rw-r--r--mysql-test/t/query_cache_notembedded.test4
-rw-r--r--mysql-test/t/range.test43
-rw-r--r--mysql-test/t/rpl000015.test4
-rw-r--r--mysql-test/t/rpl000017.test4
-rw-r--r--mysql-test/t/rpl_locale.test22
-rw-r--r--mysql-test/t/rpl_rotate_logs.test4
-rw-r--r--mysql-test/t/subselect.test12
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--mysql-test/t/variables.test44
-rw-r--r--mysql-test/t/windows.test9
48 files changed, 804 insertions, 55 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..436030383e1 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -58,6 +58,7 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff
use File::Path;
use File::Basename;
use File::Copy;
+use File::Temp qw / tempdir /;
use Cwd;
use Getopt::Long;
use Sys::Hostname;
@@ -222,10 +223,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 +406,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 +567,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,
@@ -1030,6 +1043,11 @@ sub command_line_setup () {
my $sockdir = $opt_tmpdir;
$sockdir =~ s|/+$||;
+ # On some operating systems, there is a limit to the length of a
+ # UNIX domain socket's path far below PATH_MAX, so try to avoid long
+ # socket path names.
+ $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 );
+
# Put this into a hash, will be a C struct
$master->[0]=
@@ -1215,14 +1233,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 +2661,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 +3466,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 +4198,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 +4410,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 +4867,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/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index fdf21a50a02..24f29b23e87 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -124,12 +124,34 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` binary(10) default NULL
+ `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` char(10) character set utf8 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
2004-01-19
drop table t1;
+set names utf8;
+set LC_TIME_NAMES='fr_FR';
+create table t1 (s1 char(20) character set latin1);
+insert into t1 values (date_format('2004-02-02','%M'));
+select hex(s1) from t1;
+hex(s1)
+66E97672696572
+drop table t1;
+create table t1 (s1 char(20) character set koi8r);
+set LC_TIME_NAMES='ru_RU';
+insert into t1 values (date_format('2004-02-02','%M'));
+insert into t1 values (date_format('2004-02-02','%b'));
+insert into t1 values (date_format('2004-02-02','%W'));
+insert into t1 values (date_format('2004-02-02','%a'));
+select hex(s1), s1 from t1;
+hex(s1) s1
+E6C5D7D2C1CCD1 ФевралÑ
+E6C5D7 Фев
+F0CFCEC5C4C5CCD8CEC9CB Понедельник
+F0CEC4 Пнд
+drop table t1;
+set LC_TIME_NAMES='en_US';
set names koi8r;
create table t1 (s1 char(1) character set utf8);
insert into t1 values (_koi8r'ÁÂ');
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 7a6af8fd905..a5c22e66569 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -186,4 +186,11 @@ select count(*) from t1;
count(*)
0
drop table t1;
+create table t1(f1 int primary key);
+insert into t1 values (4),(3),(1),(2);
+delete from t1 where (@a:= f1) order by f1 limit 1;
+select @a;
+@a
+1
+drop table t1;
End of 4.1 tests
diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result
index f3dad290525..fdf11c14cc4 100644
--- a/mysql-test/r/fulltext_left_join.result
+++ b/mysql-test/r/fulltext_left_join.result
@@ -50,3 +50,43 @@ venue_id venue_text dt name entity_id
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
NULL a2 2003-05-23 19:30:00 NULL NULL
drop table t1,t2;
+create table t1 (id int not null primary key, d char(200) not null, e char(200));
+insert into t1 values (1, 'aword', null), (2, 'aword', 'bword'), (3, 'bword', null), (4, 'bword', 'aword'), (5, 'aword and bword', null);
+select * from t1 where match(d, e) against ('+aword +bword' in boolean mode);
+id d e
+2 aword bword
+4 bword aword
+5 aword and bword NULL
+create table t2 (m_id int not null, f char(200), key (m_id));
+insert into t2 values (1, 'bword'), (3, 'aword'), (5, '');
+select * from t1 left join t2 on m_id = id where match(d, e, f) against ('+aword +bword' in boolean mode);
+id d e m_id f
+1 aword NULL 1 bword
+2 aword bword NULL NULL
+3 bword NULL 3 aword
+4 bword aword NULL NULL
+5 aword and bword NULL 5
+drop table t1,t2;
+CREATE TABLE t1 (
+id int(10) NOT NULL auto_increment,
+link int(10) default NULL,
+name mediumtext default NULL,
+PRIMARY KEY (id),
+FULLTEXT (name)
+);
+INSERT INTO t1 VALUES (1, 1, 'string');
+INSERT INTO t1 VALUES (2, 0, 'string');
+CREATE TABLE t2 (
+id int(10) NOT NULL auto_increment,
+name mediumtext default NULL,
+PRIMARY KEY (id),
+FULLTEXT (name)
+);
+INSERT INTO t2 VALUES (1, 'string');
+SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance
+FROM t1 LEFT JOIN t2 ON t1.link = t2.id
+WHERE MATCH(t1.name, t2.name) AGAINST('string' IN BOOLEAN MODE);
+id link name relevance
+1 1 string 0
+2 0 string 0
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 2c15e5581e8..af6a4d20cff 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -806,7 +806,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,cast(_latin1'HE' as char charset binary) AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
+Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,cast(_latin1'HE' as char charset binary) AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000),'monty'),'monty') AS `decode(encode(repeat("a",100000),"monty"),"monty")`
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345
@@ -1064,4 +1064,16 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab')
DROP TABLE t1;
+create table t1(f1 varchar(4));
+explain extended select encode(f1,'zxcv') as 'enc' from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select encode(test.t1.f1,'zxcv') AS `enc` from test.t1
+explain extended select decode(f1,'zxcv') as 'enc' from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select decode(test.t1.f1,'zxcv') AS `enc` from test.t1
+drop table t1;
End of 4.1 tests
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 41d2d48f82e..4b17e8c9840 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -944,3 +944,4 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 9 Dynamic X X X 72057594037927935 X X X X X X latin1_swedish_ci X max_rows=4100100100 avg_row_length=70100
DROP TABLE t1;
+End of 4.1 tests
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 721982e11e3..498fee2d037 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1584,4 +1584,66 @@ CREATE TABLE `t1` (
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
+CREATE TABLE `t1` (
+`a b` INT,
+`c"d` INT,
+`e``f` INT,
+PRIMARY KEY (`a b`, `c"d`, `e``f`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+insert into t1 values (0815, 4711, 2006);
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS "t1";
+CREATE TABLE "t1" (
+ "a b" int(11) NOT NULL default '0',
+ "c""d" int(11) NOT NULL default '0',
+ "e`f" int(11) NOT NULL default '0',
+ PRIMARY KEY ("a b","c""d","e`f")
+);
+
+LOCK TABLES "t1" WRITE;
+/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
+INSERT INTO "t1" VALUES (815,4711,2006);
+/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
+UNLOCK TABLES;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a b` int(11) NOT NULL default '0',
+ `c"d` int(11) NOT NULL default '0',
+ `e``f` int(11) NOT NULL default '0',
+ PRIMARY KEY (`a b`,`c"d`,`e``f`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (815,4711,2006);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TABLE `t1`;
End of 4.1 tests
diff --git a/mysql-test/r/ndb_types.result b/mysql-test/r/ndb_types.result
index 5afa9c57e38..6620ddc7c53 100644
--- a/mysql-test/r/ndb_types.result
+++ b/mysql-test/r/ndb_types.result
@@ -70,3 +70,4 @@ select time_stamp>@now from t1;
time_stamp>@now
1
drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 320bb89b62e..ec6032be882 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -847,3 +847,11 @@ num (select num + 2 FROM t1 LIMIT 1)
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
ERROR 42S22: Unknown column 'num' in 'on clause'
DROP TABLE t1;
+CREATE TABLE t1 (a int);
+SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
+val val1
+SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val;
+ERROR 23000: Column 'val' in order clause is ambiguous
+SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
+ERROR 23000: Column 'val' in order clause is ambiguous
+DROP TABLE t1;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 94c51fdc18b..0d6b01f3481 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1035,4 +1035,71 @@ EXECUTE stmt USING @a;
0 0
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+PREPARE st_19182
+FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1";
+EXECUTE st_19182;
+DESC t2;
+Field Type Null Key Default Extra
+j int(11) YES MUL NULL
+i int(11) YES MUL NULL
+DROP TABLE t2;
+EXECUTE st_19182;
+DESC t2;
+Field Type Null Key Default Extra
+j int(11) YES MUL NULL
+i int(11) YES MUL NULL
+DEALLOCATE PREPARE st_19182;
+DROP TABLE t2, t1;
+drop database if exists mysqltest;
+drop table if exists t1, t2;
+create database mysqltest character set utf8;
+prepare stmt1 from "create table mysqltest.t1 (c char(10))";
+prepare stmt2 from "create table mysqltest.t2 select 'test'";
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+show create table mysqltest.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `test` char(4) character set latin1 NOT NULL default ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table mysqltest.t1;
+drop table mysqltest.t2;
+alter database mysqltest character set latin1;
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) character set utf8 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table mysqltest.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `test` char(4) NOT NULL default ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop database mysqltest;
+deallocate prepare stmt1;
+deallocate prepare stmt2;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
+drop table t1;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
+drop table t1;
+deallocate prepare stmt;
End of 4.1 tests.
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index f25d94f8066..2125f237d0e 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -658,4 +658,47 @@ select a from t1 where a > 'x';
a
xx
drop table t1;
+CREATE TABLE t1 (
+OXID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+OXPARENTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT 'oxrootid',
+OXLEFT int NOT NULL DEFAULT '0',
+OXRIGHT int NOT NULL DEFAULT '0',
+OXROOTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+PRIMARY KEY (OXID),
+KEY OXNID (OXID),
+KEY OXLEFT (OXLEFT),
+KEY OXRIGHT (OXRIGHT),
+KEY OXROOTID (OXROOTID)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
+INSERT INTO t1 VALUES
+('d8c4177d09f8b11f5.52725521','oxrootid',1,40,'d8c4177d09f8b11f5.52725521'),
+('d8c4177d151affab2.81582770','d8c4177d09f8b11f5.52725521',2,3,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d206a333d2.74422679','d8c4177d09f8b11f5.52725521',4,5,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d225791924.30714720','d8c4177d09f8b11f5.52725521',6,7,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d2380fc201.39666693','d8c4177d09f8b11f5.52725521',8,9,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d24ccef970.14957924','d8c4177d09f8b11f5.52725521',10,11,
+'d8c4177d09f8b11f5.52725521');
+EXPLAIN
+SELECT s.oxid FROM t1 v, t1 s
+WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE v ref OXLEFT,OXRIGHT,OXROOTID OXROOTID 32 const 5 Using where
+1 SIMPLE s ALL OXLEFT NULL NULL NULL 5 Range checked for each record (index map: 0x4)
+SELECT s.oxid FROM t1 v, t1 s
+WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+oxid
+d8c4177d151affab2.81582770
+d8c4177d206a333d2.74422679
+d8c4177d225791924.30714720
+d8c4177d2380fc201.39666693
+d8c4177d24ccef970.14957924
+DROP TABLE t1;
End of 4.1 tests
diff --git a/mysql-test/r/rpl_locale.result b/mysql-test/r/rpl_locale.result
new file mode 100644
index 00000000000..5de5bab9a0b
--- /dev/null
+++ b/mysql-test/r/rpl_locale.result
@@ -0,0 +1,16 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 (s1 char(10));
+set lc_time_names= 'de_DE';
+insert into t1 values (date_format('2001-01-01','%W'));
+select * from t1;
+s1
+Montag
+select * from t1;
+s1
+Montag
+drop table t1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 89315342f5e..a4ea8e21d61 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -3013,3 +3013,16 @@ t3 CREATE TABLE `t3` (
`a` datetime default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) > 0;
+a
+SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
+a
+1
+2
+EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+DROP TABLE t1;
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index b104ce50a56..bc7d3275754 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -123,3 +123,4 @@ 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/variables.result b/mysql-test/r/variables.result
index 0aa7ea7f83c..14f1eb7d306 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -499,6 +499,63 @@ set names latin1;
select @@have_innodb;
@@have_innodb
#
+*** Various tests with LC_TIME_NAMES
+*** LC_TIME_NAMES: testing case insensitivity
+set @@lc_time_names='ru_ru';
+select @@lc_time_names;
+@@lc_time_names
+ru_RU
+*** LC_TIME_NAMES: testing with a user variable
+set @lc='JA_JP';
+set @@lc_time_names=@lc;
+select @@lc_time_names;
+@@lc_time_names
+ja_JP
+*** LC_TIME_NAMES: testing with string expressions
+set lc_time_names=concat('de','_','DE');
+select @@lc_time_names;
+@@lc_time_names
+de_DE
+set lc_time_names=concat('de','+','DE');
+ERROR HY000: Unknown locale: 'de+DE'
+select @@lc_time_names;
+@@lc_time_names
+de_DE
+LC_TIME_NAMES: testing with numeric expressions
+set @@lc_time_names=1+2;
+select @@lc_time_names;
+@@lc_time_names
+sv_SE
+set @@lc_time_names=1/0;
+ERROR 42000: Incorrect argument type to variable 'lc_time_names'
+select @@lc_time_names;
+@@lc_time_names
+sv_SE
+set lc_time_names=en_US;
+LC_TIME_NAMES: testing NULL and a negative number:
+set lc_time_names=NULL;
+ERROR 42000: Variable 'lc_time_names' can't be set to the value of 'NULL'
+set lc_time_names=-1;
+ERROR HY000: Unknown locale: '-1'
+select @@lc_time_names;
+@@lc_time_names
+en_US
+LC_TIME_NAMES: testing locale with the last ID:
+set lc_time_names=108;
+select @@lc_time_names;
+@@lc_time_names
+zh_HK
+LC_TIME_NAMES: testing a number beyond the valid ID range:
+set lc_time_names=109;
+ERROR HY000: Unknown locale: '109'
+select @@lc_time_names;
+@@lc_time_names
+zh_HK
+LC_TIME_NAMES: testing that 0 is en_US:
+set lc_time_names=0;
+select @@lc_time_names;
+@@lc_time_names
+en_US
set @test = @@query_prealloc_size;
set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
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/backup.test b/mysql-test/t/backup.test
index b6b3ef1c060..0f1881368a9 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -51,5 +51,6 @@ unlock tables;
connection con1;
reap;
drop table t5;
+--system rm $MYSQLTEST_VARDIR/tmp/t?.*
# End of 4.1 tests
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/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index af40121852f..0b3f9ed2400 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -94,6 +94,26 @@ select * from t1;
drop table t1;
#
+# Bug#22646 LC_TIME_NAMES: Assignment to non-UTF8 target fails
+#
+set names utf8;
+set LC_TIME_NAMES='fr_FR';
+create table t1 (s1 char(20) character set latin1);
+insert into t1 values (date_format('2004-02-02','%M'));
+select hex(s1) from t1;
+drop table t1;
+create table t1 (s1 char(20) character set koi8r);
+set LC_TIME_NAMES='ru_RU';
+insert into t1 values (date_format('2004-02-02','%M'));
+insert into t1 values (date_format('2004-02-02','%b'));
+insert into t1 values (date_format('2004-02-02','%W'));
+insert into t1 values (date_format('2004-02-02','%a'));
+select hex(s1), s1 from t1;
+drop table t1;
+set LC_TIME_NAMES='en_US';
+
+
+#
# Bug #2366 Wrong utf8 behaviour when data is truncated
#
set names koi8r;
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index a32eec536ea..961bcc946bf 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -1,3 +1,5 @@
+# delayed works differently in embedded server
+--source include/not_embedded.inc
#
# test of DELAYED insert and timestamps
# (Can't be tested with purify :( )
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 2036b59d810..301b2cdbb99 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -174,4 +174,14 @@ delete from t1 where a is null;
select count(*) from t1;
drop table t1;
+#
+# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
+# non-restricting WHERE is present.
+#
+create table t1(f1 int primary key);
+insert into t1 values (4),(3),(1),(2);
+delete from t1 where (@a:= f1) order by f1 limit 1;
+select @a;
+drop table t1;
+
--echo End of 4.1 tests
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index a057eee8e37..bd46115231e 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -1,3 +1,5 @@
+# test script should specify proper directories for embedded
+--source include/not_embedded.inc
#
# Bug with distinct and INSERT INTO
# Bug with group by and not used fields
diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test
index 3bb1f0b7309..516c006b109 100644
--- a/mysql-test/t/fulltext_left_join.test
+++ b/mysql-test/t/fulltext_left_join.test
@@ -45,4 +45,45 @@ select * from t1 left join t2 on (venue_id = entity_id and match(name) against('
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00';
drop table t1,t2;
+#
+# BUG#14708
+# Inconsistent treatment of NULLs in LEFT JOINed FULLTEXT matching without index
+#
+
+create table t1 (id int not null primary key, d char(200) not null, e char(200));
+insert into t1 values (1, 'aword', null), (2, 'aword', 'bword'), (3, 'bword', null), (4, 'bword', 'aword'), (5, 'aword and bword', null);
+select * from t1 where match(d, e) against ('+aword +bword' in boolean mode);
+create table t2 (m_id int not null, f char(200), key (m_id));
+insert into t2 values (1, 'bword'), (3, 'aword'), (5, '');
+select * from t1 left join t2 on m_id = id where match(d, e, f) against ('+aword +bword' in boolean mode);
+drop table t1,t2;
+
+#
+# BUG#25637: LEFT JOIN with BOOLEAN FULLTEXT loses left table matches
+# (this is actually the same bug as bug #14708)
+#
+
+CREATE TABLE t1 (
+ id int(10) NOT NULL auto_increment,
+ link int(10) default NULL,
+ name mediumtext default NULL,
+ PRIMARY KEY (id),
+ FULLTEXT (name)
+);
+INSERT INTO t1 VALUES (1, 1, 'string');
+INSERT INTO t1 VALUES (2, 0, 'string');
+CREATE TABLE t2 (
+ id int(10) NOT NULL auto_increment,
+ name mediumtext default NULL,
+ PRIMARY KEY (id),
+ FULLTEXT (name)
+);
+INSERT INTO t2 VALUES (1, 'string');
+
+SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance
+ FROM t1 LEFT JOIN t2 ON t1.link = t2.id
+ WHERE MATCH(t1.name, t2.name) AGAINST('string' IN BOOLEAN MODE);
+
+DROP TABLE t1,t2;
+
# End of 4.1 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 3c855a32eed..5897674d1d4 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -713,4 +713,12 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
DROP TABLE t1;
+#
+# Bug#23409: ENCODE() and DECODE() functions aren't printed correctly
+#
+create table t1(f1 varchar(4));
+explain extended select encode(f1,'zxcv') as 'enc' from t1;
+explain extended select decode(f1,'zxcv') as 'enc' from t1;
+drop table t1;
+
--echo End of 4.1 tests
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index 703ad5d8004..7e17a03ec21 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -14,7 +14,7 @@ set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
-connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
show grants for current_user;
show grants;
@@ -29,7 +29,7 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
-connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,master.sock);
+connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2;
# put queries in cache
select * from t1;
@@ -47,7 +47,7 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
show grants for current_user();
show status like "Qcache_queries_in_cache";
@@ -72,12 +72,12 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Don't use '' as user because it will pick Unix login
-connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,master.sock);
+connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser;
show grants for current_user();
# The following queries should be fetched from cache
-connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock);
+connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user2;
select "user2";
select * from t1;
@@ -92,7 +92,7 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should not be fetched from cache
-connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,master.sock);
+connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user3;
select "user3";
--replace_result 127.0.0.1 localhost
@@ -113,7 +113,7 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
+connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user4;
select "user4";
show grants;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 3e53cadf76c..7e594c358f2 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1299,6 +1299,7 @@ drop table test_checksum;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
+--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1005
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
@@ -1309,6 +1310,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1005
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
@@ -1338,6 +1340,7 @@ drop table t2,t1;
set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
+--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1025
rename table t3 to t1;
set foreign_key_checks=1;
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 0abe0a25f44..68c7b55c501 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -495,7 +495,7 @@ insert into t1 values (1),(2),(3),(4),(5),(6);
insert into t2 values (1,1),(2,1);
lock tables t1 read local, t2 read local;
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
-connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
insert into t2 values(2,0);
disconnect root;
connection default;
@@ -882,4 +882,4 @@ CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
SHOW TABLE STATUS LIKE '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 7c016fd7416..3fa03fa910e 100644
--- a/mysql-test/t/mysqladmin.test
+++ b/mysql-test/t/mysqladmin.test
@@ -1,3 +1,5 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
#
# Test "mysqladmin ping"
#
@@ -15,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
@@ -27,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/mysqldump.test b/mysql-test/t/mysqldump.test
index b0df2bb9db2..4a077f1ffa3 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -702,4 +702,19 @@ create table t1 (a int);
--exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
drop table t1;
+#
+# BUG#13926: --order-by-primary fails if PKEY contains quote character
+#
+CREATE TABLE `t1` (
+ `a b` INT,
+ `c"d` INT,
+ `e``f` INT,
+ PRIMARY KEY (`a b`, `c"d`, `e``f`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+insert into t1 values (0815, 4711, 2006);
+
+--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
+--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
+DROP TABLE `t1`;
+
--echo End of 4.1 tests
diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test
index 1ca89447892..7b0b4972248 100644
--- a/mysql-test/t/ndb_types.test
+++ b/mysql-test/t/ndb_types.test
@@ -1,5 +1,5 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
+--source include/have_ndb.inc
+--source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
@@ -48,7 +48,7 @@ CREATE TABLE t1 (
);
set @now = now();
-sleep 1;
+--sleep 1.5
insert into t1
(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
@@ -64,7 +64,7 @@ from t1;
select time_stamp>@now from t1;
set @now = now();
-sleep 1;
+--sleep 1.5
update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
real_double=2.2,utiny=2,ushort=2,umedium=2,ulong=2,ulonglong=2,
@@ -79,4 +79,4 @@ select time_stamp>@now from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index a8024be7032..3c23ea76d99 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -575,4 +575,19 @@ SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1;
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
DROP TABLE t1;
+#
+# Bug #25427: crash when order by expression contains a name
+# that cannot be resolved unambiguously
+#
+
+CREATE TABLE t1 (a int);
+
+SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
+--error 1052
+SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val;
+--error 1052
+SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
+
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index fbeaaa494e0..c963e59110f 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1068,5 +1068,82 @@ EXECUTE stmt USING @a;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# Bug#19182: CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work
+# from stored procedure.
+#
+# The cause of a bug was that cached LEX::create_list was modified,
+# and then together with LEX::key_list was reset.
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+
+PREPARE st_19182
+FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1";
+EXECUTE st_19182;
+DESC t2;
+
+DROP TABLE t2;
+
+# Check that on second execution we don't loose 'j' column and the keys
+# on 'i' and 'j' columns.
+EXECUTE st_19182;
+DESC t2;
+
+DEALLOCATE PREPARE st_19182;
+DROP TABLE t2, t1;
+
+#
+# Bug #22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"
+#
+# Code which implemented CREATE/ALTER TABLE and CREATE DATABASE
+# statement modified HA_CREATE_INFO structure in LEX, making these
+# statements PS/SP-unsafe (their re-execution might have resulted
+# in incorrect results).
+#
+--disable_warnings
+drop database if exists mysqltest;
+drop table if exists t1, t2;
+--enable_warnings
+# CREATE TABLE and CREATE TABLE ... SELECT
+create database mysqltest character set utf8;
+prepare stmt1 from "create table mysqltest.t1 (c char(10))";
+prepare stmt2 from "create table mysqltest.t2 select 'test'";
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+show create table mysqltest.t2;
+drop table mysqltest.t1;
+drop table mysqltest.t2;
+alter database mysqltest character set latin1;
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+show create table mysqltest.t2;
+drop database mysqltest;
+deallocate prepare stmt1;
+deallocate prepare stmt2;
+#
+# CREATE TABLE with DATA DIRECTORY option
+#
+# Protect ourselves from data left in tmp/ by a previos possibly failed
+# test
+--system rm -f $MYSQLTEST_VARDIR/tmp/t1.*
+--disable_query_log
+eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'";
+--enable_query_log
+execute stmt;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show create table t1;
+drop table t1;
+execute stmt;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show create table t1;
+drop table t1;
+deallocate prepare stmt;
+#
--echo End of 4.1 tests.
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index fd4785ffe95..20baf3450e2 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -81,12 +81,12 @@ drop table t1, t2, t3, t11, t21;
#
# do not use QC if tables locked (BUG#12385)
#
-connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
MyISAM;
LOCK TABLE t1 READ LOCAL;
-connect (root2,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (root2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2;
INSERT INTO t1 VALUES (), (), ();
connection root;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 245178d7d4a..16cbcd754f6 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -520,4 +520,47 @@ explain select a from t1 where a > 'x';
select a from t1 where a > 'x';
drop table t1;
+#
+# Bug #24776: assertion abort for 'range checked for each record'
+#
+
+CREATE TABLE t1 (
+ OXID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+ OXPARENTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT 'oxrootid',
+ OXLEFT int NOT NULL DEFAULT '0',
+ OXRIGHT int NOT NULL DEFAULT '0',
+ OXROOTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+ PRIMARY KEY (OXID),
+ KEY OXNID (OXID),
+ KEY OXLEFT (OXLEFT),
+ KEY OXRIGHT (OXRIGHT),
+ KEY OXROOTID (OXROOTID)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
+
+INSERT INTO t1 VALUES
+('d8c4177d09f8b11f5.52725521','oxrootid',1,40,'d8c4177d09f8b11f5.52725521'),
+('d8c4177d151affab2.81582770','d8c4177d09f8b11f5.52725521',2,3,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d206a333d2.74422679','d8c4177d09f8b11f5.52725521',4,5,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d225791924.30714720','d8c4177d09f8b11f5.52725521',6,7,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d2380fc201.39666693','d8c4177d09f8b11f5.52725521',8,9,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d24ccef970.14957924','d8c4177d09f8b11f5.52725521',10,11,
+ 'd8c4177d09f8b11f5.52725521');
+
+EXPLAIN
+SELECT s.oxid FROM t1 v, t1 s
+ WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+ v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+ s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+
+SELECT s.oxid FROM t1 v, t1 s
+ WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+ v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+ s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+
+DROP TABLE t1;
+
--echo End of 4.1 tests
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index 4e329fc87ea..a23a4b0ba5f 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -1,5 +1,5 @@
-connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master;
reset master;
show master status;
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index 7b4e6bf4d3a..ea3aba8fb75 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -1,5 +1,5 @@
-connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master;
reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
diff --git a/mysql-test/t/rpl_locale.test b/mysql-test/t/rpl_locale.test
new file mode 100644
index 00000000000..530a3d77636
--- /dev/null
+++ b/mysql-test/t/rpl_locale.test
@@ -0,0 +1,22 @@
+# Replication of locale variables
+
+source include/master-slave.inc;
+
+#
+# Bug#22645 LC_TIME_NAMES: Statement not replicated
+#
+connection master;
+create table t1 (s1 char(10));
+set lc_time_names= 'de_DE';
+insert into t1 values (date_format('2001-01-01','%W'));
+select * from t1;
+sync_slave_with_master;
+connection slave;
+select * from t1;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 891582a167c..8d751e43958 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -9,11 +9,11 @@
# changes
# - Test creating a duplicate key error and recover from it
-connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--disable_warnings
drop table if exists t1, t2, t3, t4;
--enable_warnings
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
system cat /dev/null > var/slave-data/master.info;
system chmod 000 var/slave-data/master.info;
connection slave;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 804cc2274c9..f816551e51f 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1981,4 +1981,16 @@ SHOW CREATE TABLE t3;
DROP TABLE t1,t2,t3;
+#
+# Bug 24670: subquery witout tables but with a WHERE clause
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+
+SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) > 0;
+SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
+EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
+
+DROP TABLE t1;
# End of 4.1 tests
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 201a2866c4f..23fd779ee13 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -170,4 +170,4 @@ 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/variables.test b/mysql-test/t/variables.test
index 8322c0f84bd..808dc0973d4 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -397,6 +397,50 @@ set names latin1;
select @@have_innodb;
#
+# Tests for lc_time_names
+# Note, when adding new locales, please fix ID accordingly:
+# - to test the last ID (currently 108)
+# - and the next after the last (currently 109)
+#
+--echo *** Various tests with LC_TIME_NAMES
+--echo *** LC_TIME_NAMES: testing case insensitivity
+set @@lc_time_names='ru_ru';
+select @@lc_time_names;
+--echo *** LC_TIME_NAMES: testing with a user variable
+set @lc='JA_JP';
+set @@lc_time_names=@lc;
+select @@lc_time_names;
+--echo *** LC_TIME_NAMES: testing with string expressions
+set lc_time_names=concat('de','_','DE');
+select @@lc_time_names;
+--error 1105
+set lc_time_names=concat('de','+','DE');
+select @@lc_time_names;
+--echo LC_TIME_NAMES: testing with numeric expressions
+set @@lc_time_names=1+2;
+select @@lc_time_names;
+--error 1232
+set @@lc_time_names=1/0;
+select @@lc_time_names;
+set lc_time_names=en_US;
+--echo LC_TIME_NAMES: testing NULL and a negative number:
+--error 1231
+set lc_time_names=NULL;
+--error 1105
+set lc_time_names=-1;
+select @@lc_time_names;
+--echo LC_TIME_NAMES: testing locale with the last ID:
+set lc_time_names=108;
+select @@lc_time_names;
+--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
+--error 1105
+set lc_time_names=109;
+select @@lc_time_names;
+--echo LC_TIME_NAMES: testing that 0 is en_US:
+set lc_time_names=0;
+select @@lc_time_names;
+
+#
# Bug #13334: query_prealloc_size default less than minimum
#
set @test = @@query_prealloc_size;
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