summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-12-13 14:26:57 +0100
committerunknown <tomas@whalegate.ndb.mysql.com>2007-12-13 14:26:57 +0100
commit2c20ba5a36c1f4f327bb15b3efd3ad235aab2784 (patch)
treea21151a99adb797108126b9e7d46f0b3f395fcf9 /mysql-test
parent7870d0a7da437315764cb3d494f62e9a9adb24de (diff)
parent0d5caaa4a1213e7d2d52a27ed41de32f3da0c050 (diff)
downloadmariadb-git-2c20ba5a36c1f4f327bb15b3efd3ad235aab2784.tar.gz
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932.test4
-rw-r--r--mysql-test/include/ctype_common.inc2
-rw-r--r--mysql-test/r/archive.result7
-rw-r--r--mysql-test/r/csv.result10
-rw-r--r--mysql-test/r/ctype_big5.result4
-rw-r--r--mysql-test/r/ctype_euckr.result4
-rw-r--r--mysql-test/r/ctype_gb2312.result4
-rw-r--r--mysql-test/r/ctype_gbk.result4
-rw-r--r--mysql-test/r/ctype_uca.result4
-rw-r--r--mysql-test/r/delayed.result6
-rw-r--r--mysql-test/r/events_scheduling.result4
-rw-r--r--mysql-test/r/func_misc.result7
-rw-r--r--mysql-test/r/merge_innodb.result37
-rw-r--r--mysql-test/r/partition.result47
-rw-r--r--mysql-test/r/partition_hash.result12
-rw-r--r--mysql-test/r/partition_innodb.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result74
-rwxr-xr-xmysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result74
-rw-r--r--mysql-test/t/archive.test9
-rw-r--r--mysql-test/t/csv.test11
-rw-r--r--mysql-test/t/delayed.test11
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/events_scheduling.test2
-rw-r--r--mysql-test/t/func_misc.test11
-rw-r--r--mysql-test/t/merge.test2
-rw-r--r--mysql-test/t/merge_innodb.test41
-rw-r--r--mysql-test/t/partition.test38
-rw-r--r--mysql-test/t/partition_hash.test16
-rw-r--r--mysql-test/t/partition_innodb.test15
29 files changed, 464 insertions, 9 deletions
diff --git a/mysql-test/extra/binlog_tests/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test
index 0839f5d43aa..3deeea13997 100644
--- a/mysql-test/extra/binlog_tests/ctype_cp932.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932.test
@@ -8,6 +8,10 @@ drop table if exists t3;
drop table if exists t4;
--enable_warnings
+SET @test_character_set= 'cp932';
+SET @test_collation= 'cp932_japanese_ci';
+-- source include/ctype_common.inc
+
set names cp932;
set character_set_database = cp932;
diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc
index 9ee0a40c8ce..89b7ceb0c72 100644
--- a/mysql-test/include/ctype_common.inc
+++ b/mysql-test/include/ctype_common.inc
@@ -53,11 +53,13 @@ DROP TABLE t1;
#
# Bug #31070: crash during conversion of charsets
+# Bug #32726: crash with cast in order by clause and cp932 charset
#
create table t1 (a set('a') not null);
insert into t1 values (),();
select cast(a as char(1)) from t1;
select a sounds like a from t1;
+select 1 from t1 order by cast(a as char(1));
drop table t1;
DROP DATABASE d1;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index edd49988a5f..ebd839a1fd1 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12687,3 +12687,10 @@ CREATE TABLE t1(a VARCHAR(510)) ENGINE = ARCHIVE;
INSERT INTO t1(a) VALUES ('');
SELECT * FROM t1 ORDER BY a;
DROP TABLE t1;
+CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive;
+INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
+FLUSH TABLE t1;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 NULL
+2 NULL
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 69f77dc3cd8..b0033383f00 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5364,13 +5364,19 @@ BIN(a)
0
drop table t1;
create table t1(a enum('foo','bar') default null) engine=csv;
-ERROR HY000: Can't create table 'test.t1' (errno: -1)
+ERROR 42000: The storage engine for the table doesn't support nullable columns
create table t1(a enum('foo','bar') default 'foo') engine=csv;
-ERROR HY000: Can't create table 'test.t1' (errno: -1)
+ERROR 42000: The storage engine for the table doesn't support nullable columns
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
insert into t1 values();
select * from t1;
a
foo
drop table t1;
+CREATE TABLE t1(a INT) ENGINE=CSV;
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+SHOW WARNINGS;
+Level Code Message
+Error 1178 The storage engine for the table doesn't support nullable columns
+Error 1005 Can't create table 'test.t1' (errno: 138)
End of 5.1 tests
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index b190273cc64..8103e9b856f 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -64,6 +64,10 @@ select a sounds like a from t1;
a sounds like a
1
1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
drop table t1;
DROP DATABASE d1;
USE test;
diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
index ee786202c01..bb1b3f5995b 100644
--- a/mysql-test/r/ctype_euckr.result
+++ b/mysql-test/r/ctype_euckr.result
@@ -64,6 +64,10 @@ select a sounds like a from t1;
a sounds like a
1
1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
drop table t1;
DROP DATABASE d1;
USE test;
diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
index 90c94c3b299..95246525368 100644
--- a/mysql-test/r/ctype_gb2312.result
+++ b/mysql-test/r/ctype_gb2312.result
@@ -64,6 +64,10 @@ select a sounds like a from t1;
a sounds like a
1
1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
drop table t1;
DROP DATABASE d1;
USE test;
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index fe90c7bff29..8437e34be1e 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -64,6 +64,10 @@ select a sounds like a from t1;
a sounds like a
1
1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
drop table t1;
DROP DATABASE d1;
USE test;
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 3fff9b9cda8..92b76802d0b 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2599,6 +2599,10 @@ select a sounds like a from t1;
a sounds like a
1
1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
drop table t1;
DROP DATABASE d1;
USE test;
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index 95f7fe5aa61..bcda6ddb6ab 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -250,6 +250,11 @@ SELECT HEX(a) FROM t1;
HEX(a)
1
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT DELAYED INTO t1 SET b= b();
+ERROR 42S22: Unknown column 'b' in 'field list'
+DROP TABLE t1;
+End of 5.0 tests
DROP TABLE IF EXISTS t1,t2;
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` (
@@ -279,3 +284,4 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
DROP TABLE t1,t2;
+End of 5.1 tests
diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result
index d45bffcd7ff..033136ba354 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -78,10 +78,10 @@ FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
OK
-SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
+SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
-IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
+IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
OK
"Already dropped because ended. Therefore an error."
DROP EVENT event_3;
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index a7119090ec0..a78d7cd48c0 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -212,6 +212,13 @@ test
SELECT NAME_CONST('test', 'test');
test
test
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (), (), ();
+SELECT NAME_CONST(a, '1') FROM t1;
+ERROR HY000: Incorrect arguments to NAME_CONST
+SET INSERT_ID= NAME_CONST(a, a);
+ERROR HY000: Incorrect arguments to NAME_CONST
+DROP TABLE t1;
create table t1 (a int not null);
insert into t1 values (-1), (-2);
select min(a) from t1 group by inet_ntoa(a);
diff --git a/mysql-test/r/merge_innodb.result b/mysql-test/r/merge_innodb.result
new file mode 100644
index 00000000000..f6057d279b1
--- /dev/null
+++ b/mysql-test/r/merge_innodb.result
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS t1, t2, t3, t4, t5;
+CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM;
+CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM;
+CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('Ann'), ('Alice');
+INSERT INTO t2 VALUES ('Bob'), ('Brian');
+INSERT INTO t3 VALUES ('Chris'), ('Charlie');
+CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3)
+INSERT_METHOD=LAST;
+SELECT * FROM t5;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+SELECT * FROM t4;
+c1
+Ann
+Alice
+Bob
+Brian
+ALTER TABLE t2 ENGINE=InnoDB;
+SELECT * FROM t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+DELETE FROM t2 LIMIT 1;
+SELECT * FROM t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+INSERT INTO t4 VALUES ('Beware');
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+SELECT * FROM t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+SELECT * FROM t2;
+c1
+Brian
+SELECT * FROM t1;
+c1
+Ann
+Alice
+DROP TABLE t1, t2, t3, t4, t5;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 7c25e948d6c..886ecb29bc7 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1307,4 +1307,51 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1
DROP TABLE t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551615)
+);
+INSERT INTO t1 VALUES (0), (18446744073709551614);
+INSERT INTO t1 VALUES (18446744073709551615);
+ERROR HY000: Table has no partition for value 18446744073709551615
+DROP TABLE t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551614),
+PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (-1), (0), (18446744073709551613),
+(18446744073709551614), (18446744073709551615);
+Warnings:
+Warning 1264 Out of range value for column 's1' at row 1
+SELECT * FROM t1;
+s1
+0
+0
+18446744073709551613
+18446744073709551614
+18446744073709551615
+SELECT * FROM t1 WHERE s1 = 0;
+s1
+0
+0
+SELECT * FROM t1 WHERE s1 = 18446744073709551614;
+s1
+18446744073709551614
+SELECT * FROM t1 WHERE s1 = 18446744073709551615;
+s1
+18446744073709551615
+DROP TABLE t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551615),
+PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 72f036be099..94fefe77a77 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -1,4 +1,16 @@
drop table if exists t1;
+CREATE TABLE t1 (c1 INT)
+PARTITION BY HASH (c1)
+PARTITIONS 15;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+ALTER TABLE t1 COALESCE PARTITION 13;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT)
+PARTITION BY LINEAR HASH (c1)
+PARTITIONS 5;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+ALTER TABLE t1 COALESCE PARTITION 3;
+DROP TABLE t1;
create table t1 (a int unsigned)
partition by hash(a div 2)
partitions 4;
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index f80e0001ea8..5cbe34c94ca 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,3 +1,15 @@
+# Bug#32948
+CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
+CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
+FOREIGN KEY (c1) REFERENCES t1 (c1)
+ON DELETE CASCADE)
+ENGINE=INNODB;
+ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+ALTER TABLE t1 ENGINE=MyISAM;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+DROP TABLE t2;
+DROP TABLE t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
index ef9f76b7d9c..655100203b5 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
@@ -2,6 +2,80 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
+SET @test_character_set= 'cp932';
+SET @test_collation= 'cp932_japanese_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(10) cp932_japanese_ci YES MUL NULL
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 varchar(15) cp932_japanese_ci YES MUL NULL
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
set names cp932;
set character_set_database = cp932;
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
index ef9f76b7d9c..655100203b5 100755
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
@@ -2,6 +2,80 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
+SET @test_character_set= 'cp932';
+SET @test_collation= 'cp932_japanese_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(10) cp932_japanese_ci YES MUL NULL
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 varchar(15) cp932_japanese_ci YES MUL NULL
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
set names cp932;
set character_set_database = cp932;
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index a1158dbfd3b..b42c8446a32 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1589,3 +1589,12 @@ SELECT * FROM t1 ORDER BY a;
--enable_result_log
DROP TABLE t1;
+
+#
+# BUG#31833 - ORDER BY leads to wrong result when ARCHIVE, BLOB and table
+# cache is full
+#
+CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive;
+INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
+FLUSH TABLE t1;
+SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 6c83fbfdc9c..7b4f95bbf8a 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1755,9 +1755,9 @@ insert into t1 values();
select BIN(a) from t1;
drop table t1;
# We prevent creation of table with nullable ENUM
---error ER_CANT_CREATE_TABLE
+--error ER_CHECK_NOT_IMPLEMENTED
create table t1(a enum('foo','bar') default null) engine=csv;
---error ER_CANT_CREATE_TABLE
+--error ER_CHECK_NOT_IMPLEMENTED
create table t1(a enum('foo','bar') default 'foo') engine=csv;
# Enum columns must be specified as NOT NULL
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
@@ -1765,5 +1765,12 @@ insert into t1 values();
select * from t1;
drop table t1;
+#
+# BUG#32817 - though CSV is marked as supported create table is rejected
+# with error 1005.
+#
+--error ER_CHECK_NOT_IMPLEMENTED
+CREATE TABLE t1(a INT) ENGINE=CSV;
+SHOW WARNINGS;
--echo End of 5.1 tests
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index b542027207f..ce57645bd4b 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -244,6 +244,16 @@ SELECT HEX(a) FROM t1;
DROP TABLE t1;
#
+# Bug #32676: insert delayed crash with wrong column and function specified
+#
+CREATE TABLE t1 (a INT);
+--error ER_BAD_FIELD_ERROR
+INSERT DELAYED INTO t1 SET b= b();
+DROP TABLE t1;
+
+--echo End of 5.0 tests
+
+#
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
#
--disable_warnings
@@ -275,3 +285,4 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2;
+--echo End of 5.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 42fa242c7e1..2c16017241c 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -16,7 +16,6 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do
federated_transactions : Bug#29523 Transactions do not work
events : Bug#32664 events.test fails randomly
-events_scheduling : Bug#29830 Test case 'events_scheduling' fails on Mac OS X and Windows
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
kill : Bug#29149: Test "kill" fails on Windows
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index b1eeae1e020..226cad0f3eb 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -87,7 +87,7 @@ SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
-SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
+SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index fb85cdfb27d..d8fbbdcd48e 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -214,6 +214,17 @@ SELECT NAME_CONST('test', -1.0);
SELECT NAME_CONST('test', 'test');
#
+# Bug #32559: connection hangs on query with name_const
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (), (), ();
+--error ER_WRONG_ARGUMENTS
+SELECT NAME_CONST(a, '1') FROM t1;
+--error ER_WRONG_ARGUMENTS
+SET INSERT_ID= NAME_CONST(a, a);
+DROP TABLE t1;
+
+#
# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
#
create table t1 (a int not null);
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 3b71dc6fde1..090d1cbf244 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1,5 +1,5 @@
#
-# test of MERGE TABLES
+# Test of MERGE TABLES
#
--disable_warnings
diff --git a/mysql-test/t/merge_innodb.test b/mysql-test/t/merge_innodb.test
new file mode 100644
index 00000000000..7f0b1a0c36e
--- /dev/null
+++ b/mysql-test/t/merge_innodb.test
@@ -0,0 +1,41 @@
+# t/merge_innodb.test
+#
+# Tests with MERGE tables over InnoDB tables
+#
+
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3, t4, t5;
+--enable_warnings
+
+#
+# Bug#30491 - MERGE doesn't report error when one table is Innodb
+#
+CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM;
+CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM;
+CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('Ann'), ('Alice');
+INSERT INTO t2 VALUES ('Bob'), ('Brian');
+INSERT INTO t3 VALUES ('Chris'), ('Charlie');
+CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2)
+ INSERT_METHOD=LAST;
+CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3)
+ INSERT_METHOD=LAST;
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM t5;
+SELECT * FROM t4;
+ALTER TABLE t2 ENGINE=InnoDB;
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM t4;
+DELETE FROM t2 LIMIT 1;
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM t4;
+--error ER_WRONG_MRG_TABLE
+INSERT INTO t4 VALUES ('Beware');
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM t4;
+SELECT * FROM t2;
+SELECT * FROM t1;
+DROP TABLE t1, t2, t3, t4, t5;
+
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index f2fed63c833..6c1e17e7cf3 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1556,4 +1556,42 @@ ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED;
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
DROP TABLE t1;
+#
+# Bug #29258: Partitions: search fails for maximum unsigned bigint
+#
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+ PARTITION BY RANGE (s1) (
+ PARTITION p0 VALUES LESS THAN (0),
+ PARTITION p1 VALUES LESS THAN (1),
+ PARTITION p2 VALUES LESS THAN (18446744073709551615)
+);
+INSERT INTO t1 VALUES (0), (18446744073709551614);
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+INSERT INTO t1 VALUES (18446744073709551615);
+DROP TABLE t1;
+
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+ PARTITION BY RANGE (s1) (
+ PARTITION p0 VALUES LESS THAN (0),
+ PARTITION p1 VALUES LESS THAN (1),
+ PARTITION p2 VALUES LESS THAN (18446744073709551614),
+ PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (-1), (0), (18446744073709551613),
+ (18446744073709551614), (18446744073709551615);
+SELECT * FROM t1;
+SELECT * FROM t1 WHERE s1 = 0;
+SELECT * FROM t1 WHERE s1 = 18446744073709551614;
+SELECT * FROM t1 WHERE s1 = 18446744073709551615;
+DROP TABLE t1;
+
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+ PARTITION BY RANGE (s1) (
+ PARTITION p0 VALUES LESS THAN (0),
+ PARTITION p1 VALUES LESS THAN (1),
+ PARTITION p2 VALUES LESS THAN (18446744073709551615),
+ PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index 52caaa8c8e9..362d5f747e9 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -10,6 +10,22 @@ drop table if exists t1;
--enable_warnings
#
+# Bug#30822: crash when COALESCE
+#
+CREATE TABLE t1 (c1 INT)
+ PARTITION BY HASH (c1)
+ PARTITIONS 15;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+ALTER TABLE t1 COALESCE PARTITION 13;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT)
+ PARTITION BY LINEAR HASH (c1)
+ PARTITIONS 5;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+ALTER TABLE t1 COALESCE PARTITION 3;
+DROP TABLE t1;
+
+#
# More partition pruning tests, especially on interval walking
#
create table t1 (a int unsigned)
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 6b73d0b2c5e..58010f85ecf 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -1,6 +1,21 @@
--source include/have_partition.inc
--source include/have_innodb.inc
+# Bug#32948 - FKs allowed to reference partitioned table
+#
+-- echo # Bug#32948
+CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
+CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
+ FOREIGN KEY (c1) REFERENCES t1 (c1)
+ ON DELETE CASCADE)
+ENGINE=INNODB;
+--error ER_ROW_IS_REFERENCED
+ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5;
+--error ER_ROW_IS_REFERENCED
+ALTER TABLE t1 ENGINE=MyISAM;
+DROP TABLE t2;
+DROP TABLE t1;
+
#
# Bug #14673: Wrong InnoDB default row format
#