summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorPatrick Crews <patrick.crews@sun.com>2008-09-30 15:32:35 -0400
committerPatrick Crews <patrick.crews@sun.com>2008-09-30 15:32:35 -0400
commit446fd5044c5fa3cdab7d9d057d1a983430662a51 (patch)
treea8fc373533c7115c1892a90aaa1d69c37f11e62a /mysql-test/t
parent0d24398697469deebd2b58cb16e355c09febbebc (diff)
parent8c33da076ef884a5a0c92b5e661df43ad5991631 (diff)
downloadmariadb-git-446fd5044c5fa3cdab7d9d057d1a983430662a51.tar.gz
Merge 5.0 -> 5.1
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ctype_big5.test3
-rw-r--r--mysql-test/t/distinct.test128
-rw-r--r--mysql-test/t/outfile.test12
-rw-r--r--mysql-test/t/symlink.test12
4 files changed, 77 insertions, 78 deletions
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 0ed21091110..5a8a13f2bad 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -79,7 +79,8 @@ delete from t1;
--eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/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 $MYSQLTEST_VARDIR/master-data/test/t1.txt
+
drop table t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 559dde44b81..a569b765872 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -438,72 +438,70 @@ EXPLAIN SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
DROP TABLE t1;
-# The test case for bug#20836 should be re-enabled when bug#16861 is resolved
-# The results for the test should be the same as in 4.1.
-#
+
#Bug #20836: Selecting into variables results in wrong results being returned
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t1;
-#--enable_warnings
-#
-#CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
-#default NULL);
-#
-#INSERT INTO t1 VALUES (1,1,'ORANGE');
-#INSERT INTO t1 VALUES (2,2,'APPLE');
-#INSERT INTO t1 VALUES (3,2,'APPLE');
-#INSERT INTO t1 VALUES (4,3,'PEAR');
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v1, @v2;
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
-#fruit_name HAVING fruit_name = 'APPLE';
-#SELECT @v3, @v4;
-#
-#SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
-#fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8;
-#
-#SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
-#WHERE fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8, @v9, @v10;
-#
-#SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
-#@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v11, @v12, @v13, @v14;
-#
-#SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v15, @v16;
-#
-#SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v17, @v18;
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t2;
-#--enable_warnings
-#
-#CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
-#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;
-#--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;
-#--exec rm $MYSQL_TEST_DIR/var/tmp/data2.tmp
-#
-#SELECT @v19, @v20;
-#SELECT * FROM t2;
-#
-#DROP TABLE t1;
-#DROP TABLE t2;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+
+INSERT INTO t1 VALUES (1,1,'ORANGE');
+INSERT INTO t1 VALUES (2,2,'APPLE');
+INSERT INTO t1 VALUES (3,2,'APPLE');
+INSERT INTO t1 VALUES (4,3,'PEAR');
+
+SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v1, @v2;
+
+SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
+fruit_name HAVING fruit_name = 'APPLE';
+SELECT @v3, @v4;
+
+SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
+fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8;
+
+SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
+WHERE fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8, @v9, @v10;
+
+SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
+@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v11, @v12, @v13, @v14;
+
+SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v15, @v16;
+
+SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v17, @v18;
+
+--disable_warnings
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
+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;
+--remove_file $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;
+--remove_file $MYSQL_TEST_DIR/var/tmp/data2.tmp
+
+SELECT @v19, @v20;
+SELECT * FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
#
# Bug #15881: cast problems
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 2b80b0b9d93..527a4d398d8 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -31,13 +31,13 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
# the following should give errors
disable_query_log;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into outfile "../tmp/outfile-test.1" from t1;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into dumpfile "../tmp/outfile-test.2" from t1;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
@@ -92,7 +92,7 @@ use test;
# It should not be possible to write to a file outside of vardir
create table t1(a int);
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1;
drop table t1;
@@ -105,7 +105,7 @@ create user user_1@localhost;
grant all on mysqltest.* to user_1@localhost;
connect (con28181_1,localhost,user_1,,mysqltest);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
eval select schema_name
into outfile "../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
@@ -125,7 +125,7 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 1371a470ffd..3c7e9b658f3 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -74,12 +74,12 @@ create database mysqltest;
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
# temporarily disabled as it returns different result in the embedded server
-# --error 1210, 1210
+# --error ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS
# create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
# Should fail becasue the file t9.MYI already exist in 'run'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1,1,1105
+--error 1,1,ER_UNKNOWN_ERROR
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'
@@ -195,19 +195,19 @@ DROP TABLE t1;
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
--replace_result $MYSQLTEST_VARDIR TEST_DIR