summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-05-14 00:01:40 +0300
committerunknown <monty@mysql.com>2005-05-14 00:01:40 +0300
commit037b0a7b14288f078bb3e6e75c14b4fc3181b4f0 (patch)
treef66bb31f8c3bb3a7c23d82b86abf8f0810f05403 /mysql-test
parent04890a2e20d338a2f1b4b279c6dd6da3cd6d0f95 (diff)
parentcdd6bc9bfeb1a82e7c7cfd8880f8e014ca5d9ff8 (diff)
downloadmariadb-git-037b0a7b14288f078bb3e6e75c14b4fc3181b4f0.tar.gz
Merge with 4.0
BitKeeper/etc/logging_ok: auto-union mysql-test/r/outfile2.result: Merge rename: mysql-test/r/outfile.result -> mysql-test/r/outfile2.result myisam/mi_key.c: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/auto_increment.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/t/auto_increment.test: Auto merged mysql-test/t/innodb.test: Auto merged sql/handler.h: Auto merged mysql-test/t/alter_table.test: Merge mysql-test/t/outfile.test: Merge sql/item_func.cc: Merge sql/share/czech/errmsg.txt: Merge sql/share/danish/errmsg.txt: Merge sql/share/dutch/errmsg.txt: Merge sql/share/english/errmsg.txt: Merge sql/share/estonian/errmsg.txt: Merge sql/share/french/errmsg.txt: Merge sql/share/german/errmsg.txt: Merge sql/share/greek/errmsg.txt: Merge sql/share/hungarian/errmsg.txt: Merge sql/share/italian/errmsg.txt: Merge sql/share/japanese/errmsg.txt: Merge sql/share/korean/errmsg.txt: Merge sql/share/norwegian-ny/errmsg.txt: Merge sql/share/norwegian/errmsg.txt: Merge sql/share/polish/errmsg.txt: Merge sql/share/portuguese/errmsg.txt: Merge sql/share/romanian/errmsg.txt: Merge sql/share/russian/errmsg.txt: Merge sql/share/slovak/errmsg.txt: Merge sql/share/spanish/errmsg.txt: Merge sql/share/swedish/errmsg.txt: Merge sql/share/ukrainian/errmsg.txt: Merge sql/sql_table.cc: Merge sql/sql_yacc.yy: Keep old sql/unireg.cc: Merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/have_outfile.inc5
-rw-r--r--mysql-test/include/test_outfile.inc1
-rw-r--r--mysql-test/r/alter_table.result36
-rw-r--r--mysql-test/r/auto_increment.result14
-rw-r--r--mysql-test/r/have_outfile.require3
-rw-r--r--mysql-test/r/innodb.result4
-rw-r--r--mysql-test/r/outfile.resultbin330 -> 683 bytes
-rw-r--r--mysql-test/r/outfile2.result10
-rw-r--r--mysql-test/t/alter_table.test49
-rw-r--r--mysql-test/t/auto_increment.test12
-rw-r--r--mysql-test/t/innodb.test10
-rw-r--r--mysql-test/t/outfile.test65
12 files changed, 177 insertions, 32 deletions
diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc
new file mode 100644
index 00000000000..31e95f4810a
--- /dev/null
+++ b/mysql-test/include/have_outfile.inc
@@ -0,0 +1,5 @@
+-- require r/have_outfile.require
+disable_query_log;
+select load_file(concat(@tmpdir,"/outfile.test"));
+--exec rm $MYSQL_TEST_DIR/var/tmp/outfile.test
+enable_query_log;
diff --git a/mysql-test/include/test_outfile.inc b/mysql-test/include/test_outfile.inc
new file mode 100644
index 00000000000..0bede4938c6
--- /dev/null
+++ b/mysql-test/include/test_outfile.inc
@@ -0,0 +1 @@
+eval select "Outfile OK" into outfile "$MYSQL_TEST_DIR/var/tmp/outfile.test";
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 222477cece9..6cada0d5fb2 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -489,3 +489,39 @@ create table t1 ( a timestamp );
alter table t1 add unique ( a(1) );
ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
drop table t1;
+drop table if exists t1, t2;
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL default '',
+ PRIMARY KEY (`a`)
+) TYPE=MRG_MyISAM UNION=(t1)
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL default '',
+ PRIMARY KEY (`a`)
+) TYPE=MRG_MyISAM UNION=(t1)
+drop table if exists t1, t2;
+create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
+insert into t1 (a) values(1);
+show table status like 't1';
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment
+t1 MyISAM Fixed 1 37 37 X X X X X X X X
+alter table t1 modify a int;
+show table status like 't1';
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment
+t1 MyISAM Fixed 1 37 37 X X X X X X X X
+drop table t1;
+create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
+insert into t1 (a) values(1);
+show table status like 't1';
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment
+t1 MyISAM Fixed 1 37 37 X X X X X X X X
+drop table t1;
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 428b2769fdb..9f3695cb1b1 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -341,3 +341,17 @@ a b
2 3
3 4
drop table t1;
+CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10)));
+INSERT INTO t1 (b) VALUES ('aaaa');
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 (b) VALUES ('');
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 (b) VALUES ('bbbb');
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/have_outfile.require b/mysql-test/r/have_outfile.require
new file mode 100644
index 00000000000..9fc2f8fdb5a
--- /dev/null
+++ b/mysql-test/r/have_outfile.require
@@ -0,0 +1,3 @@
+load_file(concat(@tmpdir,"/outfile.test"))
+Outfile OK
+
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index a8af3f5f658..def462fb521 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1643,3 +1643,7 @@ select distinct concat(a, b) from t1;
concat(a, b)
11113333
drop table t1;
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+The used table type doesn't support FULLTEXT indexes
+DROP TABLE t1;
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index 4dc09f65b7c..a7871592241 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/outfile2.result b/mysql-test/r/outfile2.result
new file mode 100644
index 00000000000..4dc09f65b7c
--- /dev/null
+++ b/mysql-test/r/outfile2.result
@@ -0,0 +1,10 @@
+drop table if exists t1;
+CREATE TABLE t1 (a INT);
+EXPLAIN
+SELECT *
+INTO OUTFILE '/tmp/t1.txt'
+ FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
+ FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+DROP TABLE t1;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 92651442041..d133403f42b 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -278,6 +278,45 @@ SHOW INDEX FROM t1;
DROP TABLE t1;
#
+# BUG#4717 - check for valid table names
+#
+create table t1 (a int);
+--error 1103
+alter table t1 rename to `t1\\`;
+--error 1103
+rename table t1 to `t1\\`;
+drop table t1;
+
+#
+# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
+#
+drop table if exists t1, t2;
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+drop table if exists t1, t2;
+
+# The following is also part of bug #6236 (CREATE TABLE didn't properly count
+# not null columns for primary keys)
+
+create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
+insert into t1 (a) values(1);
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+show table status like 't1';
+alter table t1 modify a int;
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+show table status like 't1';
+drop table t1;
+create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
+insert into t1 (a) values(1);
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+show table status like 't1';
+drop table t1;
# Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY)
#
@@ -297,16 +336,6 @@ alter table t1 drop key a;
drop table t1;
#
-# BUG#4717 - check for valid table names
-#
-create table t1 (a int);
---error 1103
-alter table t1 rename to `t1\\`;
---error 1103
-rename table t1 to `t1\\`;
-drop table t1;
-
-#
# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns
#
# The column's character set was changed but the actual data was not
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 8e11a3d68a5..ef344df5fb6 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -206,3 +206,15 @@ alter table t1 modify b varchar(255);
insert into t1 values (0,4);
select * from t1;
drop table t1;
+
+#
+# BUG #10045: Problem with composite AUTO_INCREMENT + BLOB key
+
+CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10)));
+INSERT INTO t1 (b) VALUES ('aaaa');
+CHECK TABLE t1;
+INSERT INTO t1 (b) VALUES ('');
+CHECK TABLE t1;
+INSERT INTO t1 (b) VALUES ('bbbb');
+CHECK TABLE t1;
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 4e18cfb224b..201489c0ddb 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1177,3 +1177,13 @@ create table t1(a int(1) , b int(1)) engine=innodb;
insert into t1 values ('1111', '3333');
select distinct concat(a, b) from t1;
drop table t1;
+
+#
+# BUG#7709 test case - Boolean fulltext query against unsupported
+# engines does not fail
+#
+
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+--error 1214;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+DROP TABLE t1;
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 59ce6cc56fe..b029a65284c 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -1,3 +1,9 @@
+disable_query_log;
+-- source include/test_outfile.inc
+eval set @tmpdir="$MYSQL_TEST_DIR/var/tmp";
+enable_query_log;
+-- source include/have_outfile.inc
+
#
# test of into outfile|dumpfile
#
@@ -6,29 +12,44 @@
drop table if exists t1;
--enable_warnings
-# We need to check that we have 'file' privilege.
+create table t1 (`a` blob);
+insert into t1 values("hello world"),("Hello mars"),(NULL);
+disable_query_log;
+eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1;
+enable_query_log;
+select load_file(concat(@tmpdir,"/outfile-test.1"));
+disable_query_log;
+eval select * into dumpfile "$MYSQL_TEST_DIR/var/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 "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1 where a is null;
+enable_query_log;
+select load_file(concat(@tmpdir,"/outfile-test.3"));
-#create table t1 (`a` blob);
-#insert into t1 values("hello world"),("Hello mars"),(NULL);
-#select * into outfile "/tmp/select-test.1" from t1;
-#select load_file("/tmp/select-test.1");
-#select * into dumpfile "/tmp/select-test.2" from t1 limit 1;
-#select load_file("/tmp/select-test.2");
-#select * into dumpfile "/tmp/select-test.3" from t1 where a is null;
-#select load_file("/tmp/select-test.3");
-#
-## the following should give errors
-#
-#select * into outfile "/tmp/select-test.1" from t1;
-#select * into dumpfile "/tmp/select-test.1" from t1;
-#select * into dumpfile "/tmp/select-test.99" from t1;
-#select load_file("/tmp/select-test.not-exist");
-#drop table t1;
-#drop table if exists t;
-#CREATE TABLE t ( t timestamp NOT NULL, c char(200) character set latin1 NOT NULL default '', i int(11), v varchar(200), b blob, KEY t (t)) ENGINE=MyISAM;
-#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
-#select * from t into outfile "check";
-#drop table if exists t;
+# the following should give errors
+
+#disabled as error message has variable path
+#disable_query_log;
+#--error 1086
+#eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1;
+#--error 1086
+#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1;
+#--error 1086
+#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1;
+#enable_query_log;
+select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
+--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1
+--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2
+--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.3
+drop table t1;
+
+# Bug#8191
+disable_query_log;
+eval select 1 into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.4";
+enable_query_log;
+select load_file(concat(@tmpdir,"/outfile-test.4"));
+--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4
#
# Bug #5382: 'explain select into outfile' crashes the server