Commit d40f7056 authored by unknown's avatar unknown

Make it possible to run mysql-test-run.pl with default test suite in different vardir.


mysql-test/include/have_outfile.inc:
  Use MYSQLTEST_VARDIR
mysql-test/include/test_outfile.inc:
  Use MYSQLTEST_VARDIR
mysql-test/mysql-test-run.pl:
  Create variable $MYSQLTEST_VARDIR that points to  the vardir
  Don't create a symlink from var/ to the physical vardir if it's somewhere else
  Setup a symlink(or copy dir on windows) for std_data so it is available in the physical vardir
  Use "../tmp" as slave-load-tmpdir, since the server is started in var/master-data and slave in var/slave-data they will both find the dumps in "../tmp"
mysql-test/mysql-test-run.sh:
  Export MYSQLTEST_VARDIR, always pointing at mysql-test/var
mysql-test/r/backup.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/blackhole.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/loaddata.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/mysqlbinlog.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/mysqltest.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/outfile.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/query_cache.result:
  Add missing drop function
mysql-test/r/rpl000001.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl000004.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_innodb.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata_rule_m.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata_rule_s.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddatalocal.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/rpl_log.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_misc_functions.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/rpl_replicate_do.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_rewrite_db.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_timezone.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/symlink.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/trigger.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/view.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/warnings.result:
  Use "../std_data_ln" to find std_data files
mysql-test/t/backup-master.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/backup.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/blackhole.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/ctype_ucs_binlog.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_daemon_life_cycle-im.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_options_set.imtest:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_options_unset.imtest:
  Use MYSQLTEST_VARDIR
mysql-test/t/loaddata.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/myisam.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqlbinlog.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/mysqlbinlog2.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqldump.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqltest.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/ndb_autodiscover.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/outfile.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/query_cache.test:
  Add missing drop function
mysql-test/t/repair.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000001.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl000004.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl000009.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000015-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000017-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_EE_error.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_charset.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_drop_db.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-master.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-master.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-slave.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_innodb.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata_rule_m.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata_rule_s.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddatalocal.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_log.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_misc_functions-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_misc_functions.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_replicate_do.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_rewrite_db.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_rotate_logs-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_rotate_logs.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_timezone.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/show_check.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/sp-destruct.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/symlink.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/temp_table-master.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger-compat.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger-grant.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/type_varchar.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/user_var-binlog.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/view.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/warnings.test:
  Use "../std_data_ln" to find std_data files
mysql-test/include/sourced.inc:
  New BitKeeper file ``mysql-test/include/sourced.inc''
mysql-test/include/sourced1.inc:
  New BitKeeper file ``mysql-test/include/sourced1.inc''
