Commit e91ad6ab authored by Patrick Crews's avatar Patrick Crews

Bug#38311 - Fix of some cruft from remove_files in ndb_autodiscover.test,...

Bug#38311 - Fix of some cruft from remove_files in ndb_autodiscover.test, clean up of distinct.test,
and replacing error numbers with error names.
parents aecdac4a d85bc6d2
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.1-bugteam"
tree_name = "mysql-5.0-bugteam"
......@@ -608,6 +608,65 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
a a
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
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;
@v1 @v2
2 APPLE
SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
fruit_name HAVING fruit_name = 'APPLE';
SELECT @v3, @v4;
@v3 @v4
2 APPLE
SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
fruit_name = 'APPLE';
SELECT @v5, @v6, @v7, @v8;
@v5 @v6 @v7 @v8
3 PEAR 3 PEAR
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;
@v5 @v6 @v7 @v8 @v9 @v10
3 PEAR 3 PEAR 5 PEARAPPLE
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;
@v11 @v12 @v13 @v14
6 PEARPEAR 6 PEARPEAR
SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
SELECT @v15, @v16;
@v15 @v16
6 PEARPEAR
SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
'APPLE';
SELECT @v17, @v18;
@v17 @v18
4 Bob
DROP TABLE IF EXISTS t2;
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;
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;
SELECT @v19, @v20;
@v19 @v20
2 APPLE
SELECT * FROM t2;
fruit_id fruit_name
2 APPLE
2 APPLE
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (a CHAR(1));
INSERT INTO t1 VALUES('A'), (0);
SELECT a FROM t1 WHERE a=0;
......
......@@ -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;
#--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;
--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
......
......@@ -113,7 +113,7 @@ flush tables;
# Remove the frm file from disk
remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm ;
--error 1050
--error ER_TABLE_EXISTS_ERROR
create table t3(
id int not null primary key,
name char(20), a int, b float, c char(24)
......@@ -204,13 +204,13 @@ system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS
#
# Test that correct error is returned
--error 1146
--error ER_NO_SUCH_TABLE
select * from t4;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t4;
show status like 'handler_discover%';
--error 1051
--error ER_BAD_TABLE_ERROR
drop table t4;
create table t4(
......@@ -223,14 +223,14 @@ select * from t4;
# Remove the table from NDB
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t4;
drop table if exists t4;
# Test that dropping a table that does not exists
# on disk or in NDB gives same result as above
--error 1051
--error ER_BAD_TABLE_ERROR
drop table t5;
drop table if exists t5;
......@@ -257,7 +257,7 @@ system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS
SHOW TABLES;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t4;
#######################################################
......@@ -290,8 +290,8 @@ insert into t9 values (9);
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ;
# Remove t6, t7 from disk
remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm;
remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm;
SHOW TABLES;
......@@ -332,8 +332,8 @@ insert into t9 values (9);
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ;
# Remove t6, t7 from disk
remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm;
remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm;
SHOW TABLES LIKE 't6';
......@@ -342,9 +342,9 @@ show status like 'handler_discover%';
# Check that t3 or t5 can't be created
# frm files for these tables is stilll on disk
--error 1050
--error ER_TABLE_EXISTS_ERROR
create table t3(a int);
--error 1050
--error ER_TABLE_EXISTS_ERROR
create table t5(a int);
SHOW TABLES LIKE 't%';
......@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3");
insert into t4 values (4);
# Remove t1, t2, t3 from disk
remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ;
remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm;
remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm;
flush tables;
# Select from the table which only exists in NDB.
......@@ -462,7 +462,7 @@ show tables;
create database test2;
use test2;
show tables;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t1;
create table t2 (b int,c longblob) engine=ndb;
use test;
......@@ -487,7 +487,7 @@ create table t1 (a int primary key) engine=ndb;
select * from t1;
--exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
--error 1015
--error ER_CANT_LOCK
select * from t1;
--exec $NDB_MGM --no-defaults -e "all start" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
......@@ -503,17 +503,17 @@ drop database test_only_ndb_tables;
# discovered( for example a table created via NDBAPI)
# Test disabled since it doesn't work on case insensitive systems
#--error 1050
#--error ER_TABLE_EXISTS_ERROR
#CREATE TABLE sys.SYSTAB_0 (a int);
#--error 1105
#--error ER_UNKNOWN_ERROR
#select * from sys.SYSTAB_0;
#CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
#show warnings;
#--error 1105
#--error ER_UNKNOWN_ERROR
#select * from sys.SYSTAB_0;
#--error 1051
#--error ER_BAD_TABLE_ERROR
#drop table sys.SYSTAB_0;
#drop table IF EXISTS sys.SYSTAB_0;
......
......@@ -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 '"'
......
......@@ -24,7 +24,7 @@ set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
save_master_pos;
--error 1062
--error ER_DUP_ENTRY
insert into t1 values(1),(2);
drop table t1;
save_master_pos;
......
......@@ -80,7 +80,7 @@ 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'
......@@ -204,19 +204,19 @@ deallocate prepare stmt;
# Bug#32167 another privilege bypass with DATA/INDEX DIRECORY
#
--replace_result $MYSQL_TEST_DIR TEST_DIR
--error 1,1210
--error 1,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/test';
--replace_result $MYSQL_TEST_DIR TEST_DIR
--error 1,1210
--error 1,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/';
--replace_result $MYSQL_TEST_DIR TEST_DIR
--error 1,1210
--error 1,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data';
--replace_result $MYSQL_TEST_DIR TEST_DIR
--error 1,1210
--error 1,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data_var';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment