1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-22 23:02:58 +03:00

Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl

into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
This commit is contained in:
msvensson@pilot.mysql.com
2008-02-28 12:21:44 +01:00
306 changed files with 14244 additions and 18872 deletions

View File

@@ -1,6 +1,6 @@
# The server need to be started in $MYSQLTEST_VARDIR since it
# uses ../std_data_ln/
# uses ../../std_data/
-- source include/uses_vardir.inc
#
@@ -16,41 +16,41 @@ drop table if exists t1, t2, t3, t4;
--enable_warnings
create table t4(n int);
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
backup table t4 to '../bogus';
backup table t4 to '../tmp';
backup table t4 to '../../bogus';
backup table t4 to '../../tmp';
--replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
backup table t4 to '../tmp';
backup table t4 to '../../tmp';
drop table t4;
restore table t4 from '../tmp';
restore table t4 from '../../tmp';
select count(*) from t4;
create table t1(n int);
insert into t1 values (23),(45),(67);
backup table t1 to '../tmp';
backup table t1 to '../../tmp';
drop table t1;
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
restore table t1 from '../bogus';
restore table t1 from '../tmp';
restore table t1 from '../../bogus';
restore table t1 from '../../tmp';
select n from t1;
create table t2(m int not null primary key);
create table t3(k int not null primary key);
insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
backup table t2,t3 to '../tmp';
backup table t2,t3 to '../../tmp';
drop table t1,t2,t3;
restore table t1,t2,t3 from '../tmp';
restore table t1,t2,t3 from '../../tmp';
select n from t1;
select m from t2;
select k from t3;
drop table t1,t2,t3,t4;
restore table t1 from '../tmp';
restore table t1 from '../../tmp';
connection con2;
rename table t1 to t5;
--send
lock tables t5 write;
connection con1;
--send
backup table t5 to '../tmp';
backup table t5 to '../../tmp';
connection con2;
reap;
unlock tables;
@@ -80,11 +80,11 @@ DROP TABLE IF EXISTS `t+1`;
--enable_warnings
CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3);
BACKUP TABLE `t+1` TO '../tmp';
BACKUP TABLE `t+1` TO '../../tmp';
DROP TABLE `t+1`;
#
# Same for restore.
RESTORE TABLE `t+1` FROM '../tmp';
RESTORE TABLE `t+1` FROM '../../tmp';
SELECT * FROM `t+1`;
DROP TABLE `t+1`;

View File

@@ -6,6 +6,10 @@ drop table if exists t1;
--enable_warnings
# Add the datadir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR;
#
# Check that --bootstrap reads from stdin
#

View File

@@ -15,7 +15,7 @@ insert into t1 values(9);
SET SESSION debug="d,crash_commit_before";
# Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/master0.expect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Run the crashing query
--error 2013

View File

@@ -29,7 +29,8 @@ drop table if exists t1;
--enable_warnings
create table t1(a int) engine=myisam;
insert into t1 values(1);
--system rm -f $MYSQLTEST_VARDIR/master-data/test/t1.frm
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.frm;
--echo "We get an error because the table is in the definition cache"
--error ER_TABLE_EXISTS_ERROR
create table t1(a int, b int);

View File

@@ -1406,7 +1406,8 @@ DROP TABLE test_repair_table;
#
CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV;
--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/test/test_repair_table2.CSM
# Should give a warning and perform autorepair. We also disable ps-protocol
# here, as mysql-test eats up warnings in ps-protocol mode
@@ -1417,15 +1418,15 @@ SELECT * from test_repair_table2;
# this should work ok, as the table is already repaired
SELECT * from test_repair_table2;
# check that the metafile appeared again.
--file_exists $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
--file_exists $MYSQLD_DATADIR/test/test_repair_table2.CSM
CHECK TABLE test_repair_table2;
DROP TABLE test_repair_table2;
# Corrupt csv file and see if we can repair it
CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV;
--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
--remove_file $MYSQLD_DATADIR/test/test_repair_table3.CSV
--write_file $MYSQLD_DATADIR/test/test_repair_table3.CSV
"1"
"4"
"3
@@ -1444,7 +1445,7 @@ CREATE TABLE test_repair_table4 (
founded char(4) DEFAULT '' NOT NULL
) ENGINE = CSV;
--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM
--remove_file $MYSQLD_DATADIR/test/test_repair_table4.CSM
--disable_ps_protocol
SELECT * FROM test_repair_table4;
--enable_ps_protocol
@@ -1477,8 +1478,8 @@ CREATE TABLE test_repair_table5 (
) ENGINE = CSV;
# Corrupt a table -- put a file with wrong # of columns
--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
--remove_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
--write_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1489,7 +1490,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
SELECT * FROM test_repair_table5;
# Corrupt a table -- put a row with wrong # of columns at end of file
--append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1502,7 +1503,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
SELECT * FROM test_repair_table5;
# Corrupt table again -- put a row with wrong # of columns at end of file
--append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1585,14 +1586,14 @@ drop table t1;
create table bug15205 (val int(11) not null) engine=csv;
create table bug15205_2 (val int(11) not null) engine=csv;
--remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
--remove_file $MYSQLD_DATADIR/test/bug15205.CSV
# system error (can't open the datafile)
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 13
select * from bug15205;
select * from bug15205_2;
# Create empty file
--write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
--write_file $MYSQLD_DATADIR/test/bug15205.CSV
EOF
select * from bug15205;
drop table bug15205;
@@ -1631,16 +1632,16 @@ insert into bug22080_1 values(2,'string');
insert into bug22080_1 values(3,'string');
# Create first corrupt file as described in bug report
--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
--remove_file $MYSQLD_DATADIR/test/bug22080_2.CSV
--write_file $MYSQLD_DATADIR/test/bug22080_2.CSV
1,"string"
2","string"
3,"string"
EOF
# Create second corrupt file as described in bug report
--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
--remove_file $MYSQLD_DATADIR/test/bug22080_3.CSV
--write_file $MYSQLD_DATADIR/test/bug22080_3.CSV
1,"string"
"2",string"
3,"string"
@@ -1700,8 +1701,8 @@ check table t1;
drop table t1;
create table t1(a int not null, b int not null) engine=csv;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
--remove_file $MYSQLD_DATADIR/test/t1.CSV
--write_file $MYSQLD_DATADIR/test/t1.CSV
1, 1E-2
-2E2, .9
-10E-1, -.9

View File

@@ -75,11 +75,12 @@ create table t1 (a blob);
insert into t1 values (0xEE00);
select * into outfile 'test/t1.txt' from t1;
delete from t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt'));
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--eval select hex(load_file('$MYSQLD_DATADIR/test/t1.txt'));
load data infile 't1.txt' into table t1;
select hex(a) from t1;
--exec rm $MYSQLTEST_VARDIR/master-data/test/t1.txt
--remove_file $MYSQLD_DATADIR/test/t1.txt
drop table t1;
--echo End of 5.0 tests

View File

@@ -490,13 +490,13 @@ DROP TABLE t1;
#default NULL);
#
#SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
#'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
#'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2;
#--exec rm $MYSQL_TEST_DIR/var/tmp/data1.tmp
#
#SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
#'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
#'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2;
#--exec rm $MYSQL_TEST_DIR/var/tmp/data2.tmp
#
#SELECT @v19, @v20;

View File

@@ -1 +1 @@
--event-scheduler=on
--event-scheduler=on --force-restart

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
source include/have_archive.inc;
source include/federated.inc;
connection slave;
--disable_warnings
DROP TABLE IF EXISTS federated.archive_table;
--enable_warnings
CREATE TABLE federated.archive_table (
`id` int(4) NOT NULL,
`name` varchar(54) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(4) NOT NULL,
`name` varchar(54) default NULL,
PRIMARY KEY (`id`)
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/archive_table';
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'bar');
SELECT * FROM federated.t1;
--error 1296
DELETE FROM federated.t1 WHERE id = 1;
SELECT * FROM federated.t1;
--error 1296
UPDATE federated.t1 SET name='baz' WHERE id = 1;
SELECT * FROM federated.t1;
# --error 1296
# TRUNCATE federated.t1;
#
# SELECT * from federated.t1;
DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.archive_table;
source include/federated_cleanup.inc;

View File

@@ -1,44 +0,0 @@
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
source include/federated.inc;
connection slave;
--disable_warnings
DROP TABLE IF EXISTS federated.bug_13118_table;
--enable_warnings
CREATE TABLE federated.bug_13118_table (
`foo` integer,
`bar` integer
);
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`foo` integer,
`bar` integer
) ENGINE="FEDERATED"
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_13118_table';
SELECT * from federated.t1;
INSERT INTO federated.t1 VALUES (1,1);
SELECT * FROM federated.t1;
INSERT INTO federated.t1 VALUES (1,1);
SELECT * FROM federated.t1;
DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.bug_13118_table;
source include/federated_cleanup.inc;

View File

@@ -1,47 +0,0 @@
--source include/have_bug25714.inc
source include/federated.inc;
connection slave;
--disable_warnings
DROP TABLE IF EXISTS federated.bug_13118_table;
--enable_warnings
CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
`value` int
) ENGINE=MyISAM;
INSERT INTO federated.t1 SET value=1;
INSERT INTO federated.t1 SET value=2;
INSERT INTO federated.t1 SET value=2;
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
`value` int
) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
SELECT * from federated.t1;
INSERT INTO federated.t1 SET value=4;
SELECT LAST_INSERT_ID();
--exec $MYSQL_BUG25714 $SLAVE_MYPORT
--exec $MYSQL_BUG25714 $MASTER_MYPORT
SELECT * from federated.t1;
DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.t1;
source include/federated_cleanup.inc;

View File

@@ -1 +0,0 @@
--innodb

View File

@@ -1,34 +0,0 @@
source include/federated.inc;
source include/have_innodb.inc;
#
# Bug#25513 Federated transaction failures
#
connection slave;
create table federated.t1 (a int primary key, b varchar(64))
engine=myisam;
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create table federated.t1 (a int primary key, b varchar(64))
engine=federated
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
--error ER_DUP_KEY
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
select * from federated.t1;
connection slave;
truncate federated.t1;
alter table federated.t1 engine=innodb;
connection master;
--error ER_DUP_KEY
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
select * from federated.t1;
drop table federated.t1;
connection slave;
drop table federated.t1;
source include/federated_cleanup.inc;

View File

@@ -1,337 +0,0 @@
# WL #3031 This test tests the new servers table as well as
# if federated can utilise the servers table
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
-- source include/federated.inc
-- source include/big_test.inc
connection slave;
create database first_db;
create database second_db;
use first_db;
DROP TABLE IF EXISTS first_db.t1;
CREATE TABLE first_db.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS first_db.t2;
CREATE TABLE first_db.t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
use second_db;
DROP TABLE IF EXISTS second_db.t1;
CREATE TABLE second_db.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS second_db.t2;
CREATE TABLE second_db.t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
connection master;
drop server if exists 'server_one';
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create server 'server_one' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'first_db',
USER 'root',
PASSWORD '',
PORT $SLAVE_MYPORT,
SOCKET '',
OWNER 'root');
drop server if exists 'server_two';
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create server 'server_two' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'second_db',
USER 'root',
PASSWORD '',
PORT $SLAVE_MYPORT,
SOCKET '',
OWNER 'root');
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval select * from mysql.servers;
DROP TABLE IF EXISTS federated.old;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.old (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t1';
INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format');
SELECT * FROM federated.old;
DROP TABLE IF EXISTS federated.old2;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.old2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t2';
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format');
SELECT * FROM federated.old2;
DROP TABLE IF EXISTS federated.urldb2t1;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.urldb2t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t1';
INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format');
SELECT * FROM federated.urldb2t1;
DROP TABLE IF EXISTS federated.urldb2t2;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.urldb2t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t2';
INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format');
SELECT * FROM federated.urldb2t2;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='server_one';
INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme, first_db.t1');
SELECT * FROM federated.t1;
DROP TABLE IF EXISTS federated.whatever;
CREATE TABLE federated.whatever (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='server_one/t1';
INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1');
SELECT * FROM federated.whatever;
ALTER SERVER 'server_one' options(DATABASE 'second_db');
# FLUSH TABLES is now unneccessary
INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1');
SELECT * FROM federated.t1;
INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1');
SELECT * FROM federated.whatever;
drop table federated.t1;
drop server 'server_one';
drop server 'server_two';
select * from mysql.servers;
connection slave;
drop table first_db.t1;
drop table second_db.t1;
drop database first_db;
drop database second_db;
#
# Bug#25671 - CREATE/DROP/ALTER SERVER should require privileges
#
# Changes to SERVER declarations should require SUPER privilege.
# Based upon test case by Giuseppe Maxia
create database db_legitimate;
create database db_bogus;
use db_legitimate;
CREATE TABLE db_legitimate.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
);
INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate');
use db_bogus;
CREATE TABLE db_bogus.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
;
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT $SLAVE_MYPORT,
SOCKET '',
OWNER 'root');
create user guest_select@localhost;
grant select on federated.* to guest_select@localhost;
create user guest_super@localhost;
grant select,SUPER,RELOAD on *.* to guest_super@localhost;
create user guest_usage@localhost;
grant usage on *.* to guest_usage@localhost;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
) ENGINE = FEDERATED CONNECTION = 's1';
select * from federated.t1;
connect (conn_select,127.0.0.1,guest_select,,federated,$MASTER_MYPORT);
connect (conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT);
connect (conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT);
connection conn_select;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
alter server s1 options (database 'db_bogus');
connection master;
flush tables;
select * from federated.t1;
connection conn_usage;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
alter server s1 options (database 'db_bogus');
connection master;
flush tables;
select * from federated.t1;
connection conn_super;
alter server s1 options (database 'db_bogus');
connection master;
flush tables;
select * from federated.t1;
connection conn_select;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
drop server if exists 's1';
--replace_result $SLAVE_MYPORT SLAVE_PORT
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
eval create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT $SLAVE_MYPORT,
SOCKET '',
OWNER 'root');
connection conn_super;
drop server 's1';
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT $SLAVE_MYPORT,
SOCKET '',
OWNER 'root');
connection master;
flush tables;
select * from federated.t1;
# clean up test
connection slave;
drop database db_legitimate;
drop database db_bogus;
disconnect conn_select;
disconnect conn_usage;
disconnect conn_super;
connection master;
drop user guest_super@localhost;
drop user guest_usage@localhost;
drop user guest_select@localhost;
drop table federated.t1;
drop server 's1';
#
# Bug#30671 - ALTER SERVER causes the server to crash
#
create server 's1' foreign data wrapper 'mysql' options (port 3306);
alter server 's1' options
(host 'localhost', database '', user '',
password '', socket '', owner '', port 3306);
# The next statement would crash unpatched server
alter server 's1' options
(host 'localhost', database 'database1', user '',
password '', socket '', owner '', port 3306);
drop server 's1';
--echo # End of 5.1 tests
#
# Bug#25721 - deadlock with ALTER/CREATE SERVER
#
connect (other,localhost,root,,);
connection master;
use test;
delimiter //;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0;
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
SET i = sleep(5);
WHILE v < 10000 do
CREATE SERVER s
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
ALTER SERVER s OPTIONS (USER 'Remote');
DROP SERVER s;
SET v = v + 1;
END WHILE;
SELECT e > 0;
END//
delimiter ;//
connection other;
use test;
send call p1();
connection master;
call p1();
connection other;
reap;
drop procedure p1;
drop server if exists s;
source include/federated_cleanup.inc;

View File

@@ -1 +0,0 @@
--loose-innodb

View File

@@ -1,40 +0,0 @@
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
source include/have_innodb.inc;
source include/federated.inc;
connection slave;
DROP TABLE IF EXISTS federated.t1;
#SHOW ENGINES;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1 ENGINE=innodb;
connection master;
DROP TABLE IF EXISTS federated.t1;
# # correct connection, same named tables
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
set autocommit=0;
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
COMMIT;
INSERT INTO federated.t1 (id, name) VALUES (3, 'fie');
INSERT INTO federated.t1 (id, name) VALUES (4, 'fum');
ROLLBACK;
set autocommit=1;
INSERT INTO federated.t1 (id, name) VALUES (5, 'foe');
INSERT INTO federated.t1 (id, name) VALUES (6, 'fig');
SELECT * FROM federated.t1;
DELETE FROM federated.t1;
source include/federated_cleanup.inc;

View File

@@ -386,7 +386,7 @@ drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
alter table t1 disable keys;
--error 1263
load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
load data infile '../../std_data/bad_gis_data.dat' into table t1;
alter table t1 enable keys;
drop table t1;

View File

@@ -18,7 +18,7 @@
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ $VIEW_PROTOCOL > 0`)
{
--skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
--skip Need normal protocol
}
# The main testing script

View File

@@ -17,7 +17,7 @@
if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
OR $PS_PROTOCOL = 0`)
{
--skip Test requires: ps-protocol enabled, other protocols disabled
--skip Need ps-protocol
}
# The main testing script

View File

@@ -17,7 +17,8 @@
#
create database mysqltest;
create table mysqltest.t1(a int);
chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest;
let $MYSQLD_DATADIR= `select @@datadir`;
chmod 0000 $MYSQLD_DATADIR/mysqltest;
select table_schema from information_schema.tables where table_schema='mysqltest';
chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
chmod 0777 $MYSQLD_DATADIR/mysqltest;
drop database mysqltest;

View File

@@ -1162,7 +1162,7 @@ drop table t2;
# Test error handling
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_WRONG_FK_DEF
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
@@ -1355,7 +1355,7 @@ source include/varchar.inc;
#
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
create table t1 (v varchar(65530), key(v));
drop table t1;
create table t1 (v varchar(65536));
@@ -1630,7 +1630,7 @@ disconnect b;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1005
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
@@ -1642,7 +1642,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1005
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
@@ -1673,7 +1673,7 @@ set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-- error 1025
rename table t3 to t1;
set foreign_key_checks=1;
@@ -2301,7 +2301,7 @@ ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 1025
ALTER TABLE t2 MODIFY a INT NOT NULL;
DELETE FROM t1;

View File

@@ -0,0 +1 @@
--innodb --innodb_autoinc_lock_mode=0

View File

@@ -0,0 +1,68 @@
--source include/have_innodb.inc
--source include/have_partition.inc
--vertical_results
let $engine_type= 'innodb';
######## Creat Table Section #########
use test;
eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE=$engine_type
PARTITION BY RANGE(id)
SUBPARTITION BY hash(id) subpartitions 2
(PARTITION pa3 values less than (42),
PARTITION pa6 values less than (60),
PARTITION pa7 values less than (70),
PARTITION pa8 values less than (80),
PARTITION pa9 values less than (90),
PARTITION pa10 values less than (100),
PARTITION pa11 values less than MAXVALUE);
######## Create SPs, Functions, Views and Triggers Section ##############
delimiter |;
CREATE PROCEDURE test.proc_part()
BEGIN
DECLARE ins_count INT DEFAULT 1000;
DECLARE del_count INT;
DECLARE cur_user VARCHAR(255);
DECLARE local_uuid VARCHAR(255);
DECLARE local_time TIMESTAMP;
SET local_time= NOW();
SET cur_user= CURRENT_USER();
SET local_uuid= UUID();
WHILE ins_count > 0 DO
INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
ins_count,'Going to test MBR for MySQL');
SET ins_count = ins_count - 1;
END WHILE;
SELECT MAX(id) FROM test.part_tbl INTO del_count;
WHILE del_count > 0 DO
DELETE FROM test.part_tbl WHERE id = del_count;
select count(*) as internal_count, del_count -- these two lines are for
FROM test.part_tbl; -- debug to show the problem
SET del_count = del_count - 2;
END WHILE;
END|
delimiter ;|
############ Finish Setup Section ###################
############ Test Section ###################
--horizontal_results
CALL test.proc_part();
select count(*) as Part from test.part_tbl;
###### CLEAN UP SECTION ##############
DROP PROCEDURE test.proc_part;
DROP TABLE test.part_tbl;

View File

@@ -7,25 +7,25 @@ drop table if exists t1, t2;
--enable_warnings
create table t1 (a date, b date, c date not null, d date);
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1;
truncate table t1;
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1;
drop table t1;
create table t1 (a text, b text);
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
drop table t1;
create table t1 (a int, b char(10));
load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1;
truncate table t1;
load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
load data infile '../../std_data/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
select * from t1;
@@ -63,7 +63,7 @@ drop table t1;
# ENCLOSED
#
create table t1 (a varchar(20), b varchar(20));
load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
select * from t1;
drop table t1;
@@ -108,44 +108,44 @@ DROP TABLE t1,t2;
#
create table t1 (a int default 100, b int, c varchar(60));
# we can do something like this
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
truncate table t1;
# we can use filled fields in expressions
# we also assigning NULL value to field with non-NULL default here
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
select * from t1;
truncate table t1;
# we even can use variables in set clause, and missed columns will be set
# with default values
set @c:=123;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
select * from t1;
# let us test side-effect of such load
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1;
select @a, @b;
truncate table t1;
# Reading of all columns with set
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
load data infile '../../std_data/rpl_loaddata.dat' into table t1 set c=b;
select * from t1;
truncate table t1;
# now going to test fixed field-row file format
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1;
truncate table t1;
# this also should work
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));
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));
select * from t1;
# and this should bark
--error 1409
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
# Now let us test LOAD DATA with subselect
create table t2 (num int primary key, str varchar(10));
insert into t2 values (10,'Ten'), (15,'Fifteen');
truncate table t1;
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);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1;
#
@@ -262,6 +262,7 @@ select @@character_set_filesystem;
LOAD DATA INFILE 't@002d1' INTO TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t@002d1;
SET character_set_filesystem=default;
select @@character_set_filesystem;

View File

@@ -242,4 +242,5 @@ disconnect con1;
# Remove the log files that was created in the "default location"
# i.e var/run
--remove_file $MYSQLTEST_VARDIR/run/master.log
--remove_file $MYSQLTEST_VARDIR/run/mysqld.log
--remove_file $MYSQLTEST_VARDIR/run/mysqld-slow.log

View File

@@ -7,14 +7,15 @@ drop table if exists t1,t2;
--enable_warnings
create table t1 (a int) engine=myisam;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/test/t1.MYI
drop table if exists t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
--remove_file $MYSQLD_DATADIR/test/t1.MYI
--error 1051,6
drop table t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD
--remove_file $MYSQLD_DATADIR/test/t1.MYD
--error 1105,6,29
drop table t1;
--error 1051

View File

@@ -15,7 +15,8 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
--exec $MYSQL_UPGRADE --skip-verbose 2>&1
# It should have created a file in the MySQL Servers datadir
file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
let $MYSQLD_DATADIR= `select @@datadir`;
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Run it again - should say already completed
--replace_result $MYSQL_SERVER_VERSION VERSION
@@ -23,13 +24,13 @@ file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
--exec $MYSQL_UPGRADE --skip-verbose 2>&1
# It should have created a file in the MySQL Servers datadir
file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Force should run it regardless of wether it's been run before
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
# It should have created a file in the MySQL Servers datadir
file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
#

View File

@@ -13,7 +13,8 @@ create table t4 (f text character set cp932);
--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'<27>\');"
flush logs;
rename table t3 to t03, t4 to t04;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000002 | $MYSQL --default-character-set=utf8
let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000002 | $MYSQL --default-character-set=utf8
# original and recovered data must be equal
select HEX(f) from t03;
select HEX(f) from t3;

View File

@@ -4,6 +4,9 @@
-- source include/have_log_bin.inc
# Deletes all the binary logs
reset master;
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
@@ -23,11 +26,11 @@ insert into t2 values ();
# test for load data and load data distributed among the several
# files (we need to fill up first binlog)
load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../std_data_ln/words.dat' into table t1;
load data infile '../std_data_ln/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/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1;
# simple query to show more in second binlog
insert into t1 values ("Alas");
flush logs;
@@ -41,10 +44,10 @@ select "--- Local --" as "";
# We should use --short-form everywhere because in other case output will
# be time dependend. Better than nothing.
#
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001
# this should not fail but shouldn't produce any working statements
--disable_query_log
@@ -52,7 +55,7 @@ select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000002 2> /dev/null
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null
# this should show almost nothing
--disable_query_log
@@ -60,7 +63,7 @@ select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLTEST_VARDIR/log/master-bin.000001 2> /dev/null
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null
# this test for position option
--disable_query_log
@@ -68,7 +71,7 @@ select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLD_DATADIR/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -137,7 +140,7 @@ EOF
# must be digestable for both client and server. In 4.1 the client
# should use default-character-set same as the server.
flush logs;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000004 | $MYSQL
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
select * from t5 /* must be (1),(1) */;
drop table t5;
@@ -156,7 +159,7 @@ insert into t5 values (3, date_format('2001-01-01','%W'));
select * from t5 order by c1;
flush logs;
drop table t5;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL
select * from t5 order by c1;
drop table t5;
@@ -180,8 +183,8 @@ drop procedure p1;
--error 1305
call p1();
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL
call p1();
drop procedure p1;
@@ -200,23 +203,23 @@ drop procedure p1;
flush logs;
create table t1 (a varchar(64) character set utf8);
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r;
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=latin1;
load data infile '../std_data_ln/loaddata6.dat' into table t1;
load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
load data infile '../../std_data/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
drop table t1;
flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010
#
# Bug#28293 missed '#' sign in the hex dump when the dump length
@@ -229,7 +232,7 @@ flush logs;
INSERT INTO t1 VALUES ('0123456789');
flush logs;
DROP TABLE t1;
--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
#
# Bug #29928: incorrect connection_id() restoring from mysqlbinlog out
@@ -239,7 +242,7 @@ create table t1(a int);
insert into t1 values(connection_id());
let $a= `select a from t1`;
flush logs;
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
drop table t1;
connect (con1, localhost, root, , test);
connection con1;
@@ -263,8 +266,8 @@ exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTES
#
flush logs;
--error 1
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
--echo BUG#31611: Security risk with BINLOG statement
@@ -280,7 +283,7 @@ flush logs;
INSERT INTO t1 VALUES (1,USER());
flush logs;
echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql;
exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
connect (unsecure,localhost,untrusted,,mysqltest1);
echo mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql;
error 1;
@@ -313,7 +316,7 @@ query_vertical SELECT * FROM t1;
DROP TABLE t1;
echo >> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql;
exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql;
exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql;
echo >> mysql test < var/tmp/bug32580.sql;
exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug32580.sql;
remove_file $MYSQLTEST_VARDIR/tmp/bug32580.sql;

View File

@@ -40,34 +40,34 @@ select "--- Local --" as "";
# We should use --short-form everywhere because in other case output will
# be time dependent (the Start events). Better than nothing.
#
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /[[:<:]][0-9]{6} [0-9 ][0-9]:[0-9]{2}:[0-9]{2}[[:>:]]/{yymmdd} {HH:MM:SS}/ /=[0-9]+ /={integer} / /# at [0-9]+/# at {pos}/ /(pos:?) [0-9]+/\1 {pos}/ /binlog v [0-9]+, server v [^ ]* created/binlog v #, server v ## created/
--exec $MYSQL_BINLOG --base64-output=never $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --base64-output=never $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- Local with 2 binlogs on command line --" as "";
@@ -76,28 +76,28 @@ select "--- Local with 2 binlogs on command line --" as "";
# This is to verify that some options apply only to first, or last binlog
flush logs;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--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
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--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
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- Remote --" as "";

View File

@@ -10,13 +10,14 @@ update t1 set a=a+2 where a=2;
update t1 set a=a+2 where a=3;
create table t2 (word varchar(20));
load data infile '../std_data_ln/words.dat' into table t2;
load data infile '../../std_data/words.dat' into table t2;
#
# Save binlog
#
let $MYSQLD_DATADIR=`select @@datadir`;
flush logs;
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
#
# Clear database and restore from binlog
@@ -38,7 +39,7 @@ select * from t2;
flush logs;
drop table t2;
create table t2 (word varchar(20));
load data infile '../std_data_ln/words.dat' into table t2;
load data infile '../../std_data/words.dat' into table t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
@@ -51,7 +52,7 @@ insert into t2 select * from t2;
select count(*) from t2;
flush logs;
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
#
@@ -62,6 +63,6 @@ select count(*) from t2;
#
# Test cleanup
#
--exec rm $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
drop table t1;
drop table t2;

View File

@@ -1637,7 +1637,7 @@ select * from t2;
# Now we test with multiple threads, but less threads than files.
create table words(a varchar(255));
create table words2(b varchar(255));
--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat
--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat
select * from t1;
select * from t2;
select * from words;
@@ -1647,7 +1647,7 @@ select * from words2;
drop table words;
--replace_regex /.*mysqlimport(\.exe)*/mysql-import/
--error 1
--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat 2>&1
--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1
drop table t1;
drop table t2;

View File

@@ -1,7 +1,7 @@
disable_query_log;
-- source include/test_outfile.inc
# Server are started in "var/master-data", so "../tmp" will be "var/tmp"
eval set @tmpdir="../tmp";
# Server are started in "var/master-data", so "../../tmp" will be "var/tmp"
eval set @tmpdir="../../tmp";
enable_query_log;
-- source include/have_outfile.inc
@@ -16,15 +16,15 @@ drop table if exists t1;
create table t1 (`a` blob);
insert into t1 values("hello world"),("Hello mars"),(NULL);
disable_query_log;
eval select * into outfile "../tmp/outfile-test.1" from t1;
eval select * into outfile "../../tmp/outfile-test.1" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.1"));
disable_query_log;
eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1;
eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.2"));
disable_query_log;
eval select * into dumpfile "../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;
select load_file(concat(@tmpdir,"/outfile-test.3"));
@@ -32,13 +32,13 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
disable_query_log;
--error 1086
eval select * into outfile "../tmp/outfile-test.1" from t1;
eval select * into outfile "../../tmp/outfile-test.1" from t1;
--error 1086
eval select * into dumpfile "../tmp/outfile-test.2" from t1;
eval select * into dumpfile "../../tmp/outfile-test.2" from t1;
--error 1086
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
eval select * into dumpfile "../../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
@@ -48,7 +48,7 @@ drop table t1;
# Bug#8191
disable_query_log;
eval select 1 into outfile "../tmp/outfile-test.4";
eval select 1 into outfile "../../tmp/outfile-test.4";
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.4"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
@@ -71,7 +71,7 @@ DROP TABLE t1;
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
#
disable_query_log;
eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
@@ -79,7 +79,7 @@ FROM information_schema.schemata LIMIT 0, 5;
use information_schema;
# disable_query_log;
eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
@@ -107,7 +107,7 @@ connect (con28181_1,localhost,user_1,,mysqltest);
--error 1044
eval select schema_name
into outfile "../tmp/outfile-test.4"
into outfile "../../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
lines terminated by '\n'
from information_schema.schemata
@@ -118,7 +118,7 @@ grant file on *.* to user_1@localhost;
connect (con28181_2,localhost,user_1,,mysqltest);
eval select schema_name
into outfile "../tmp/outfile-test.4"
into outfile "../../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
lines terminated by '\n'
from information_schema.schemata

View File

@@ -1402,13 +1402,15 @@ drop table t1, t2;
# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables
#
let $MYSQLD_DATADIR= `select @@datadir`;
disable_query_log;
eval create table t2 (i int )
partition by range (i)
(
partition p01 values less than (1000)
data directory="$MYSQLTEST_VARDIR/master-data/test/"
index directory="$MYSQLTEST_VARDIR/master-data/test/"
data directory="$MYSQLD_DATADIR/test/"
index directory="$MYSQLD_DATADIR/test/"
);
enable_query_log;

View File

@@ -103,7 +103,8 @@ partitions 3
partition x2 tablespace ts2,
partition x3 tablespace ts3);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
let $MYSQLD_DATADIR= `select @@datadir`;
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, invalid field in function
#
@@ -199,7 +200,7 @@ partition by hash (a)
partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, values in error
@@ -214,7 +215,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4),
partition x2 values in (5));
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, values in error
@@ -229,7 +230,7 @@ partition by hash (a)
partitions 2
(partition x1 values in (4,6),
partition x2 values in (5,7));
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -242,7 +243,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -255,7 +256,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -268,7 +269,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, single field
@@ -281,7 +282,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by key, no partitions defined, list of fields
@@ -294,7 +295,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by key (a, b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined
@@ -307,7 +308,7 @@ c int not null,
primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -334,7 +335,7 @@ partition by key (a)
subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -363,7 +364,7 @@ partition by range (a)
subpartition by key (a,d)
(partition x1 values less than (1) (subpartition x11, subpartition x12),
partition x2 values less than (2) (subpartition x21, subpartition x22));
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
@@ -401,7 +402,7 @@ b int not null,
c int not null,
primary key(a,b))
partition by range (a);
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by range, invalid field in function

View File

@@ -3,7 +3,7 @@
#
-- source include/have_partition.inc
-- source include/not_embedded.inc
-- source include/have_federated_db.inc
-- source suite/federated/have_federated_db.inc
--disable_warnings
drop table if exists t1;

View File

@@ -22,18 +22,19 @@ drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
let $MYSQLD_DATADIR= `select @@datadir`;
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
-- file_exists $MYSQLD_DATADIR/test/t1.frm
-- file_exists $MYSQLD_DATADIR/test/t1.par
ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
-- file_exists $MYSQLD_DATADIR/test/t1.frm
-- file_exists $MYSQLD_DATADIR/test/t1.par
drop table t1;
#
# Bug 20767: REORGANIZE partition crashes

View File

@@ -12,16 +12,17 @@
# doesn't remove old directory
--disable_query_log
--exec mkdir $MYSQLTEST_VARDIR/master-data/tmpdata || true
eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/master-data/tmpdata''';
let $MYSQLD_DATADIR= `select @@datadir`;
--exec mkdir $MYSQLD_DATADIR/tmpdata || true
eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLD_DATADIR/tmpdata''';
let $data_directory = `select @data_dir`;
--exec mkdir $MYSQLTEST_VARDIR/master-data/tmpinx || true
eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/master-data/tmpinx''';
--exec mkdir $MYSQLD_DATADIR/tmpinx || true
eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLD_DATADIR/tmpinx''';
let $inx_directory = `select @inx_dir`;
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval create table t1 (a int) engine myisam
partition by range (a)
subpartition by hash (a)
@@ -29,18 +30,18 @@ subpartition by hash (a)
(SUBPARTITION subpart00, SUBPARTITION subpart01));
--echo Checking if file exists before alter
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p0#SP#subpart00.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p0#SP#subpart01.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p0#SP#subpart00.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p0#SP#subpart01.MYI
--file_exists $MYSQLD_DATADIR/test/t1.frm
--file_exists $MYSQLD_DATADIR/test/t1.par
--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYI
--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYI
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p0#SP#subpart00.MYD
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p0#SP#subpart01.MYD
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p0#SP#subpart00.MYI
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p0#SP#subpart01.MYI
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(partition p1 VALUES LESS THAN (1) $data_directory $inx_directory
(SUBPARTITION subpart10, SUBPARTITION subpart11),
@@ -48,28 +49,28 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(SUBPARTITION subpart20, SUBPARTITION subpart21));
--echo Checking if file exists after alter
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p1#SP#subpart10.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p1#SP#subpart11.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p2#SP#subpart20.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p2#SP#subpart21.MYD
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p1#SP#subpart10.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI
--file_exists $MYSQLD_DATADIR/test/t1.frm
--file_exists $MYSQLD_DATADIR/test/t1.par
--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYI
--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYI
--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYI
--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYD
--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYI
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p1#SP#subpart10.MYD
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p1#SP#subpart11.MYD
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p2#SP#subpart20.MYD
--file_exists $MYSQLD_DATADIR/tmpdata/t1#P#p2#SP#subpart21.MYD
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p1#SP#subpart10.MYI
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p1#SP#subpart11.MYI
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p2#SP#subpart20.MYI
--file_exists $MYSQLD_DATADIR/tmpinx/t1#P#p2#SP#subpart21.MYI
drop table t1;
--exec rmdir $MYSQLTEST_VARDIR/master-data/tmpdata || true
--exec rmdir $MYSQLTEST_VARDIR/master-data/tmpinx || true
--exec rmdir $MYSQLD_DATADIR/tmpdata || true
--exec rmdir $MYSQLD_DATADIR/tmpinx || true
# End Windows specific test failures.

View File

@@ -35,21 +35,22 @@ DROP DATABASE IF EXISTS mysqltest2;
connect(con1,localhost,mysqltest_1,,);
-- echo # user mysqltest_1:
USE test;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
DATA DIRECTORY '$MYSQLD_DATADIR/mysqltest2'
INDEX DIRECTORY '$MYSQLD_DATADIR/mysqltest2',
PARTITION p1 VALUES IN (1)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test',
DATA DIRECTORY '$MYSQLD_DATADIR/test'
INDEX DIRECTORY '$MYSQLD_DATADIR/test',
PARTITION p2 VALUES IN (2)
);
-- echo # without the patch for bug#32091 this would create
-- echo # files mysqltest2/t1.MYD + .MYI and possible overwrite
-- echo # the mysqltest2.t1 table (depending on bug#32111)
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
ALTER TABLE t1 REMOVE PARTITIONING;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
@@ -76,40 +77,41 @@ connection default;
-- echo # user root:
CREATE DATABASE mysqltest2;
USE mysqltest2;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
DATA DIRECTORY '$MYSQLD_DATADIR/mysqltest2'
INDEX DIRECTORY '$MYSQLD_DATADIR/mysqltest2',
PARTITION p1 VALUES IN (1)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
DATA DIRECTORY '$MYSQLD_DATADIR/test'
INDEX DIRECTORY '$MYSQLD_DATADIR/test'
);
connection con1;
-- echo # user mysqltest_1:
USE test;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-- error 1,1
eval CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
DATA DIRECTORY '$MYSQLD_DATADIR/mysqltest2'
INDEX DIRECTORY '$MYSQLD_DATADIR/mysqltest2',
PARTITION p1 VALUES IN (1)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
DATA DIRECTORY '$MYSQLD_DATADIR/test'
INDEX DIRECTORY '$MYSQLD_DATADIR/test'
);
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-- error 1,1
eval CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test',
DATA DIRECTORY '$MYSQLD_DATADIR/test'
INDEX DIRECTORY '$MYSQLD_DATADIR/test',
PARTITION p1 VALUES IN (1)
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
DATA DIRECTORY '$MYSQLD_DATADIR/mysqltest2'
INDEX DIRECTORY '$MYSQLD_DATADIR/mysqltest2'
);
connection default;
-- echo # user root (cleanup):

View File

@@ -577,7 +577,7 @@ prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ;
# rename must fail, t7 does not exist
# Clean up the filename here because embedded server reports whole path
--replace_result $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;

View File

@@ -423,7 +423,7 @@ create table t1 (word char(20) not null);
select * from t1;
show status like "Qcache_queries_in_cache";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1;
eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
select count(*) from t1;
drop table t1;

View File

@@ -29,7 +29,8 @@ repair table t1 use_frm;
create table t1 engine=myisam SELECT 1,"table 1";
flush tables;
system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
let $MYSQLD_DATADIR= `select @@datadir`;
system echo 1 > $MYSQLD_DATADIR/test/t1.MYI ;
repair table t1;
repair table t1 use_frm;
drop table t1;

View File

@@ -422,14 +422,15 @@ DROP TABLE t1;
flush tables;
# Create a junk frm file on disk
system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
let $MYSQLD_DATADIR= `select @@datadir`;
system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
--replace_column 6 # 7 # 8 # 9 #
SHOW TABLE STATUS like 't1';
--error 1033
show create table t1;
drop table if exists t1;
--error 1,0
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
--remove_file $MYSQLD_DATADIR/test/t1.frm
#
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar

View File

@@ -13,9 +13,10 @@
-- source include/not_embedded.inc
# Backup proc table
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD
--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI
use test;
@@ -50,8 +51,8 @@ insert into t1 values (0);
flush table mysql.proc;
# Thrashing the .frm file
--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--remove_file $MYSQLD_DATADIR/mysql/proc.frm
--write_file $MYSQLD_DATADIR/mysql/proc.frm
saljdfa
EOF
--replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/'
@@ -67,9 +68,9 @@ insert into t1 values (0);
flush table mysql.proc;
# Drop the mysql.proc table
--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
--remove_file $MYSQLD_DATADIR/mysql/proc.frm
--remove_file $MYSQLD_DATADIR/mysql/proc.MYD
--remove_file $MYSQLD_DATADIR/mysql/proc.MYI
--error ER_NO_SUCH_TABLE
call bug14233();
--error ER_NO_SUCH_TABLE
@@ -78,9 +79,9 @@ create view v1 as select bug14233_f();
insert into t1 values (0);
# Restore mysql.proc
--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLD_DATADIR/mysql/proc.frm
--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD
--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI
--remove_file $MYSQLTEST_VARDIR/tmp/proc.frm
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI

View File

@@ -703,7 +703,7 @@ drop procedure into_test4|
--disable_warnings
drop procedure if exists into_outfile|
--enable_warnings
--replace_result $MYSQLTEST_VARDIR ..
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -722,7 +722,7 @@ drop procedure into_outfile|
--disable_warnings
drop procedure if exists into_dumpfile|
--enable_warnings
--replace_result $MYSQLTEST_VARDIR ..
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -5260,9 +5260,9 @@ drop procedure if exists bug13012|
create procedure bug13012()
BEGIN
REPAIR TABLE t1;
BACKUP TABLE t1 to '../tmp';
BACKUP TABLE t1 to '../../tmp';
DROP TABLE t1;
RESTORE TABLE t1 FROM '../tmp';
RESTORE TABLE t1 FROM '../../tmp';
END|
call bug13012()|
--enable_warnings

View File

@@ -123,11 +123,12 @@ drop table t1;
#
# BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE
#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
DATA DIRECTORY='$MYSQLD_DATADIR/mysql'
INDEX DIRECTORY='$MYSQLD_DATADIR/mysql';
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
--error 1
RENAME TABLE t1 TO user;
DROP TABLE t1;
@@ -137,12 +138,12 @@ DROP TABLE t1;
# have been chosen. (Bug #8707)
#
disable_query_log;
eval create table t1 (i int) data directory = "$MYSQLTEST_VARDIR/master-data/test/";
eval create table t1 (i int) data directory = "$MYSQLD_DATADIR/test/";
enable_query_log;
show create table t1;
drop table t1;
disable_query_log;
eval create table t1 (i int) index directory = "$MYSQLTEST_VARDIR/master-data/test/";
eval create table t1 (i int) index directory = "$MYSQLD_DATADIR/test/";
enable_query_log;
show create table t1;
drop table t1;
@@ -196,7 +197,7 @@ CREATE DATABASE db2;
USE db2;
--disable_query_log
eval CREATE TABLE t1 (b INT) ENGINE MYISAM
DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/';
DATA DIRECTORY = '$MYSQLD_DATADIR/db1/';
--enable_query_log
INSERT INTO db2.t1 VALUES (1);

View File

@@ -6,11 +6,6 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
# First delete some tables maybe left over from previous tests
--disable_warnings
drop table if exists t1,t1aa,t2aa;
--enable_warnings
-- disable_query_log
use mysql;
-- enable_query_log

View File

@@ -21,10 +21,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
--disable_warnings
drop table if exists t1,t1aa,t2aa;
--enable_warnings
-- disable_result_log
-- disable_query_log

View File

@@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
--disable_warnings
drop table if exists t1,t1aa,t2aa;
--enable_warnings
-- disable_result_log
-- disable_query_log

View File

@@ -11,10 +11,6 @@
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
--disable_warnings
drop table if exists t1,t1aa,t2aa;
--enable_warnings
-- disable_result_log
-- disable_query_log

View File

@@ -11,10 +11,6 @@
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
--disable_warnings
drop table if exists t1,t1aa,t2aa;
--enable_warnings
-- disable_result_log
-- disable_query_log

View File

@@ -60,8 +60,9 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
--echo
--echo ---> patching t1.TRG...
--exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
let $MYSQLD_DATADIR= `select @@datadir`;
--exec grep -v 'definers=' $MYSQLD_DATADIR/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLD_DATADIR/mysqltest_db1/t1.TRG
#
# Create a new trigger.

View File

@@ -472,11 +472,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";
set @b:="";
# Test triggers with file with separators
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i);
select *, @b from t1;
set @b:="";
# Test triggers with fixed size row file
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
select *, @b from t1;
# This also will drop triggers
drop table t1;
@@ -510,7 +510,7 @@ delete from t1 where i = 2;
select * from t1;
# Should fail and insert only 1 row
--error ER_BAD_FIELD_ERROR
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1;
--error ER_BAD_FIELD_ERROR
insert into t1 select 3, 3;
@@ -567,7 +567,7 @@ select * from t1;
delete from t1;
select * from t1;
--error ER_BAD_FIELD_ERROR
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
select * from t1;
--error ER_BAD_FIELD_ERROR
insert into t1 select 3, 3;
@@ -1142,12 +1142,13 @@ select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
where event_object_schema = 'test';
# Trick which makes update of second .TRN file impossible
write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
let $MYSQLD_DATADIR= `select @@datadir`;
write_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
dummy
EOF
chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
chmod 0000 $MYSQLD_DATADIR/test/t1_ai.TRN~;
# Normalize the datadir path; the embedded server doesn't chdir to datadir
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error 1
rename table t1 to t2;
# 't1' should be still there and triggers should work correctly
@@ -1156,8 +1157,8 @@ select @a, @b;
select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
where event_object_schema = 'test';
chmod 0600 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
remove_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
chmod 0600 $MYSQLD_DATADIR/test/t1_ai.TRN~;
remove_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
# Let us check that updates to .TRN files were rolled back too
drop trigger t1_bi;
drop trigger t1_ai;
@@ -1190,7 +1191,7 @@ insert into t1 (a) values
create trigger t2_ai after insert on t2 for each row
set @a:= (select max(a) from t2);
insert into t2 select * from t1;
load data infile '../std_data_ln/words.dat' into table t1 (a);
load data infile '../../std_data/words.dat' into table t1 (a);
drop trigger t1_ai;
drop trigger t2_ai;
# Test that the problem for functions is fixed as well
@@ -1200,7 +1201,7 @@ insert into t1 values
("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
create function f2() returns int return (select max(b) from t2);
insert into t2 select a, f2() from t1;
load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
load data infile '../../std_data/words.dat' into table t1 (a) set b:= f1();
drop function f1;
drop function f2;
drop table t1, t2;

View File

@@ -360,10 +360,11 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1
SET @a = 5;
# Replace definers with the "weird" definers
let MYSQLD_DATADIR= `select @@datadir`;
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/master-data/mysqltest_db1/t1.TRG";
my $fname= "$ENV{'MYSQLD_DATADIR'}/mysqltest_db1/t1.TRG";
open(FILE, "<", $fname) or die;
my @content= grep($_ !~ /^definers=/, <FILE>);
close FILE;

View File

@@ -308,20 +308,20 @@ create table t1 (id integer auto_increment unique,imagem LONGBLOB not null defau
insert into t1 (id) values (1);
# We have to clean up the path in the results for safe comparison
eval select
charset(load_file('../std_data_ln/words.dat')),
collation(load_file('../std_data_ln/words.dat')),
coercibility(load_file('../std_data_ln/words.dat'));
charset(load_file('../../std_data/words.dat')),
collation(load_file('../../std_data/words.dat')),
coercibility(load_file('../../std_data/words.dat'));
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval explain extended select
charset(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
collation(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')),
coercibility(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat'));
charset(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')),
collation(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')),
coercibility(load_file('$MYSQLTEST_VARDIR/std_data/words.dat'));
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1;
eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
drop table t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') l;
eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data/words.dat') l;
# We mask out the Privileges column because it differs for embedded server
--replace_column 8 #
show full fields from t1;

View File

@@ -3,7 +3,8 @@ drop table if exists t1, t2;
--enable_warnings
create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text);
copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/vchar.frm;
let $MYSQLD_DATADIR= `select @@datadir`;
copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLD_DATADIR/test/vchar.frm;
truncate table vchar;
show create table t1;
show create table vchar;
@@ -162,8 +163,8 @@ create table t3 (
en varchar(255) character set utf8,
cz varchar(255) character set utf8
);
remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm;
copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLTEST_VARDIR/master-data/test/t3.frm;
remove_file $MYSQLD_DATADIR/test/t3.frm;
copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLD_DATADIR/test/t3.frm;
truncate table t3;
insert into t3 (id, en, cz) values
(1,'en string 1','cz string 1'),

View File

@@ -52,7 +52,8 @@ drop table `txu#p#p1`;
# Check if old tables work
#
system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
let $MYSQLD_DATADIR= `select @@datadir`;
system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLD_DATADIR/test/t1.frm;
truncate t1;
drop table t1;
@@ -70,11 +71,11 @@ create table tabc.t1 (a int);
FLUSH TABLES;
# Manually make a 5.0 database from the template
--mkdir $MYSQLTEST_VARDIR/master-data/a-b-c
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/db.opt $MYSQLTEST_VARDIR/master-data/a-b-c/db.opt
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.frm $MYSQLTEST_VARDIR/master-data/a-b-c/t1.frm
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYD $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYD
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYI $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYI
--mkdir $MYSQLD_DATADIR/a-b-c
--copy_file $MYSQLD_DATADIR/tabc/db.opt $MYSQLD_DATADIR/a-b-c/db.opt
--copy_file $MYSQLD_DATADIR/tabc/t1.frm $MYSQLD_DATADIR/a-b-c/t1.frm
--copy_file $MYSQLD_DATADIR/tabc/t1.MYD $MYSQLD_DATADIR/a-b-c/t1.MYD
--copy_file $MYSQLD_DATADIR/tabc/t1.MYI $MYSQLD_DATADIR/a-b-c/t1.MYI
show databases like '%a-b-c%';
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;

View File

@@ -16,9 +16,9 @@ source include/show_binlog_events.inc;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $MYSQLD_DATADIR= `select @@datadir`;
flush logs;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
drop table t1;
# End of 4.1 tests

View File

@@ -47,12 +47,13 @@ drop table t1;
#
# Test with a saved table from 4.1
copy_file std_data/bug19371.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.frm;
copy_file std_data/bug19371.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
copy_file std_data/bug19371.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
let $MYSQLD_DATADIR= `select @@datadir`;
copy_file std_data/bug19371.frm $MYSQLD_DATADIR/test/t1.frm;
chmod 0777 $MYSQLD_DATADIR/test/t1.frm;
copy_file std_data/bug19371.MYD $MYSQLD_DATADIR/test/t1.MYD;
chmod 0777 $MYSQLD_DATADIR/test/t1.MYD;
copy_file std_data/bug19371.MYI $MYSQLD_DATADIR/test/t1.MYI;
chmod 0777 $MYSQLD_DATADIR/test/t1.MYI;
# Everything _looks_ fine
show create table t1;

View File

@@ -1228,11 +1228,11 @@ drop table t1;
create table t1 (a int, b char(10));
create view v1 as select * from t1 where a != 0 with check option;
-- error 1369
load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1;
select * from v1;
delete from t1;
load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
select * from t1 order by a,b;
select * from v1 order by a,b;
drop view v1;
@@ -1241,11 +1241,11 @@ drop table t1;
create table t1 (a text, b text);
create view v1 as select * from t1 where a <> 'Field A' with check option;
-- error 1369
load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1;
delete from t1;
load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
select concat('|',a,'|'), concat('|',b,'|') from v1;
drop view v1;

View File

@@ -50,7 +50,7 @@ drop table t1;
#
create table t1(a tinyint, b int not null, c date, d char(5));
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
# PS doesn't work good with @@warning_count
--disable_ps_protocol
select @@warning_count;