parent b9e1c443
-- require r/have_outfile.require -- require r/have_outfile.require
disable_query_log; disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test")); select load_file(concat(@tmpdir,"/outfile.test"));
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile.test --exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log; enable_query_log;
echo here is the sourced script;
--source include/sourced.inc
eval select "Outfile OK" into outfile "$MYSQL_TEST_DIR/var/tmp/outfile.test"; eval select "Outfile OK" into outfile "$MYSQLTEST_VARDIR/tmp/outfile.test";
...@@ -76,6 +76,7 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff ...@@ -76,6 +76,7 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff
#require 5.6.1; #require 5.6.1;
use File::Path; use File::Path;
use File::Basename; use File::Basename;
use File::Copy;
use Cwd; use Cwd;
use Getopt::Long; use Getopt::Long;
use Sys::Hostname; use Sys::Hostname;
...@@ -152,7 +153,6 @@ our $path_client_bindir; ...@@ -152,7 +153,6 @@ our $path_client_bindir;
our $path_language; our $path_language;
our $path_timefile; our $path_timefile;
our $path_manager_log; # Used by mysqldadmin our $path_manager_log; # Used by mysqldadmin
our $path_slave_load_tmpdir; # What is this?!
our $path_my_basedir; our $path_my_basedir;
our $opt_vardir; # A path but set directly on cmd line our $opt_vardir; # A path but set directly on cmd line
our $opt_tmpdir; # A path but set directly on cmd line our $opt_tmpdir; # A path but set directly on cmd line
...@@ -462,9 +462,6 @@ sub initial_setup () { ...@@ -462,9 +462,6 @@ sub initial_setup () {
$glob_basedir= dirname($glob_mysql_test_dir); $glob_basedir= dirname($glob_mysql_test_dir);
$glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable
# needs to be same length to test logging (FIXME what???)
$path_slave_load_tmpdir= "../../var/tmp";
$path_my_basedir= $path_my_basedir=
$opt_source_dist ? $glob_mysql_test_dir : $glob_basedir; $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir;
...@@ -1066,6 +1063,7 @@ sub environment_setup () { ...@@ -1066,6 +1063,7 @@ sub environment_setup () {
$ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server;
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
$ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir; $ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
$ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'};
...@@ -1163,10 +1161,40 @@ sub kill_and_cleanup () { ...@@ -1163,10 +1161,40 @@ sub kill_and_cleanup () {
mtr_report("Removing Stale Files"); mtr_report("Removing Stale Files");
rmtree("$opt_vardir/log"); if ( $opt_vardir eq "$glob_mysql_test_dir/var" )
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port"); {
rmtree("$opt_vardir/run"); #
rmtree("$opt_vardir/tmp"); # Running with "var" in mysql-test dir
#
if ( -l "$glob_mysql_test_dir/var" )
{
# Some users creates a soft link in mysql-test/var to another area
# - allow it
mtr_report("WARNING: Using the 'mysql-test/var' symlink");
rmtree("$opt_vardir/log");
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port");
rmtree("$opt_vardir/run");
rmtree("$opt_vardir/tmp");
}
else
{
# Remove the entire "var" dir
rmtree("$opt_vardir/");
}
}
else
{
#
# Running with "var" in some other place
#
# Remove the var/ dir in mysql-test dir if any
# this could be an old symlink that shouldn't be there
rmtree("$glob_mysql_test_dir/var");
# Remove the "var" dir
rmtree("$opt_vardir/");
}
mkpath("$opt_vardir/log"); mkpath("$opt_vardir/log");
mkpath("$opt_vardir/run"); mkpath("$opt_vardir/run");
...@@ -1182,7 +1210,7 @@ sub kill_and_cleanup () { ...@@ -1182,7 +1210,7 @@ sub kill_and_cleanup () {
$slave->[0]->{'path_myddir'}, $slave->[0]->{'path_myddir'},
$slave->[1]->{'path_myddir'}, $slave->[1]->{'path_myddir'},
$slave->[2]->{'path_myddir'}); $slave->[2]->{'path_myddir'});
foreach my $instance (@{$instance_manager->{'instances'}}) foreach my $instance (@{$instance_manager->{'instances'}})
{ {
push(@data_dir_lst, $instance->{'path_datadir'}); push(@data_dir_lst, $instance->{'path_datadir'});
...@@ -1195,18 +1223,27 @@ sub kill_and_cleanup () { ...@@ -1195,18 +1223,27 @@ sub kill_and_cleanup () {
mkpath("$data_dir/test"); mkpath("$data_dir/test");
} }
# To make some old test cases work, we create a soft # Make a link std_data_ln in var/ that points to std_data
# link from the old "var" location to the new one if ( ! $glob_win32 )
if ( ! $glob_win32 and $opt_vardir ne "$glob_mysql_test_dir/var" )
{ {
# FIXME why bother with the above, why not always remove all of var?! symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
rmtree("$glob_mysql_test_dir/var"); # Clean old var, FIXME or rename it?! }
symlink($opt_vardir, "$glob_mysql_test_dir/var"); else
{
# on windows, copy all files from std_data into var/std_data_ln
mkpath("$opt_vardir/std_data_ln");
opendir(DIR, "$glob_mysql_test_dir/std_data")
or mtr_error("Can't find the std_data directory: $!");
for(readdir(DIR)) {
next if -d "$glob_mysql_test_dir/std_data/$_";
copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_");
}
closedir(DIR);
} }
} }
sub check_ssl_support () { sub check_ssl_support () {
if ($opt_skip_ssl) if ($opt_skip_ssl)
...@@ -2107,8 +2144,12 @@ sub mysqld_arguments ($$$$$) { ...@@ -2107,8 +2144,12 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--skip-innodb", $prefix); mtr_add_arg($args, "%s--skip-innodb", $prefix);
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
mtr_add_arg($args, "%s--skip-slave-start", $prefix); mtr_add_arg($args, "%s--skip-slave-start", $prefix);
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
$path_slave_load_tmpdir); "../tmp");
mtr_add_arg($args, "%s--socket=%s", $prefix, mtr_add_arg($args, "%s--socket=%s", $prefix,
$slave->[$idx]->{'path_mysock'}); $slave->[$idx]->{'path_mysock'});
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix);
...@@ -2730,7 +2771,7 @@ Options to control what engine/variation to run ...@@ -2730,7 +2771,7 @@ Options to control what engine/variation to run
ps-protocol Use the binary protocol between client and server ps-protocol Use the binary protocol between client and server
compress Use the compressed protocol between client and server compress Use the compressed protocol between client and server
ssl Use ssl protocol between client and server ssl Use ssl protocol between client and server
skip-ssl Dont start sterver with support for ssl connections skip-ssl Dont start server with support for ssl connections
bench Run the benchmark suite FIXME bench Run the benchmark suite FIXME
small-bench FIXME small-bench FIXME
......
...@@ -171,7 +171,8 @@ BASEDIR=`pwd` ...@@ -171,7 +171,8 @@ BASEDIR=`pwd`
cd $CWD cd $CWD
MYSQL_TEST_DIR=$BASEDIR/mysql-test MYSQL_TEST_DIR=$BASEDIR/mysql-test
MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
export MYSQL_TEST_DIR MYSQL_TEST_WINDIR MYSQLTEST_VARDIR=$MYSQL_TEST_DIR/var
export MYSQL_TEST_DIR MYSQL_TEST_WINDIR MYSQLTEST_VARDIR
STD_DATA=$MYSQL_TEST_DIR/std_data STD_DATA=$MYSQL_TEST_DIR/std_data
hostname=`hostname` # Installed in the mysql privilege table hostname=`hostname` # Installed in the mysql privilege table
......
...@@ -6,7 +6,7 @@ Table Op Msg_type Msg_text ...@@ -6,7 +6,7 @@ Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup status Operation failed test.t4 backup status Operation failed
Warnings: Warnings:
Error 1 Can't create/write to file 'MYSQL_TEST_DIR/var/bogus/t4.frm' (Errcode: X) Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
backup table t4 to '../tmp'; backup table t4 to '../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 backup status OK test.t4 backup status OK
...@@ -15,7 +15,7 @@ Table Op Msg_type Msg_text ...@@ -15,7 +15,7 @@ Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup status Operation failed test.t4 backup status Operation failed
Warnings: Warnings:
Error 1 Can't create/write to file 'MYSQL_TEST_DIR/var/tmp/t4.frm' (Errcode: X) Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
drop table t4; drop table t4;
restore table t4 from '../tmp'; restore table t4 from '../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
...@@ -33,7 +33,7 @@ restore table t1 from '../bogus'; ...@@ -33,7 +33,7 @@ restore table t1 from '../bogus';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file t1 restore error Failed copying .frm file
Warnings: Warnings:
Error 29 File 'MYSQL_TEST_DIR/var/bogus/t1.frm' not found (Errcode: X) Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
restore table t1 from '../tmp'; restore table t1 from '../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 restore status OK test.t1 restore status OK
......
...@@ -92,7 +92,7 @@ insert into t1 values(1); ...@@ -92,7 +92,7 @@ insert into t1 values(1);
insert ignore into t1 values(1); insert ignore into t1 values(1);
replace into t1 values(100); replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole; create table t2 (a varchar(200)) engine=blackhole;
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
alter table t1 add b int; alter table t1 add b int;
alter table t1 drop b; alter table t1 drop b;
create table t3 like t1; create table t3 like t1;
...@@ -116,7 +116,7 @@ master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1) ...@@ -116,7 +116,7 @@ master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1)
master-bin.000001 # Query 1 # use `test`; replace into t1 values(100) master-bin.000001 # Query 1 # use `test`; replace into t1 values(100)
master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t2 ;file_id=1 master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
master-bin.000001 # Query 1 # use `test`; alter table t1 add b int master-bin.000001 # Query 1 # use `test`; alter table t1 add b int
master-bin.000001 # Query 1 # use `test`; alter table t1 drop b master-bin.000001 # Query 1 # use `test`; alter table t1 drop b
master-bin.000001 # Query 1 # use `test`; create table t3 like t1 master-bin.000001 # Query 1 # use `test`; create table t3 like t1
......
drop table if exists t1, t2; drop table if exists t1, t2;
create table t1 (a date, b date, c date not null, d date); create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c' at row 1
...@@ -8,7 +8,7 @@ Warning 1265 Data truncated for column 'd' at row 1 ...@@ -8,7 +8,7 @@ Warning 1265 Data truncated for column 'd' at row 1
Warning 1265 Data truncated for column 'a' at row 2 Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2 Warning 1265 Data truncated for column 'd' at row 2
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1; SELECT * from t1;
a b c d a b c d
0000-00-00 NULL 0000-00-00 0000-00-00 0000-00-00 NULL 0000-00-00 0000-00-00
...@@ -16,7 +16,7 @@ a b c d ...@@ -16,7 +16,7 @@ a b c d
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings: Warnings:
Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1 Warning 1265 Data truncated for column 'd' at row 1
...@@ -29,7 +29,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00 ...@@ -29,7 +29,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL NULL 2003-03-03 2003-03-03 NULL
drop table t1; drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings: Warnings:
Warning 1261 Row 3 doesn't contain data for all columns Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from t1;
...@@ -41,7 +41,7 @@ Field 3,'Field 4| ...@@ -41,7 +41,7 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'| |Field 6| | 'Field 7'|
drop table t1; drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings: Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 3 Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns Warning 1262 Row 3 was truncated; it contained more data than there were input columns
...@@ -55,7 +55,7 @@ a b ...@@ -55,7 +55,7 @@ a b
3 row 3 3 row 3
0 1234567890 0 1234567890
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings: Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 4 Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1261 Row 4 doesn't contain data for all columns Warning 1261 Row 4 doesn't contain data for all columns
...@@ -78,7 +78,7 @@ id ...@@ -78,7 +78,7 @@ id
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1; drop table t1;
create table t1 (a varchar(20), b varchar(20)); create table t1 (a varchar(20), b varchar(20));
load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
select * from t1; select * from t1;
a b a b
field1 field2 field1 field2
...@@ -86,25 +86,25 @@ a"b cd"ef ...@@ -86,25 +86,25 @@ a"b cd"ef
a"b c"d"e a"b c"d"e
drop table t1; drop table t1;
create table t1 (a int default 100, b int, c varchar(60)); create table t1 (a int default 100, b int, c varchar(60));
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1; select * from t1;
a b c a b c
NULL 20 b=10 NULL 20 b=10
NULL 25 b=15 NULL 25 b=15
truncate table t1; truncate table t1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
select * from t1; select * from t1;
a b c a b c
NULL NULL oops NULL NULL oops
NULL NULL oops NULL NULL oops
truncate table t1; truncate table t1;
set @c:=123; set @c:=123;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
select * from t1; select * from t1;
a b c a b c
100 10 123 100 10 123
100 15 123 100 15 123
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1; select * from t1;
a b c a b c
100 10 123 100 10 123
...@@ -115,25 +115,25 @@ select @a, @b; ...@@ -115,25 +115,25 @@ select @a, @b;
@a @b @a @b
NULL 15 NULL 15
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1; select * from t1;
a b c a b c
1 2 Wow 1 2 Wow
3 4 Wow 3 4 Wow
5 6 Wow 5 6 Wow
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
select * from t1; select * from t1;
a b c a b c
1 2 1+2+123+2+NIL 1 2 1+2+123+2+NIL
3 4 3+4+123+4+NIL 3 4 3+4+123+4+NIL
5 6 5+6+123+6+NIL 5 6 5+6+123+6+NIL
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
ERROR HY000: Can't load value from file with fixed size rows to variable ERROR HY000: Can't load value from file with fixed size rows to variable
create table t2 (num int primary key, str varchar(10)); create table t2 (num int primary key, str varchar(10));
insert into t2 values (10,'Ten'), (15,'Fifteen'); insert into t2 values (10,'Ten'), (15,'Fifteen');
truncate table t1; truncate table t1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1; select * from t1;
a b c a b c
10 NULL Ten 10 NULL Ten
......
...@@ -4,11 +4,11 @@ create table t1 (word varchar(20)); ...@@ -4,11 +4,11 @@ create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key); create table t2 (id int auto_increment not null primary key);
insert into t1 values ("abirvalg"); insert into t1 values ("abirvalg");
insert into t2 values (); insert into t2 values ();
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
flush logs; flush logs;
...@@ -32,13 +32,13 @@ SET INSERT_ID=1; ...@@ -32,13 +32,13 @@ SET INSERT_ID=1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
insert into t2 values (); insert into t2 values ();
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-1-0' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-2-0' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
...@@ -98,13 +98,13 @@ SET INSERT_ID=1; ...@@ -98,13 +98,13 @@ SET INSERT_ID=1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
insert into t2 values (); insert into t2 values ();
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-1-2' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-2-2' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
......
...@@ -221,8 +221,8 @@ mysqltest: At line 1: Variable name in =hi does not start with '$' ...@@ -221,8 +221,8 @@ mysqltest: At line 1: Variable name in =hi does not start with '$'
mysqltest: At line 1: Missing assignment operator in let mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing file name in source mysqltest: At line 1: Missing file name in source
mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: At line 1: Could not open file ./non_existingFile
mysqltest: In included file "./var/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "./var/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
2 = outer loop variable after while 2 = outer loop variable after while
here is the sourced script here is the sourced script
...@@ -353,9 +353,9 @@ mysqltest: At line 1: Missing connection db ...@@ -353,9 +353,9 @@ mysqltest: At line 1: Missing connection db
mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db' mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db'
mysqltest: At line 1: Illegal argument for port: 'illegal_port' mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP mysqltest: At line 1: Illegal option to connect: SMTP
mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c
mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 2: Connection test_con1 already exists
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
......
...@@ -1074,6 +1074,7 @@ a f1() ...@@ -1074,6 +1074,7 @@ a f1()
1 2 1 2
2 2 2 2
drop procedure p1// drop procedure p1//
drop function f1//
drop table t1// drop table t1//
flush query cache; flush query cache;
reset query cache; reset query cache;
......
...@@ -5,7 +5,7 @@ reset slave; ...@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1; load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10; select * from t1 limit 10;
word word
......
...@@ -6,9 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -6,9 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word)); create table t1 (word char(20) not null, index(word));
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
create table t2 (word char(20) not null); create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
create table t3 (word char(20) not null primary key); create table t3 (word char(20) not null primary key);
load table t1 from master; load table t1 from master;
load table t2 from master; load table t2 from master;
......
...@@ -12,7 +12,7 @@ PRIMARY KEY (id), ...@@ -12,7 +12,7 @@ PRIMARY KEY (id),
UNIQUE KEY unique_rec (name,number) UNIQUE KEY unique_rec (name,number)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
LOAD DATA LOAD DATA
INFILE '../../std_data/loaddata_pair.dat' INFILE '../std_data_ln/loaddata_pair.dat'
REPLACE INTO TABLE t4 REPLACE INTO TABLE t4
(name,number); (name,number);
SELECT * FROM t4; SELECT * FROM t4;
...@@ -24,7 +24,7 @@ id name number ...@@ -24,7 +24,7 @@ id name number
1 XXX 12345 1 XXX 12345
2 XXY 12345 2 XXY 12345
LOAD DATA LOAD DATA
INFILE '../../std_data/loaddata_pair.dat' INFILE '../std_data_ln/loaddata_pair.dat'
REPLACE INTO TABLE t4 REPLACE INTO TABLE t4
(name,number); (name,number);
SELECT * FROM t4; SELECT * FROM t4;
......
...@@ -6,9 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -6,9 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
reset master; reset master;
create table t1(a int not null auto_increment, b int, primary key(a) ); create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2; insert into t3 select * from t2;
select * from t1; select * from t1;
...@@ -22,13 +22,13 @@ day id category name ...@@ -22,13 +22,13 @@ day id category name
2003-03-22 2416 a bbbbb 2003-03-22 2416 a bbbbb
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1286 slave-bin.000001 1272
drop table t1; drop table t1;
drop table t2; drop table t2;
drop table t3; drop table t3;
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
insert into t1 values(1,10); insert into t1 values(1,10);
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
start slave; start slave;
show slave status; show slave status;
...@@ -37,7 +37,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File ...@@ -37,7 +37,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
stop slave; stop slave;
change master to master_user='test'; change master to master_user='test';
change master to master_user='root'; change master to master_user='root';
...@@ -49,7 +49,7 @@ start slave; ...@@ -49,7 +49,7 @@ start slave;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
stop slave; stop slave;
reset slave; reset slave;
show slave status; show slave status;
...@@ -58,7 +58,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File ...@@ -58,7 +58,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
reset master; reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM; unique(day)) engine=MyISAM;
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 1 ERROR 23000: Duplicate entry '2003-03-22' for key 1
...@@ -73,7 +73,7 @@ day id category name ...@@ -73,7 +73,7 @@ day id category name
2003-03-22 2161 c asdf 2003-03-22 2161 c asdf
alter table t2 drop key day; alter table t2 drop key day;
delete from t2; delete from t2;
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 1 ERROR 23000: Duplicate entry '2003-03-22' for key 1
......
...@@ -9,11 +9,11 @@ stop slave; ...@@ -9,11 +9,11 @@ stop slave;
create database mysqltest; create database mysqltest;
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
use mysqltest; use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
show binlog events from 98; show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest master-bin.000001 # Query 1 # drop database if exists mysqltest
master-bin.000001 # Query 1 # create database mysqltest master-bin.000001 # Query 1 # create database mysqltest
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=12 master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=12
master-bin.000001 # Execute_load_query 1 # use `mysqltest`; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1 ;file_id=1 master-bin.000001 # Execute_load_query 1 # use `mysqltest`; load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1 ;file_id=1
drop database mysqltest; drop database mysqltest;
...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
reset master; reset master;
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
2 2
......
...@@ -5,19 +5,19 @@ reset slave; ...@@ -5,19 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
create table t1(a int); create table t1(a int);
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1; truncate table t1;
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
select a,count(*) from t1 group by a; select a,count(*) from t1 group by a;
a count(*) a count(*)
1 10000 1 10000
drop table t1; drop table t1;
create table t1(a int); create table t1(a int);
insert into t1 values (1), (2), (2), (3); insert into t1 values (1), (2), (2), (3);
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
drop table t1; drop table t1;
create table t1(a int primary key); create table t1(a int primary key);
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
select * from t1; select * from t1;
a a
1 1
......
...@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key); ...@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL); insert into t1 values (NULL);
drop table t1; drop table t1;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
69 69
...@@ -26,7 +26,7 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) ...@@ -26,7 +26,7 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 338 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
show binlog events from 98 limit 1; show binlog events from 98 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
...@@ -56,7 +56,7 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) ...@@ -56,7 +56,7 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 338 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4 master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
...@@ -74,7 +74,7 @@ master-bin.000002 510 ...@@ -74,7 +74,7 @@ master-bin.000002 510
start slave; start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1559 slave-bin.000001 1552
slave-bin.000002 348 slave-bin.000002 348
show binlog events in 'slave-bin.000001' from 4; show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
...@@ -85,11 +85,11 @@ slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) ...@@ -85,11 +85,11 @@ slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
slave-bin.000001 338 Query 1 414 use `test`; drop table t1 slave-bin.000001 338 Query 1 414 use `test`; drop table t1
slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
slave-bin.000001 1121 Execute_load_query 1 1278 use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
slave-bin.000001 1278 Query 1 1354 use `test`; drop table t1 slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1
slave-bin.000001 1354 Query 1 1440 use `test`; create table t5 (a int) slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int)
slave-bin.000001 1440 Query 1 1516 use `test`; drop table t5 slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5
slave-bin.000001 1516 Rotate 2 1559 slave-bin.000002;pos=4 slave-bin.000001 1509 Rotate 2 1552 slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4; show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
......
...@@ -15,7 +15,7 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?')); ...@@ -15,7 +15,7 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1; select * into outfile 'rpl_misc_functions.outfile' from t1;
create table t2 like t1; create table t2 like t1;
load data local infile './var/master-data/test/rpl_misc_functions.outfile' into table t2; load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p id i r1 r2 p id i r1 r2 p
stop slave; stop slave;
...@@ -9,7 +9,7 @@ drop table if exists t11; ...@@ -9,7 +9,7 @@ drop table if exists t11;
create table t2 (n int); create table t2 (n int);
insert into t2 values(4); insert into t2 values(4);
create table t2 (s char(20)); create table t2 (s char(20));
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
insert into t2 values('five'); insert into t2 values('five');
create table t1 (m int); create table t1 (m int);
insert into t1 values(15),(16),(17); insert into t1 values(15),(16),(17);
......
...@@ -24,7 +24,7 @@ drop database if exists rewrite; ...@@ -24,7 +24,7 @@ drop database if exists rewrite;
create database rewrite; create database rewrite;
use test; use test;
create table t1 (a date, b date, c date not null, d date); create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c' at row 1
...@@ -32,7 +32,7 @@ Warning 1265 Data truncated for column 'd' at row 1 ...@@ -32,7 +32,7 @@ Warning 1265 Data truncated for column 'd' at row 1
Warning 1265 Data truncated for column 'a' at row 2 Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2 Warning 1265 Data truncated for column 'd' at row 2
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
select * from rewrite.t1; select * from rewrite.t1;
a b c d a b c d
0000-00-00 NULL 0000-00-00 0000-00-00 0000-00-00 NULL 0000-00-00 0000-00-00
...@@ -40,7 +40,7 @@ a b c d ...@@ -40,7 +40,7 @@ a b c d
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings: Warnings:
Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1 Warning 1265 Data truncated for column 'd' at row 1
...@@ -53,7 +53,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00 ...@@ -53,7 +53,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL NULL 2003-03-03 2003-03-03 NULL
drop table t1; drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings: Warnings:
Warning 1261 Row 3 doesn't contain data for all columns Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
...@@ -65,7 +65,7 @@ Field 3,'Field 4| ...@@ -65,7 +65,7 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'| |Field 6| | 'Field 7'|
drop table t1; drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings: Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 3 Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns Warning 1262 Row 3 was truncated; it contained more data than there were input columns
...@@ -79,7 +79,7 @@ a b ...@@ -79,7 +79,7 @@ a b
3 row 3 3 row 3
0 1234567890 0 1234567890
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings: Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 4 Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1261 Row 4 doesn't contain data for all columns Warning 1261 Row 4 doesn't contain data for all columns
......
...@@ -68,7 +68,7 @@ ROLLBACK /* added by mysqlbinlog */; ...@@ -68,7 +68,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
delete from t1; delete from t1;
set time_zone='UTC'; set time_zone='UTC';
load data infile '../../std_data/rpl_timezone.dat' into table t1; load data infile '../std_data_ln/rpl_timezone.dat' into table t1;
select * from t1; select * from t1;
t t
2004-01-01 00:00:00 2004-01-01 00:00:00
......
...@@ -40,7 +40,7 @@ t9 CREATE TABLE `t9` ( ...@@ -40,7 +40,7 @@ t9 CREATE TABLE `t9` (
`b` char(16) NOT NULL, `b` char(16) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
alter table t9 rename t8, add column d int not null; alter table t9 rename t8, add column d int not null;
alter table t8 rename t7; alter table t8 rename t7;
rename table t7 to t9; rename table t7 to t9;
...@@ -53,7 +53,7 @@ t9 CREATE TABLE `t9` ( ...@@ -53,7 +53,7 @@ t9 CREATE TABLE `t9` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` int(11) NOT NULL, `d` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
Got one of the listed errors Got one of the listed errors
Got one of the listed errors Got one of the listed errors
Got one of the listed errors Got one of the listed errors
...@@ -71,7 +71,7 @@ t9 CREATE TABLE `t9` ( ...@@ -71,7 +71,7 @@ t9 CREATE TABLE `t9` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` int(11) NOT NULL, `d` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
drop database mysqltest; drop database mysqltest;
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
show create table t1; show create table t1;
......
...@@ -404,13 +404,13 @@ create table t1 (i int, j int, k int); ...@@ -404,13 +404,13 @@ create table t1 (i int, j int, k int);
create trigger trg1 before insert on t1 for each row set new.k = new.i; create trigger trg1 before insert on t1 for each row set new.k = new.i;
create trigger trg2 after insert on t1 for each row set @b:= "Fired"; create trigger trg2 after insert on t1 for each row set @b:= "Fired";
set @b:=""; set @b:="";
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
select *, @b from t1; select *, @b from t1;
i j k @b i j k @b
10 NULL 10 Fired 10 NULL 10 Fired
15 NULL 15 Fired 15 NULL 15 Fired
set @b:=""; set @b:="";
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
select *, @b from t1; select *, @b from t1;
i j k @b i j k @b
10 NULL 10 Fired 10 NULL 10 Fired
...@@ -447,7 +447,7 @@ ERROR 42S22: Unknown column 'at' in 'OLD' ...@@ -447,7 +447,7 @@ ERROR 42S22: Unknown column 'at' in 'OLD'
select * from t1; select * from t1;
i k i k
1 1 1 1
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
ERROR 42S22: Unknown column 'at' in 'NEW' ERROR 42S22: Unknown column 'at' in 'NEW'
select * from t1; select * from t1;
i k i k
...@@ -528,7 +528,7 @@ select * from t1; ...@@ -528,7 +528,7 @@ select * from t1;
i k i k
1 1 1 1
2 2 2 2
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
ERROR 42S22: Unknown column 'bt' in 'NEW' ERROR 42S22: Unknown column 'bt' in 'NEW'
select * from t1; select * from t1;
i k i k
......
...@@ -1293,7 +1293,7 @@ drop view v2, v1; ...@@ -1293,7 +1293,7 @@ drop view v2, v1;
drop table t1; drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
create view v1 as select * from t1 where a != 0 with check option; create view v1 as select * from t1 where a != 0 with check option;
load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
ERROR HY000: CHECK OPTION failed 'test.v1' ERROR HY000: CHECK OPTION failed 'test.v1'
select * from t1; select * from t1;
a b a b
...@@ -1304,7 +1304,7 @@ a b ...@@ -1304,7 +1304,7 @@ a b
1 row 1 1 row 1
2 row 2 2 row 2
delete from t1; delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings: Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 3 Warning 1264 Out of range value adjusted for column 'a' at row 3
Error 1369 CHECK OPTION failed 'test.v1' Error 1369 CHECK OPTION failed 'test.v1'
...@@ -1324,14 +1324,14 @@ drop view v1; ...@@ -1324,14 +1324,14 @@ drop view v1;
drop table t1; drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
create view v1 as select * from t1 where a <> 'Field A' with check option; create view v1 as select * from t1 where a <> 'Field A' with check option;
load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
ERROR HY000: CHECK OPTION failed 'test.v1' ERROR HY000: CHECK OPTION failed 'test.v1'
select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|') concat('|',a,'|') concat('|',b,'|')
select concat('|',a,'|'), concat('|',b,'|') from v1; select concat('|',a,'|'), concat('|',b,'|') from v1;
concat('|',a,'|') concat('|',b,'|') concat('|',a,'|') concat('|',b,'|')
delete from t1; delete from t1;
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
Warnings: Warnings:
Error 1369 CHECK OPTION failed 'test.v1' Error 1369 CHECK OPTION failed 'test.v1'
Warning 1261 Row 2 doesn't contain data for all columns Warning 1261 Row 2 doesn't contain data for all columns
......
...@@ -70,7 +70,7 @@ select @@warning_count; ...@@ -70,7 +70,7 @@ select @@warning_count;
1 1
drop table t1; drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5)); create table t1(a tinyint, b int not null, c date, d char(5));
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
Warnings: Warnings:
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2 Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 3 Warning 1265 Data truncated for column 'd' at row 3
......
#!/bin/sh #!/bin/sh
if [ "$MYSQL_TEST_DIR" ] if [ "$MYSQL_TEST_DIR" ]
then then
rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY? rm -f $MYSQLTEST_VARDIR/tmp/*.frm $MYSQLTEST_VARDIR/tmp/*.MY?
fi fi
...@@ -10,10 +10,10 @@ set SQL_LOG_BIN=0; ...@@ -10,10 +10,10 @@ set SQL_LOG_BIN=0;
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
--enable_warnings --enable_warnings
create table t4(n int); create table t4(n int);
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
backup table t4 to '../bogus'; backup table t4 to '../bogus';
backup table t4 to '../tmp'; backup table t4 to '../tmp';
--replace_result ": 7" ": X" ": 17" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
backup table t4 to '../tmp'; backup table t4 to '../tmp';
drop table t4; drop table t4;
restore table t4 from '../tmp'; restore table t4 from '../tmp';
...@@ -23,7 +23,7 @@ create table t1(n int); ...@@ -23,7 +23,7 @@ create table t1(n int);
insert into t1 values (23),(45),(67); insert into t1 values (23),(45),(67);
backup table t1 to '../tmp'; backup table t1 to '../tmp';
drop table t1; drop table t1;
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
restore table t1 from '../bogus'; restore table t1 from '../bogus';
restore table t1 from '../tmp'; restore table t1 from '../tmp';
select n from t1; select n from t1;
...@@ -52,6 +52,6 @@ unlock tables; ...@@ -52,6 +52,6 @@ unlock tables;
connection con1; connection con1;
reap; reap;
drop table t5; drop table t5;
--system rm $MYSQL_TEST_DIR/var/tmp/t?.* --system rm $MYSQLTEST_VARDIR/tmp/t?.*
# End of 4.1 tests # End of 4.1 tests
...@@ -108,7 +108,7 @@ insert into t1 values(1); ...@@ -108,7 +108,7 @@ insert into t1 values(1);
insert ignore into t1 values(1); insert ignore into t1 values(1);
replace into t1 values(100); replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole; create table t2 (a varchar(200)) engine=blackhole;
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
alter table t1 add b int; alter table t1 add b int;
alter table t1 drop b; alter table t1 drop b;
create table t3 like t1; create table t3 like t1;
......
...@@ -14,7 +14,7 @@ show binlog events from 98; ...@@ -14,7 +14,7 @@ show binlog events from 98;
# absolutely need variables names to be quoted and strings to be # absolutely need variables names to be quoted and strings to be
# escaped). # escaped).
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t2; drop table t2;
# End of 4.1 tests # End of 4.1 tests
--run-as-service --run-as-service
--log=$MYSQL_TEST_DIR/var/log/im.log --log=$MYSQLTEST_VARDIR/log/im.log
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
# - check the configuration file; # - check the configuration file;
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - check the running instances. # - check the running instances.
...@@ -79,7 +79,7 @@ SET mysqld1.server_id = 11; ...@@ -79,7 +79,7 @@ SET mysqld1.server_id = 11;
# - check that the configuration file has been updated (i.e. contains # - check that the configuration file has been updated (i.e. contains
# server_id=SERVER_ID for the instance); # server_id=SERVER_ID for the instance);
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - (for mysqld1) check that the running instance has not been affected: # - (for mysqld1) check that the running instance has not been affected:
# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id''
...@@ -104,7 +104,7 @@ SET mysqld2.server_id = 12; ...@@ -104,7 +104,7 @@ SET mysqld2.server_id = 12;
# - check that the configuration file has been updated (i.e. contains # - check that the configuration file has been updated (i.e. contains
# server_id=SERVER_ID for the instance); # server_id=SERVER_ID for the instance);
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - check that internal cache of Instance Manager has not been affected # - check that internal cache of Instance Manager has not been affected
# (i.e. SHOW INSTANCE OPTIONS <instance> does not contain updated value). # (i.e. SHOW INSTANCE OPTIONS <instance> does not contain updated value).
...@@ -122,7 +122,7 @@ FLUSH INSTANCES; ...@@ -122,7 +122,7 @@ FLUSH INSTANCES;
# - check that the configuration file has not been updated; # - check that the configuration file has not been updated;
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - (for mysqld1) check that the running instance has not been affected: # - (for mysqld1) check that the running instance has not been affected:
# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id''
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
# - check the configuration file; # - check the configuration file;
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - check the running instances. # - check the running instances.
...@@ -86,7 +86,7 @@ UNSET mysqld1.server_id; ...@@ -86,7 +86,7 @@ UNSET mysqld1.server_id;
# - check that the configuration file has been updated (i.e. does not # - check that the configuration file has been updated (i.e. does not
# contain 'server_id=' line for the instance); # contain 'server_id=' line for the instance);
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
# - check that the running instance has not been affected: connect to the # - check that the running instance has not been affected: connect to the
# instance and check that 'SHOW VARIABLES LIKE 'server_id'' returns non-zero # instance and check that 'SHOW VARIABLES LIKE 'server_id'' returns non-zero
...@@ -111,7 +111,7 @@ UNSET mysqld2.server_id; ...@@ -111,7 +111,7 @@ UNSET mysqld2.server_id;
# - check that the configuration file has been updated (i.e. does not # - check that the configuration file has been updated (i.e. does not
# contain 'server_id=' line for the instance); # contain 'server_id=' line for the instance);
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf || true;
# - check that internal cache of Instance Manager is not affected (i.e. SHOW # - check that internal cache of Instance Manager is not affected (i.e. SHOW
# INSTANCE OPTIONS <instance> contains non-zero value for server_id); # INSTANCE OPTIONS <instance> contains non-zero value for server_id);
...@@ -130,7 +130,7 @@ FLUSH INSTANCES; ...@@ -130,7 +130,7 @@ FLUSH INSTANCES;
# - check that the configuration file has not been updated (i.e. does not # - check that the configuration file has not been updated (i.e. does not
# contain 'server_id=' for the instance); # contain 'server_id=' for the instance);
--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; --exec grep server_id $MYSQLTEST_VARDIR/im.cnf || true;
# - (for mysqld1) check that the running instance has not been affected: # - (for mysqld1) check that the running instance has not been affected:
# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id''
......
...@@ -7,25 +7,25 @@ drop table if exists t1, t2; ...@@ -7,25 +7,25 @@ drop table if exists t1, t2;
--enable_warnings --enable_warnings
create table t1 (a date, b date, c date not null, d date); create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1; SELECT * from t1;
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1; SELECT * from t1;
drop table t1; drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from t1;
drop table t1; drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1; select * from t1;
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
# The empty line last comes from the end line field in the file # The empty line last comes from the end line field in the file
select * from t1; select * from t1;
...@@ -38,23 +38,23 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; ...@@ -38,23 +38,23 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
create table t1(id integer not null auto_increment primary key); create table t1(id integer not null auto_increment primary key);
insert into t1 values(0); insert into t1 values(0);
disable_query_log; disable_query_log;
eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' from t1; eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1;
delete from t1; delete from t1;
eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1; eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1;
enable_query_log; enable_query_log;
select * from t1; select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1 --exec rm $MYSQLTEST_VARDIR/tmp/t1
disable_query_log; disable_query_log;
eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1'
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
FROM t1; FROM t1;
delete from t1; delete from t1;
eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1 eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
enable_query_log; enable_query_log;
select * from t1; select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1 --exec rm $MYSQLTEST_VARDIR/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1; drop table t1;
...@@ -63,7 +63,7 @@ drop table t1; ...@@ -63,7 +63,7 @@ drop table t1;
# ENCLOSED # ENCLOSED
# #
create table t1 (a varchar(20), b varchar(20)); create table t1 (a varchar(20), b varchar(20));
load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
select * from t1; select * from t1;
drop table t1; drop table t1;
...@@ -74,40 +74,40 @@ drop table t1; ...@@ -74,40 +74,40 @@ drop table t1;
# #
create table t1 (a int default 100, b int, c varchar(60)); create table t1 (a int default 100, b int, c varchar(60));
# we can do something like this # we can do something like this
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1; select * from t1;
truncate table t1; truncate table t1;
# we can use filled fields in expressions # we can use filled fields in expressions
# we also assigning NULL value to field with non-NULL default here # we also assigning NULL value to field with non-NULL default here
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
select * from t1; select * from t1;
truncate table t1; truncate table t1;
# we even can use variables in set clause, and missed columns will be set # we even can use variables in set clause, and missed columns will be set
# with default values # with default values
set @c:=123; set @c:=123;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
select * from t1; select * from t1;
# let us test side-effect of such load # let us test side-effect of such load
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1; select * from t1;
select @a, @b; select @a, @b;
truncate table t1; truncate table t1;
# now going to test fixed field-row file format # now going to test fixed field-row file format
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1; select * from t1;
truncate table t1; truncate table t1;
# this also should work # this also should work
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
select * from t1; select * from t1;
# and this should bark # and this should bark
--error 1409 --error 1409
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
# Now let us test LOAD DATA with subselect # Now let us test LOAD DATA with subselect
create table t2 (num int primary key, str varchar(10)); create table t2 (num int primary key, str varchar(10));
insert into t2 values (10,'Ten'), (15,'Fifteen'); insert into t2 values (10,'Ten'), (15,'Fifteen');
truncate table t1; truncate table t1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1; select * from t1;
# cleanup # cleanup
......
...@@ -711,14 +711,14 @@ eval set storage_engine=$default; ...@@ -711,14 +711,14 @@ eval set storage_engine=$default;
# Test how DROP TABLE works if the index or data file doesn't exists # Test how DROP TABLE works if the index or data file doesn't exists
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYI ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
drop table if exists t1; drop table if exists t1;
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYI ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
--error 1051,6 --error 1051,6
drop table t1; drop table t1;
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYD ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ;
--error 1105,6,29 --error 1105,6,29
drop table t1; drop table t1;
--error 1051 --error 1051
......
...@@ -22,11 +22,11 @@ insert into t2 values (); ...@@ -22,11 +22,11 @@ insert into t2 values ();
# test for load data and load data distributed among the several # test for load data and load data distributed among the several
# files (we need to fill up first binlog) # files (we need to fill up first binlog)
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
# simple query to show more in second binlog # simple query to show more in second binlog
insert into t1 values ("Alas"); insert into t1 values ("Alas");
flush logs; flush logs;
...@@ -41,29 +41,29 @@ select "--- Local --" as ""; ...@@ -41,29 +41,29 @@ select "--- Local --" as "";
# be time dependend. Better than nothing. # be time dependend. Better than nothing.
# #
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001
# this should not fail but shouldn't produce any working statements # this should not fail but shouldn't produce any working statements
--disable_query_log --disable_query_log
select "--- Broken LOAD DATA --" as ""; select "--- Broken LOAD DATA --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000002
# this should show almost nothing # this should show almost nothing
--disable_query_log --disable_query_log
select "--- --database --" as ""; select "--- --database --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLTEST_VARDIR/log/master-bin.000001
# this test for position option # this test for position option
--disable_query_log --disable_query_log
select "--- --position --" as ""; select "--- --position --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=231 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=231 $MYSQLTEST_VARDIR/log/master-bin.000002
# These are tests for remote binlog. # These are tests for remote binlog.
# They should return the same as previous test. # They should return the same as previous test.
...@@ -73,29 +73,29 @@ select "--- Remote --" as ""; ...@@ -73,29 +73,29 @@ select "--- Remote --" as "";
--enable_query_log --enable_query_log
# This is broken now # This is broken now
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This is broken too # This is broken too
--disable_query_log --disable_query_log
select "--- Broken LOAD DATA --" as ""; select "--- Broken LOAD DATA --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# And this too ! (altough it is documented) # And this too ! (altough it is documented)
--disable_query_log --disable_query_log
select "--- --database --" as ""; select "--- --database --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
# Strangely but this works # Strangely but this works
--disable_query_log --disable_query_log
select "--- --position --" as ""; select "--- --position --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=231 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=231 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin) # Bug#7853 (mysqlbinlog does not accept input from stdin)
--disable_query_log --disable_query_log
......
...@@ -40,28 +40,28 @@ select "--- Local --" as ""; ...@@ -40,28 +40,28 @@ select "--- Local --" as "";
# be time dependent (the Start events). Better than nothing. # be time dependent (the Start events). Better than nothing.
# #
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- offset --" as ""; select "--- offset --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form --stop-position=600 $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- stop-datetime --" as ""; select "--- stop-datetime --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log --disable_query_log
select "--- Local with 2 binlogs on command line --" as ""; select "--- Local with 2 binlogs on command line --" as "";
...@@ -69,28 +69,28 @@ select "--- Local with 2 binlogs on command line --" as ""; ...@@ -69,28 +69,28 @@ select "--- Local with 2 binlogs on command line --" as "";
# This is to verify that some options apply only to first, or last binlog # This is to verify that some options apply only to first, or last binlog
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- offset --" as ""; select "--- offset --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=126 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form --stop-position=126 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- stop-datetime --" as ""; select "--- stop-datetime --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 --exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log --disable_query_log
select "--- Remote --" as ""; select "--- Remote --" as "";
......
...@@ -125,14 +125,14 @@ drop table t1; ...@@ -125,14 +125,14 @@ drop table t1;
create table t1(a int); create table t1(a int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQL_TEST_DIR/var/tmp/ test --exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
--exec cat $MYSQL_TEST_DIR/var/tmp/t1.sql --exec cat $MYSQLTEST_VARDIR/tmp/t1.sql
--exec cat $MYSQL_TEST_DIR/var/tmp/t1.txt --exec cat $MYSQLTEST_VARDIR/tmp/t1.txt
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql --exec rm $MYSQLTEST_VARDIR/tmp/t1.sql
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt --exec rm $MYSQLTEST_VARDIR/tmp/t1.txt
--exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql --exec rm $MYSQLTEST_VARDIR/tmp/t1.sql
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt --exec rm $MYSQLTEST_VARDIR/tmp/t1.txt
drop table t1; drop table t1;
# #
...@@ -587,7 +587,7 @@ create view v1 as select * from t2; ...@@ -587,7 +587,7 @@ create view v1 as select * from t2;
create view v2 as select * from t1; create view v2 as select * from t1;
# dump tables and view from db2 # dump tables and view from db2
--exec $MYSQL_DUMP db2 > var/tmp/bug10713.sql --exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
# drop the db, tables and views # drop the db, tables and views
drop table t1, t2; drop table t1, t2;
...@@ -597,7 +597,7 @@ drop database db2; ...@@ -597,7 +597,7 @@ drop database db2;
# create db1 and reload dump # create db1 and reload dump
create database db1; create database db1;
use db1; use db1;
--exec $MYSQL db1 < var/tmp/bug10713.sql --exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
# check that all tables and views could be created # check that all tables and views could be created
show tables; show tables;
...@@ -705,9 +705,9 @@ drop table t1, t2; ...@@ -705,9 +705,9 @@ drop table t1, t2;
create table t1 (a text character set utf8, b text character set latin1); create table t1 (a text character set utf8, b text character set latin1);
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E); insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
select * from t1; select * from t1;
--exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
--exec $MYSQL test < $MYSQL_TEST_DIR/var/tmp/t1.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
--exec $MYSQL_IMPORT test $MYSQL_TEST_DIR/var/tmp/t1.txt --exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
select * from t1; select * from t1;
drop table t1; drop table t1;
...@@ -817,9 +817,9 @@ update t1 set a = 4 where a=3; ...@@ -817,9 +817,9 @@ update t1 set a = 4 where a=3;
# Skip dumping triggers # Skip dumping triggers
--exec $MYSQL_DUMP --skip-comments --databases --skip-triggers test --exec $MYSQL_DUMP --skip-comments --databases --skip-triggers test
# Dump and reload... # Dump and reload...
--exec $MYSQL_DUMP --skip-comments --databases test > var/tmp/mysqldump.sql --exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql
drop table t1; drop table t1;
--exec $MYSQL test < var/tmp/mysqldump.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql
# Check that tables have been reloaded # Check that tables have been reloaded
show tables; show tables;
--replace_column 6 # --replace_column 6 #
...@@ -830,11 +830,11 @@ DROP TABLE t1, t2; ...@@ -830,11 +830,11 @@ DROP TABLE t1, t2;
# Bugs #9136, #12917: problems with --defaults-extra-file option # Bugs #9136, #12917: problems with --defaults-extra-file option
# #
--exec echo "[mysqltest1]" > $MYSQL_TEST_DIR/var/tmp/tmp.cnf --exec echo "[mysqltest1]" > $MYSQLTEST_VARDIR/tmp/tmp.cnf
--exec echo "port=1234" >> $MYSQL_TEST_DIR/var/tmp/tmp.cnf --exec echo "port=1234" >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1 --exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1
--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1 mysqltest1 --exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1
--exec rm $MYSQL_TEST_DIR/var/tmp/tmp.cnf --exec rm $MYSQLTEST_VARDIR/tmp/tmp.cnf
# #
# Test of fix to BUG 12597 # Test of fix to BUG 12597
...@@ -859,13 +859,13 @@ INSERT INTO `test1` VALUES (1); ...@@ -859,13 +859,13 @@ INSERT INTO `test1` VALUES (1);
SELECT * FROM `test2`; SELECT * FROM `test2`;
# dump # dump
--exec $MYSQL_DUMP --skip-comments --databases test > var/tmp/mysqldump.sql --exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql
#DROP TRIGGER testref; #DROP TRIGGER testref;
#DROP TABLE test1; #DROP TABLE test1;
#DROP TABLE test2; #DROP TABLE test2;
# restore # restore
--exec $MYSQL test < var/tmp/mysqldump.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql
SHOW TRIGGERS; SHOW TRIGGERS;
SELECT * FROM `test1`; SELECT * FROM `test1`;
SELECT * FROM `test2`; SELECT * FROM `test2`;
......
This diff is collapsed.
...@@ -24,7 +24,7 @@ create table t1( ...@@ -24,7 +24,7 @@ create table t1(
insert into t1 values(1, "Autodiscover"); insert into t1 values(1, "Autodiscover");
flush tables; flush tables;
system rm var/master-data/test/t1.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
select * from t1; select * from t1;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -33,13 +33,13 @@ show status like 'handler_discover%'; ...@@ -33,13 +33,13 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm var/master-data/test/t1.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
insert into t1 values (2, "Auto 2"); insert into t1 values (2, "Auto 2");
show status like 'handler_discover%'; show status like 'handler_discover%';
insert into t1 values (3, "Discover 3"); insert into t1 values (3, "Discover 3");
show status like 'handler_discover%'; show status like 'handler_discover%';
flush tables; flush tables;
system rm var/master-data/test/t1.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
select * from t1 order by id; select * from t1 order by id;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -48,7 +48,7 @@ show status like 'handler_discover%'; ...@@ -48,7 +48,7 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm var/master-data/test/t1.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
update t1 set name="Autodiscover" where id = 2; update t1 set name="Autodiscover" where id = 2;
show status like 'handler_discover%'; show status like 'handler_discover%';
select * from t1 order by id; select * from t1 order by id;
...@@ -59,7 +59,7 @@ show status like 'handler_discover%'; ...@@ -59,7 +59,7 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm var/master-data/test/t1.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
delete from t1 where id = 3; delete from t1 where id = 3;
select * from t1 order by id; select * from t1 order by id;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -85,7 +85,7 @@ show status like 'handler_discover%'; ...@@ -85,7 +85,7 @@ show status like 'handler_discover%';
flush tables; flush tables;
# Modify the frm file on disk # Modify the frm file on disk
system echo "blaj" >> var/master-data/test/t2.frm ; system echo "blaj" >> $MYSQLTEST_VARDIR/master-data/test/t2.frm ;
select * from t2; select * from t2;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -111,7 +111,7 @@ show status like 'handler_discover%'; ...@@ -111,7 +111,7 @@ show status like 'handler_discover%';
flush tables; flush tables;
# Remove the frm file from disk # Remove the frm file from disk
system rm var/master-data/test/t3.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm ;
--error 1050 --error 1050
create table t3( create table t3(
...@@ -168,14 +168,14 @@ show status like 'handler_discover%'; ...@@ -168,14 +168,14 @@ show status like 'handler_discover%';
# Remove the frm file from disk # Remove the frm file from disk
flush tables; flush tables;
system rm var/master-data/test/t7.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
show tables from test; show tables from test;
show status like 'handler_discover%'; show status like 'handler_discover%';
# Remove the frm file from disk again # Remove the frm file from disk again
flush tables; flush tables;
system rm var/master-data/test/t7.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
--replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 # --replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 #
show table status; show table status;
...@@ -290,8 +290,8 @@ insert into t9 values (9); ...@@ -290,8 +290,8 @@ insert into t9 values (9);
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ;
# Remove t6, t7 from disk # Remove t6, t7 from disk
system rm var/master-data/test/t6.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
system rm var/master-data/test/t7.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
SHOW TABLES; SHOW TABLES;
...@@ -332,8 +332,8 @@ insert into t9 values (9); ...@@ -332,8 +332,8 @@ insert into t9 values (9);
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ;
# Remove t6, t7 from disk # Remove t6, t7 from disk
system rm var/master-data/test/t6.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
system rm var/master-data/test/t7.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
SHOW TABLES LIKE 't6'; SHOW TABLES LIKE 't6';
...@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3"); ...@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3");
insert into t4 values (4); insert into t4 values (4);
# Remove t1, t2, t3 from disk # Remove t1, t2, t3 from disk
system rm var/master-data/test/t1.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ;
system rm var/master-data/test/t2.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ;
system rm var/master-data/test/t3.frm > /dev/null ; system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ;
flush tables; flush tables;
# Select from the table which only exists in NDB. # Select from the table which only exists in NDB.
...@@ -530,7 +530,7 @@ CREATE TABLE t9 ( ...@@ -530,7 +530,7 @@ CREATE TABLE t9 (
insert t9 values(1, 2), (2,3), (3, 4), (4, 5); insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
#Don't drop the table, instead remove the frm file #Don't drop the table, instead remove the frm file
system rm var/master-data/test/t9.frm ; system rm $MYSQLTEST_VARDIR/master-data/test/t9.frm ;
# Now leave test case, when ndb_autodiscover2 will run, this # Now leave test case, when ndb_autodiscover2 will run, this
# MySQL Server will have been restarted because it has a # MySQL Server will have been restarted because it has a
......
disable_query_log; disable_query_log;
-- source include/test_outfile.inc -- source include/test_outfile.inc
eval set @tmpdir="$MYSQL_TEST_DIR/var/tmp"; # Server are started in "var/master-data", so "../tmp" will be "var/tmp"
eval set @tmpdir="../tmp";
enable_query_log; enable_query_log;
-- source include/have_outfile.inc -- source include/have_outfile.inc
...@@ -15,42 +16,43 @@ drop table if exists t1; ...@@ -15,42 +16,43 @@ drop table if exists t1;
create table t1 (`a` blob); create table t1 (`a` blob);
insert into t1 values("hello world"),("Hello mars"),(NULL); insert into t1 values("hello world"),("Hello mars"),(NULL);
disable_query_log; disable_query_log;
eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1; eval select * into outfile "../tmp/outfile-test.1" from t1;
enable_query_log; enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.1")); select load_file(concat(@tmpdir,"/outfile-test.1"));
disable_query_log; disable_query_log;
eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1 limit 1; eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1;
enable_query_log; enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.2")); select load_file(concat(@tmpdir,"/outfile-test.2"));
disable_query_log; disable_query_log;
eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1 where a is null; eval select * into dumpfile "../tmp/outfile-test.3" from t1 where a is null;
enable_query_log; enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.3")); select load_file(concat(@tmpdir,"/outfile-test.3"));
# the following should give errors # the following should give errors
#disabled as error message has variable path disable_query_log;
#disable_query_log; --error 1086
#--error 1086 eval select * into outfile "../tmp/outfile-test.1" from t1;
#eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1;
#--error 1086 --error 1086
#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1; eval select * into dumpfile "../tmp/outfile-test.2" from t1;
#--error 1086
#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1; --error 1086
#enable_query_log; eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
--error 13,2 --error 13,2
select load_file(concat(@tmpdir,"/outfile-test.not-exist")); select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.3 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1; drop table t1;
# Bug#8191 # Bug#8191
disable_query_log; disable_query_log;
eval select 1 into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"; eval select 1 into outfile "../tmp/outfile-test.4";
enable_query_log; enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.4")); select load_file(concat(@tmpdir,"/outfile-test.4"));
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
# #
# Bug #5382: 'explain select into outfile' crashes the server # Bug #5382: 'explain select into outfile' crashes the server
...@@ -70,16 +72,16 @@ DROP TABLE t1; ...@@ -70,16 +72,16 @@ DROP TABLE t1;
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails # Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
# #
disable_query_log; disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4" eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5; FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log; # enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
use information_schema; use information_schema;
# disable_query_log; # disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4" eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5; FROM schemata LIMIT 0, 5;
enable_query_log; enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
...@@ -783,6 +783,7 @@ begin ...@@ -783,6 +783,7 @@ begin
end// end//
call p1()// call p1()//
drop procedure p1// drop procedure p1//
drop function f1//
drop table t1// drop table t1//
delimiter ;// delimiter ;//
......
...@@ -29,7 +29,7 @@ repair table t1 use_frm; ...@@ -29,7 +29,7 @@ repair table t1 use_frm;
create table t1 engine=myisam SELECT 1,"table 1"; create table t1 engine=myisam SELECT 1,"table 1";
flush tables; flush tables;
system echo 1 > $MYSQL_TEST_DIR/var/master-data/test/t1.MYI ; system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
repair table t1; repair table t1;
repair table t1 use_frm; repair table t1 use_frm;
drop table t1; drop table t1;
......
source include/master-slave.inc; source include/master-slave.inc;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1; eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10; select * from t1 limit 10;
......
...@@ -2,9 +2,9 @@ source include/master-slave.inc; ...@@ -2,9 +2,9 @@ source include/master-slave.inc;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word)); create table t1 (word char(20) not null, index(word));
load data infile '../../std_data/words.dat' into table t1; load data infile '../std_data_ln/words.dat' into table t1;
create table t2 (word char(20) not null); create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
create table t3 (word char(20) not null primary key); create table t3 (word char(20) not null primary key);
connection slave; connection slave;
load table t1 from master; load table t1 from master;
......
...@@ -138,10 +138,10 @@ select * from mysqltest.t1; ...@@ -138,10 +138,10 @@ select * from mysqltest.t1;
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX # DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
# insert into mysqltest.t1 values(10, 'should be there'); # insert into mysqltest.t1 values(10, 'should be there');
# flush tables; # flush tables;
# system chmod 500 var/slave-data/mysqltest/; # system chmod 500 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
# --error 6 # --error 6
# load data from master; # should fail (errno 13) # load data from master; # should fail (errno 13)
# system chmod 700 var/slave-data/mysqltest/; # system chmod 700 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
# select * from mysqltest.t1; # should contain the row (10, ...) # select * from mysqltest.t1; # should contain the row (10, ...)
......
rm -f $MYSQL_TEST_DIR/var/slave-data/master.info rm -f $MYSQLTEST_VARDIR/slave-data/master.info
rm -f $MYSQL_TEST_DIR/var/log/*relay* rm -f $MYSQLTEST_VARDIR/log/*relay*
rm -f $MYSQL_TEST_DIR/var/slave-data/relay-log.info rm -f $MYSQLTEST_VARDIR/slave-data/relay-log.info
cat > $MYSQL_TEST_DIR/var/slave-data/master.info <<EOF cat > $MYSQLTEST_VARDIR/slave-data/master.info <<EOF
master-bin.000001 master-bin.000001
4 4
127.0.0.1 127.0.0.1
......
...@@ -8,7 +8,7 @@ source include/master-slave.inc; ...@@ -8,7 +8,7 @@ source include/master-slave.inc;
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
flush tables; flush tables;
system rm ./var/master-data/test/t1.MYI ; system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
drop table if exists t1; drop table if exists t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
......
...@@ -153,7 +153,7 @@ select hex(c1), hex(c2) from t1; ...@@ -153,7 +153,7 @@ select hex(c1), hex(c2) from t1;
connection master; connection master;
# Let's have a look at generated SETs. # Let's have a look at generated SETs.
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;
......
...@@ -53,5 +53,5 @@ sync_slave_with_master; ...@@ -53,5 +53,5 @@ sync_slave_with_master;
#cleanup #cleanup
connection slave; connection slave;
stop slave; stop slave;
system rm -rf var/master-data/mysqltest1; system rm -rf $MYSQLTEST_VARDIR/master-data/mysqltest1;
-O max_binlog_size=1M --relay-log=$MYSQL_TEST_DIR/var/master-data/relay-log -O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/master-data/relay-log
rm -f $MYSQL_TEST_DIR/var/slave-data/*-bin.* rm -f $MYSQLTEST_VARDIR/slave-data/*-bin.*
rm -f $MYSQL_TEST_DIR/var/slave-data/master.info rm -f $MYSQLTEST_VARDIR/slave-data/master.info
rm -f $MYSQL_TEST_DIR/var/slave-data/*.index rm -f $MYSQLTEST_VARDIR/slave-data/*.index
-O max_binlog_size=1M --relay-log=$MYSQL_TEST_DIR/var/slave-data/relay-log -O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/slave-data/relay-log
rm -f $MYSQL_TEST_DIR/var/master-data/master.info rm -f $MYSQLTEST_VARDIR/master-data/master.info
rm -f $MYSQL_TEST_DIR/var/master-data/*-bin.* rm -f $MYSQLTEST_VARDIR/master-data/*-bin.*
rm -f $MYSQL_TEST_DIR/var/master-data/*.index rm -f $MYSQLTEST_VARDIR/master-data/*.index
...@@ -18,7 +18,7 @@ CREATE TABLE t4 ( ...@@ -18,7 +18,7 @@ CREATE TABLE t4 (
--disable_warnings --disable_warnings
LOAD DATA LOAD DATA
INFILE '../../std_data/loaddata_pair.dat' INFILE '../std_data_ln/loaddata_pair.dat'
REPLACE INTO TABLE t4 REPLACE INTO TABLE t4
(name,number); (name,number);
--enable_warnings --enable_warnings
...@@ -30,7 +30,7 @@ SELECT * FROM t4; ...@@ -30,7 +30,7 @@ SELECT * FROM t4;
connection master; connection master;
--disable_warnings --disable_warnings
LOAD DATA LOAD DATA
INFILE '../../std_data/loaddata_pair.dat' INFILE '../std_data_ln/loaddata_pair.dat'
REPLACE INTO TABLE t4 REPLACE INTO TABLE t4
(name,number); (name,number);
--enable_warnings --enable_warnings
......
...@@ -18,10 +18,10 @@ reset master; ...@@ -18,10 +18,10 @@ reset master;
connection master; connection master;
create table t1(a int not null auto_increment, b int, primary key(a) ); create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2; insert into t3 select * from t2;
...@@ -56,7 +56,7 @@ sync_with_master; ...@@ -56,7 +56,7 @@ sync_with_master;
insert into t1 values(1,10); insert into t1 values(1,10);
connection master; connection master;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
...@@ -80,7 +80,7 @@ connection master; ...@@ -80,7 +80,7 @@ connection master;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
# The SQL slave thread should be stopped now. # The SQL slave thread should be stopped now.
...@@ -105,7 +105,7 @@ connection master; ...@@ -105,7 +105,7 @@ connection master;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
# The SQL slave thread should be stopped now. # The SQL slave thread should be stopped now.
...@@ -125,7 +125,7 @@ reset master; ...@@ -125,7 +125,7 @@ reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM; # no transactions unique(day)) engine=MyISAM; # no transactions
--error 1062 --error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
select * from t2; select * from t2;
...@@ -141,7 +141,7 @@ alter table t2 drop key day; ...@@ -141,7 +141,7 @@ alter table t2 drop key day;
connection master; connection master;
delete from t2; delete from t2;
--error 1062 --error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
connection slave; connection slave;
......
...@@ -18,7 +18,7 @@ connection master; ...@@ -18,7 +18,7 @@ connection master;
create database mysqltest; create database mysqltest;
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
use mysqltest; use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
# Starting from 5.0.3 LOAD DATA is replicated much in the same way as ordinary # Starting from 5.0.3 LOAD DATA is replicated much in the same way as ordinary
# query so "show binlog ..." should show two events (before 5.0.3 no events # query so "show binlog ..." should show two events (before 5.0.3 no events
# were returned). # were returned).
......
...@@ -9,7 +9,7 @@ reset master; ...@@ -9,7 +9,7 @@ reset master;
connection master; connection master;
# 'test' is the current database # 'test' is the current database
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
# Test logging on slave; # Test logging on slave;
......
...@@ -14,17 +14,18 @@ disable_query_log; ...@@ -14,17 +14,18 @@ disable_query_log;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
while ($1) while ($1)
{ {
#eval means expand $ expressions insert into t1 values(1);
eval insert into t1 values(1);
dec $1; dec $1;
} }
set SQL_LOG_BIN=1; set SQL_LOG_BIN=1;
enable_query_log; enable_query_log;
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
#This will generate a 20KB file, now test LOAD DATA LOCAL #This will generate a 20KB file, now test LOAD DATA LOCAL
truncate table t1; truncate table t1;
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
...@@ -45,11 +46,13 @@ sync_with_master; ...@@ -45,11 +46,13 @@ sync_with_master;
connection master; connection master;
create table t1(a int); create table t1(a int);
insert into t1 values (1), (2), (2), (3); insert into t1 values (1), (2), (2), (3);
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
drop table t1; drop table t1;
create table t1(a int primary key); create table t1(a int primary key);
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
select * from t1; select * from t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
......
...@@ -33,7 +33,7 @@ create table t1(n int not null auto_increment primary key); ...@@ -33,7 +33,7 @@ create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL); insert into t1 values (NULL);
drop table t1; drop table t1;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1; select count(*) from t1;
drop table t1; drop table t1;
--replace_result $VERSION VERSION --replace_result $VERSION VERSION
......
rm -f $MYSQL_TEST_DIR/var/master-data/test/rpl_misc_functions.outfile rm -f $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile
...@@ -24,7 +24,8 @@ select * into outfile 'rpl_misc_functions.outfile' from t1; ...@@ -24,7 +24,8 @@ select * into outfile 'rpl_misc_functions.outfile' from t1;
sync_slave_with_master; sync_slave_with_master;
create table t2 like t1; create table t2 like t1;
# read the values from the master table # read the values from the master table
load data local infile './var/master-data/test/rpl_misc_functions.outfile' into table t2; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
# compare them with the replica; the SELECT below should return no row # compare them with the replica; the SELECT below should return no row
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
stop slave; stop slave;
......
...@@ -12,7 +12,7 @@ create table t2 (n int); ...@@ -12,7 +12,7 @@ create table t2 (n int);
insert into t2 values(4); insert into t2 values(4);
connection master; connection master;
create table t2 (s char(20)); create table t2 (s char(20));
load data infile '../../std_data/words.dat' into table t2; load data infile '../std_data_ln/words.dat' into table t2;
insert into t2 values('five'); insert into t2 values('five');
create table t1 (m int); create table t1 (m int);
insert into t1 values(15),(16),(17); insert into t1 values(15),(16),(17);
......
...@@ -31,8 +31,8 @@ create database rewrite; ...@@ -31,8 +31,8 @@ create database rewrite;
connection master; connection master;
use test; use test;
create table t1 (a date, b date, c date not null, d date); create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
...@@ -40,7 +40,7 @@ select * from rewrite.t1; ...@@ -40,7 +40,7 @@ select * from rewrite.t1;
connection master; connection master;
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
...@@ -49,7 +49,7 @@ select * from rewrite.t1; ...@@ -49,7 +49,7 @@ select * from rewrite.t1;
connection master; connection master;
drop table t1; drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
...@@ -58,7 +58,7 @@ select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; ...@@ -58,7 +58,7 @@ select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
connection master; connection master;
drop table t1; drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
...@@ -66,7 +66,7 @@ select * from rewrite.t1; ...@@ -66,7 +66,7 @@ select * from rewrite.t1;
connection master; connection master;
truncate table t1; truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
......
rm -f $MYSQL_TEST_DIR/var/slave-data/master.info rm -f $MYSQLTEST_VARDIR/slave-data/master.info
rm -f $MYSQL_TEST_DIR/var/slave-data/*relay* rm -f $MYSQLTEST_VARDIR/slave-data/*relay*
...@@ -14,8 +14,8 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); ...@@ -14,8 +14,8 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
--enable_warnings --enable_warnings
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
system cat /dev/null > var/slave-data/master.info; system cat /dev/null > $MYSQLTEST_VARDIR/slave-data/master.info;
system chmod 000 var/slave-data/master.info; system chmod 000 $MYSQLTEST_VARDIR/slave-data/master.info;
connection slave; connection slave;
--disable_warnings --disable_warnings
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
...@@ -26,7 +26,7 @@ drop table if exists t1, t2, t3, t4; ...@@ -26,7 +26,7 @@ drop table if exists t1, t2, t3, t4;
--replace_result $MYSQL_TEST_DIR TESTDIR --replace_result $MYSQL_TEST_DIR TESTDIR
--error 1105,1105,29 --error 1105,1105,29
start slave; start slave;
system chmod 600 var/slave-data/master.info; system chmod 600 $MYSQLTEST_VARDIR/slave-data/master.info;
# It will fail again because the file is empty so the slave cannot get valuable # It will fail again because the file is empty so the slave cannot get valuable
# info about how to connect to the master from it (failure in # info about how to connect to the master from it (failure in
# init_strvar_from_file() in init_master_info()). # init_strvar_from_file() in init_master_info()).
......
...@@ -46,15 +46,15 @@ sync_slave_with_master; ...@@ -46,15 +46,15 @@ sync_slave_with_master;
set time_zone='Europe/Moscow'; set time_zone='Europe/Moscow';
select * from t1; select * from t1;
connection master; connection master;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
# Let us check with LOAD DATA INFILE # Let us check with LOAD DATA INFILE
# (we do it after mysqlbinlog because the temp files names are not constant) # (we do it after mysqlbinlog because the temp files names are not constant)
connection master; connection master;
delete from t1; delete from t1;
set time_zone='UTC'; set time_zone='UTC';
load data infile '../../std_data/rpl_timezone.dat' into table t1; load data infile '../std_data_ln/rpl_timezone.dat' into table t1;
select * from t1; select * from t1;
sync_slave_with_master; sync_slave_with_master;
set time_zone='UTC'; set time_zone='UTC';
......
...@@ -392,7 +392,7 @@ DROP TABLE t1; ...@@ -392,7 +392,7 @@ DROP TABLE t1;
flush tables; flush tables;
# Create a junk frm file on disk # Create a junk frm file on disk
system echo "this is a junk file for test" >> var/master-data/test/t1.frm ; system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
--replace_column 6 # 7 # 8 # 9 # --replace_column 6 # 7 # 8 # 9 #
SHOW TABLE STATUS like 't1'; SHOW TABLE STATUS like 't1';
--error 1033 --error 1033
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
--source include/not_windows.inc --source include/not_windows.inc
# Backup proc table # Backup proc table
--system rm -rf var/master-data/mysql/backup --system rm -rf $MYSQLTEST_VARDIR/master-data/mysql/backup
--system mkdir var/master-data/mysql/backup --system mkdir $MYSQLTEST_VARDIR/master-data/mysql/backup
--system cp var/master-data/mysql/proc.* var/master-data/mysql/backup/ --system cp $MYSQLTEST_VARDIR/master-data/mysql/proc.* $MYSQLTEST_VARDIR/master-data/mysql/backup/
use test; use test;
...@@ -45,7 +45,7 @@ insert into t1 values (0); ...@@ -45,7 +45,7 @@ insert into t1 values (0);
flush table mysql.proc; flush table mysql.proc;
# Thrashing the .frm file # Thrashing the .frm file
--system echo 'saljdlfa' > var/master-data/mysql/proc.frm --system echo 'saljdlfa' > $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--error ER_NOT_FORM_FILE --error ER_NOT_FORM_FILE
call bug14233(); call bug14233();
--error ER_NOT_FORM_FILE --error ER_NOT_FORM_FILE
...@@ -57,7 +57,7 @@ insert into t1 values (0); ...@@ -57,7 +57,7 @@ insert into t1 values (0);
flush table mysql.proc; flush table mysql.proc;
# Drop the mysql.proc table # Drop the mysql.proc table
--system rm var/master-data/mysql/proc.* --system rm $MYSQLTEST_VARDIR/master-data/mysql/proc.*
--error ER_NO_SUCH_TABLE --error ER_NO_SUCH_TABLE
call bug14233(); call bug14233();
--error ER_NO_SUCH_TABLE --error ER_NO_SUCH_TABLE
...@@ -66,8 +66,8 @@ create view v1 as select bug14233_f(); ...@@ -66,8 +66,8 @@ create view v1 as select bug14233_f();
insert into t1 values (0); insert into t1 values (0);
# Restore mysql.proc # Restore mysql.proc
--system mv var/master-data/mysql/backup/* var/master-data/mysql/ --system mv $MYSQLTEST_VARDIR/master-data/mysql/backup/* $MYSQLTEST_VARDIR/master-data/mysql/
--system rmdir var/master-data/mysql/backup --system rmdir $MYSQLTEST_VARDIR/master-data/mysql/backup
flush table mysql.proc; flush table mysql.proc;
flush privileges; flush privileges;
......
...@@ -41,7 +41,7 @@ drop table t2; ...@@ -41,7 +41,7 @@ drop table t2;
# #
disable_query_log; disable_query_log;
eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" index directory="$MYSQL_TEST_DIR/var/run"; eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run";
enable_query_log; enable_query_log;
insert into t9 select * from t1; insert into t9 select * from t1;
...@@ -50,7 +50,7 @@ optimize table t9; ...@@ -50,7 +50,7 @@ optimize table t9;
repair table t9; repair table t9;
alter table t9 add column c int not null; alter table t9 add column c int not null;
--replace_result $MYSQL_TEST_DIR TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t9; show create table t9;
# Test renames # Test renames
...@@ -65,7 +65,7 @@ drop table t1; ...@@ -65,7 +65,7 @@ drop table t1;
# Note that we are using the above table t9 here! # Note that we are using the above table t9 here!
# #
--replace_result $MYSQL_TEST_DIR TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW CREATE TABLE t9; SHOW CREATE TABLE t9;
disable_query_log; disable_query_log;
...@@ -84,11 +84,11 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p ...@@ -84,11 +84,11 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
# Should fail becasue the file t9.MYI already exist in 'run' # Should fail becasue the file t9.MYI already exist in 'run'
--error 1,1,1105 --error 1,1,1105
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQL_TEST_DIR/var/run"; eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run";
# Should fail becasue the file t9.MYD already exist in 'tmp' # Should fail becasue the file t9.MYD already exist in 'tmp'
--error 1,1 --error 1,1
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp"; eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp";
enable_query_log; enable_query_log;
# Check moving table t9 from default database to mysqltest; # Check moving table t9 from default database to mysqltest;
...@@ -96,7 +96,7 @@ enable_query_log; ...@@ -96,7 +96,7 @@ enable_query_log;
alter table t9 rename mysqltest.t9; alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9; select count(*) from mysqltest.t9;
--replace_result $MYSQL_TEST_DIR TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table mysqltest.t9; show create table mysqltest.t9;
drop database mysqltest; drop database mysqltest;
...@@ -106,18 +106,18 @@ drop database mysqltest; ...@@ -106,18 +106,18 @@ drop database mysqltest;
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
disable_query_log; disable_query_log;
eval alter table t1 data directory="$MYSQL_TEST_DIR/var/tmp"; eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
enable_query_log; enable_query_log;
--replace_result $MYSQL_TEST_DIR TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
alter table t1 add b int; alter table t1 add b int;
disable_query_log; disable_query_log;
eval alter table t1 data directory="$MYSQL_TEST_DIR/var/log"; eval alter table t1 data directory="$MYSQLTEST_VARDIR/log";
enable_query_log; enable_query_log;
--replace_result $MYSQL_TEST_DIR TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
disable_query_log; disable_query_log;
eval alter table t1 index directory="$MYSQL_TEST_DIR/var/log"; eval alter table t1 index directory="$MYSQLTEST_VARDIR/log";
enable_query_log; enable_query_log;
show create table t1; show create table t1;
drop table t1; drop table t1;
...@@ -127,12 +127,12 @@ drop table t1; ...@@ -127,12 +127,12 @@ drop table t1;
# have been chosen. (Bug #8707) # have been chosen. (Bug #8707)
# #
disable_query_log; disable_query_log;
eval create table t1 (i int) data directory = "$MYSQL_TEST_DIR/var/master-data/test/"; eval create table t1 (i int) data directory = "$MYSQLTEST_VARDIR/master-data/test/";
enable_query_log; enable_query_log;
show create table t1; show create table t1;
drop table t1; drop table t1;
disable_query_log; disable_query_log;
eval create table t1 (i int) index directory = "$MYSQL_TEST_DIR/var/master-data/test/"; eval create table t1 (i int) index directory = "$MYSQLTEST_VARDIR/master-data/test/";
enable_query_log; enable_query_log;
show create table t1; show create table t1;
drop table t1; drop table t1;
......
--tmpdir=$MYSQL_TEST_DIR/var//tmp --tmpdir=$MYSQLTEST_VARDIR//tmp
...@@ -61,8 +61,8 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 ...@@ -61,8 +61,8 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
--echo --echo
--echo ---> patching t1.TRG... --echo ---> patching t1.TRG...
--exec grep --text -v 'definers=' $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG > $MYSQL_TEST_DIR/var/tmp/t1.TRG --exec grep --text -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
--exec mv $MYSQL_TEST_DIR/var/tmp/t1.TRG $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG --exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
# #
# Create a new trigger. # Create a new trigger.
......
...@@ -449,9 +449,9 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1 ...@@ -449,9 +449,9 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1
FOR EACH ROW FOR EACH ROW
SET @a = 5; SET @a = 5;
--exec egrep --text -v '^definers=' $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG > $MYSQL_TEST_DIR/var/tmp/t1.TRG --exec egrep --text -v '^definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
--exec echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >> $MYSQL_TEST_DIR/var/tmp/t1.TRG --exec echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >> $MYSQLTEST_VARDIR/tmp/t1.TRG
--exec mv $MYSQL_TEST_DIR/var/tmp/t1.TRG $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG --exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
--echo --echo
......
...@@ -463,11 +463,11 @@ create trigger trg1 before insert on t1 for each row set new.k = new.i; ...@@ -463,11 +463,11 @@ create trigger trg1 before insert on t1 for each row set new.k = new.i;
create trigger trg2 after insert on t1 for each row set @b:= "Fired"; create trigger trg2 after insert on t1 for each row set @b:= "Fired";
set @b:=""; set @b:="";
# Test triggers with file with separators # Test triggers with file with separators
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i); load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
select *, @b from t1; select *, @b from t1;
set @b:=""; set @b:="";
# Test triggers with fixed size row file # Test triggers with fixed size row file
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
select *, @b from t1; select *, @b from t1;
# This also will drop triggers # This also will drop triggers
drop table t1; drop table t1;
...@@ -501,7 +501,7 @@ delete from t1 where i = 2; ...@@ -501,7 +501,7 @@ delete from t1 where i = 2;
select * from t1; select * from t1;
# Should fail and insert only 1 row # Should fail and insert only 1 row
--error 1054 --error 1054
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1; select * from t1;
--error 1054 --error 1054
insert into t1 select 3, 3; insert into t1 select 3, 3;
...@@ -561,7 +561,7 @@ select * from t1; ...@@ -561,7 +561,7 @@ select * from t1;
delete from t1; delete from t1;
select * from t1; select * from t1;
--error 1054 --error 1054
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1; select * from t1;
--error 1054 --error 1054
insert into t1 select 3, 3; insert into t1 select 3, 3;
......
...@@ -3,7 +3,7 @@ drop table if exists t1, t2; ...@@ -3,7 +3,7 @@ drop table if exists t1, t2;
--enable_warnings --enable_warnings
create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text); create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text);
system cp std_data/vchar.frm var/master-data/test/; system cp $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/;
truncate table vchar; truncate table vchar;
show create table t1; show create table t1;
show create table vchar; show create table vchar;
......
...@@ -15,7 +15,7 @@ show binlog events from 98; ...@@ -15,7 +15,7 @@ show binlog events from 98;
# absolutely need variables names to be quoted and strings to be # absolutely need variables names to be quoted and strings to be
# escaped). # escaped).
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1; drop table t1;
# End of 4.1 tests # End of 4.1 tests
...@@ -1221,11 +1221,11 @@ drop table t1; ...@@ -1221,11 +1221,11 @@ drop table t1;
create table t1 (a int, b char(10)); create table t1 (a int, b char(10));
create view v1 as select * from t1 where a != 0 with check option; create view v1 as select * from t1 where a != 0 with check option;
-- error 1369 -- error 1369
load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1; select * from t1;
select * from v1; select * from v1;
delete from t1; delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1; select * from t1;
select * from v1; select * from v1;
drop view v1; drop view v1;
...@@ -1234,11 +1234,11 @@ drop table t1; ...@@ -1234,11 +1234,11 @@ drop table t1;
create table t1 (a text, b text); create table t1 (a text, b text);
create view v1 as select * from t1 where a <> 'Field A' with check option; create view v1 as select * from t1 where a <> 'Field A' with check option;
-- error 1369 -- error 1369
load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1; select concat('|',a,'|'), concat('|',b,'|') from v1;
delete from t1; delete from t1;
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1; select concat('|',a,'|'), concat('|',b,'|') from v1;
drop view v1; drop view v1;
......
...@@ -50,7 +50,7 @@ drop table t1; ...@@ -50,7 +50,7 @@ drop table t1;
# #
create table t1(a tinyint, b int not null, c date, d char(5)); create table t1(a tinyint, b int not null, c date, d char(5));
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
# PS doesn't work good with @@warning_count # PS doesn't work good with @@warning_count
--disable_ps_protocol --disable_ps_protocol
select @@warning_count; select @@warning_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment