summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/csv.test11
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test10
-rw-r--r--mysql-test/t/ctype_ucs.test4
-rw-r--r--mysql-test/t/ctype_ucs2_def.test13
-rw-r--r--mysql-test/t/federated.test22
-rw-r--r--mysql-test/t/func_misc.test6
-rw-r--r--mysql-test/t/information_schema.test44
-rw-r--r--mysql-test/t/log_tables.test10
-rw-r--r--mysql-test/t/merge-big.test84
-rw-r--r--mysql-test/t/merge.test13
-rw-r--r--mysql-test/t/myisam.test184
-rw-r--r--mysql-test/t/partition.test55
-rw-r--r--mysql-test/t/partition_datatype.test65
-rw-r--r--mysql-test/t/partition_error.test18
-rw-r--r--mysql-test/t/partition_innodb.test7
-rw-r--r--mysql-test/t/partition_not_windows.test84
-rw-r--r--mysql-test/t/partition_range.test45
-rw-r--r--mysql-test/t/partition_symlink.test55
-rw-r--r--mysql-test/t/partition_windows.test37
-rw-r--r--mysql-test/t/plugin_load-master.opt3
-rw-r--r--mysql-test/t/plugin_load.test3
-rw-r--r--mysql-test/t/query_cache.test19
-rw-r--r--mysql-test/t/symlink.test41
-rw-r--r--mysql-test/t/type_set.test2
24 files changed, 650 insertions, 185 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 7b4f95bbf8a..dd8c940ac44 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1773,4 +1773,15 @@ drop table t1;
CREATE TABLE t1(a INT) ENGINE=CSV;
SHOW WARNINGS;
+#
+# BUG#33067 - .
+#
+create table t1 (c1 tinyblob not null) engine=csv;
+insert into t1 values("This");
+--enable_info
+update t1 set c1="That" where c1="This";
+--disable_info
+select * from t1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index 7b7018d5901..1fb656f2a01 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -9,6 +9,16 @@ DROP TABLE IF EXISTS t1;
SHOW COLLATION LIKE 'cp1250_czech_cs';
+SET @test_character_set= 'cp1250';
+SET @test_collation= 'cp1250_general_ci';
+-- source include/ctype_common.inc
+
+SET @test_character_set= 'cp1250';
+SET @test_collation= 'cp1250_czech_cs';
+-- source include/ctype_common.inc
+
+
+
#
# Bugs: #8840: Empty string comparison and character set 'cp1250'
#
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 529c48a627b..db609777c8d 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -4,6 +4,10 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
+SET @test_character_set= 'ucs2';
+SET @test_collation= 'ucs2_general_ci';
+-- source include/ctype_common.inc
+
SET NAMES latin1;
SET character_set_connection=ucs2;
-- source include/endspace.inc
diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test
index c80444daddd..b146dc63626 100644
--- a/mysql-test/t/ctype_ucs2_def.test
+++ b/mysql-test/t/ctype_ucs2_def.test
@@ -39,4 +39,17 @@ INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
INSERT INTO t1 VALUES('A ', 'A ');
DROP TABLE t1;
+#
+# Bug#32705 - myisam corruption: Key in wrong position
+# at page 1024 with ucs2_bin
+#
+CREATE TABLE t1 (
+ c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
+ KEY(c1)
+ ) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('marshall\'s');
+INSERT INTO t1 VALUES ('marsh');
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 76cb5fd4793..79a706fdfa2 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1794,5 +1794,27 @@ connection slave;
drop table t1;
drop view v1;
+#
+# BUG#33946 - Join on Federated tables with Unique index gives error 1430
+# from storage engine
+#
+connection slave;
+CREATE TABLE t1 (a INT, b INT, KEY(a,b));
+INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2);
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+SELECT * FROM t1 WHERE a IS NULL;
+SELECT * FROM t1 WHERE a IS NOT NULL;
+SELECT * FROM t1 WHERE a=1 AND b=1;
+SELECT * FROM t1 WHERE a IS NULL AND b=1;
+SELECT * FROM t1 WHERE a IS NOT NULL AND b=1;
+DROP TABLE t1;
+
+connection slave;
+DROP TABLE t1;
+
--echo End of 5.1 tests
source include/federated_cleanup.inc;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 10a63b925d3..d33dd9b0d14 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -264,6 +264,12 @@ insert into t1 values (-1), (-2);
select min(a) from t1 group by inet_ntoa(a);
drop table t1;
+#
+# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks
+# replication
+#
+SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 2d8a2b738ee..fe1c1f769cf 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1270,4 +1270,48 @@ show open tables where f1()=0;
drop table t1;
drop function f1;
+#
+# BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR ||
+# m_status == DA_OK
+#
+connect (conn1, localhost, root,,);
+connection conn1;
+let $ID= `select connection_id()`;
+send select * from information_schema.tables where 1=sleep(100000);
+connection default;
+let $wait_timeout= 10;
+let $wait_condition=select count(*)=1 from information_schema.processlist
+where state='User sleep' and
+info='select * from information_schema.tables where 1=sleep(100000)';
+--source include/wait_condition.inc
+disable_query_log;
+eval kill $ID;
+enable_query_log;
+disconnect conn1;
+let $wait_timeout= 10;
+let $wait_condition=select count(*)=0 from information_schema.processlist
+where state='User sleep' and
+info='select * from information_schema.tables where 1=sleep(100000)';
+--source include/wait_condition.inc
+
+connect (conn1, localhost, root,,);
+connection conn1;
+let $ID= `select connection_id()`;
+send select * from information_schema.columns where 1=sleep(100000);
+connection default;
+let $wait_timeout= 10;
+let $wait_condition=select count(*)=1 from information_schema.processlist
+where state='User sleep' and
+info='select * from information_schema.columns where 1=sleep(100000)';
+--source include/wait_condition.inc
+disable_query_log;
+eval kill $ID;
+enable_query_log;
+disconnect conn1;
+let $wait_timeout= 10;
+let $wait_condition=select count(*)=0 from information_schema.processlist
+where state='User sleep' and
+info='select * from information_schema.columns where 1=sleep(100000)';
+--source include/wait_condition.inc
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 0c986c6d63a..3047d16d3b6 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -131,6 +131,16 @@ SET GLOBAL GENERAL_LOG=ON;
SET GLOBAL SLOW_QUERY_LOG=ON;
#
+# Bug#23924 general_log truncates queries with character set introducers.
+#
+truncate table mysql.general_log;
+set names binary;
+select _koi8r'ÔÅÓÔ' as test;
+--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID
+select * from mysql.general_log;
+set names utf8;
+
+#
# Bug #16905 Log tables: unicode statements are logged incorrectly
#
diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test
index eddcbb59ed4..b687973c9d1 100644
--- a/mysql-test/t/merge-big.test
+++ b/mysql-test/t/merge-big.test
@@ -3,8 +3,10 @@
#
# This test takes rather long time so let us run it only in --big-test mode
--source include/big_test.inc
-# We are using some debug-only features in this test
+# We use some debug-only features in this test
--source include/have_debug.inc
+# We use INFORMATION_SCHEMA.PROCESSLIST in this test
+--source include/not_embedded.inc
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6;
@@ -46,6 +48,8 @@ LOCK TABLE t1 WRITE;
--echo # connection default
connection default;
--echo # Let INSERT go into thr_multi_lock().
+#--sleep 8
+#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID = $con1_id AND STATE = 'Locked';
--source include/wait_condition.inc
@@ -54,8 +58,10 @@ let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
FLUSH TABLES;
#SELECT NOW();
--echo # Let INSERT go through open_tables() where it sleeps.
+#--sleep 8
+#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE ID = $con1_id AND STATE = 'DBUG sleep';
+ WHERE ID = $con1_id AND STATE = 'Waiting for table';
--source include/wait_condition.inc
#SELECT NOW();
--echo # Unlock and close table and wait for con1 to close too.
@@ -74,77 +80,3 @@ UNLOCK TABLES;
connection default;
DROP TABLE t1;
---echo #
---echo # Extra tests for Bug#26379 - Combination of FLUSH TABLE and
---echo # REPAIR TABLE corrupts a MERGE table
---echo #
-CREATE TABLE t1 (c1 INT);
-CREATE TABLE t2 (c1 INT);
-CREATE TABLE t3 (c1 INT);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-INSERT INTO t3 VALUES (3);
---echo #
---echo # CREATE ... SELECT
---echo # try to access parent from another thread.
---echo #
-#SELECT NOW();
- --echo # connection con1
- connect (con1,localhost,root,,);
- let $con1_id= `SELECT CONNECTION_ID()`;
- SET SESSION debug="+d,sleep_create_select_before_lock";
- send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
- INSERT_METHOD=FIRST SELECT * FROM t3;
---echo # connection default
-connection default;
-# wait for the other query to start executing
-let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE ID = $con1_id AND STATE = 'DBUG sleep';
---source include/wait_condition.inc
-#SELECT NOW();
---echo # Now try to access the parent.
---echo # If 3 is in table, SELECT had to wait.
-SELECT * FROM t4 ORDER BY c1;
-#SELECT NOW();
- --echo # connection con1
- connection con1;
- reap;
- #SELECT NOW();
- SET SESSION debug="-d,sleep_create_select_before_lock";
- disconnect con1;
---echo # connection default
-connection default;
---echo # Cleanup for next test.
-DROP TABLE t4;
-DELETE FROM t1 WHERE c1 != 1;
---echo #
---echo # CREATE ... SELECT
---echo # try to access child from another thread.
---echo #
-#SELECT NOW();
- --echo # connection con1
- connect (con1,localhost,root,,);
- let $con1_id= `SELECT CONNECTION_ID()`;
- SET SESSION debug="+d,sleep_create_select_before_lock";
- send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
- INSERT_METHOD=FIRST SELECT * FROM t3;
---echo # connection default
-connection default;
-# wait for the other query to start executing
-let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE ID = $con1_id AND STATE = 'DBUG sleep';
---source include/wait_condition.inc
-#SELECT NOW();
---echo # Now try to access a child.
---echo # If 3 is in table, SELECT had to wait.
-SELECT * FROM t1 ORDER BY c1;
-#SELECT NOW();
- --echo # connection con1
- connection con1;
- reap;
- #SELECT NOW();
- SET SESSION debug="-d,sleep_create_select_before_lock";
- disconnect con1;
---echo # connection default
-connection default;
-DROP TABLE t1, t2, t3, t4;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index e49297dd06c..a4602a3b82a 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -599,6 +599,19 @@ SELECT * FROM t3;
DROP TABLE t1, t2, t3;
+#
+# BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed
+#
+CREATE TABLE t1(a INT);
+CREATE TABLE m1(a INT) ENGINE=MERGE;
+SHOW CREATE TABLE m1;
+DROP TABLE m1;
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=();
+SHOW CREATE TABLE m1;
+ALTER TABLE m1 UNION=(t1);
+ALTER TABLE m1 UNION=();
+SHOW CREATE TABLE m1;
+DROP TABLE t1, m1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index fbd0a5ac4e7..21ffa0683b6 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1278,5 +1278,189 @@ DELETE FROM t1 WHERE c1 >= 10;
CHECK TABLE t1;
DROP TABLE t1;
+#
+# Bug#33222 - myisam-table drops rows when column is added
+# and a char-field > 128 exists
+#
+# Test #1 - CHECK TABLE sees wrong record, REPAR TABLE deletes it.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(130),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+REPAIR TABLE t1;
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+#
+# Test #2 - same as test #1, but using EXTENDED.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(130),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1 EXTENDED;
+REPAIR TABLE t1 EXTENDED;
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+#
+# Test #3 - same as test #1, but using OPTIMIZE TABLE.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(130),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+# Insert more rows and delete one in the middle to force optimize.
+INSERT INTO t1 VALUES('b', 'b');
+INSERT INTO t1 VALUES('c', 'b');
+DELETE FROM t1 WHERE c1='b';
+SELECT COUNT(*) FROM t1;
+OPTIMIZE TABLE t1;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
+#
+# Test #4 - ALTER TABLE deletes rows.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+# Using an index which can be disabled during bulk insert.
+CREATE TABLE t1 (
+ c1 CHAR(130),
+ c2 VARCHAR(1),
+ KEY (c1)
+) ENGINE=MyISAM;
+#
+# Insert 100 rows. This turns bulk insert on during the copy phase of
+# ALTER TABLE. Bulk insert disables keys before the insert and re-enables
+# them by repair after the insert.
+--disable_query_log
+let $count= 100;
+--echo # Insert $count rows. Query log disabled.
+while ($count)
+{
+ INSERT INTO t1 VALUES ('a', 'b');
+ dec $count;
+}
+--enable_query_log
+#
+# Change most of the rows into long character values with > 127 characters.
+UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90;
+SELECT COUNT(*) FROM t1;
+ALTER TABLE t1 ENGINE=MyISAM;
+#
+# With bug present, this shows that all long rows are gone.
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+#
+# Test #5 - same as test #1 but UTF-8.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(50),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+# Using Tamil Letter A, Unicode U+0B85
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+REPAIR TABLE t1;
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+#
+# Test #6 - same as test #2, but UTF-8.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(50),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+# Using Tamil Letter A, Unicode U+0B85
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1 EXTENDED;
+REPAIR TABLE t1 EXTENDED;
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+#
+# Test #7 - same as test #3, but UTF-8.
+# Using a CHAR column that can have > 127 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+CREATE TABLE t1 (
+ c1 CHAR(50),
+ c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+# Using Tamil Letter A, Unicode U+0B85
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+# Insert more rows and delete one in the middle to force optimize.
+INSERT INTO t1 VALUES('b', 'b');
+INSERT INTO t1 VALUES('c', 'b');
+DELETE FROM t1 WHERE c1='b';
+SELECT COUNT(*) FROM t1;
+OPTIMIZE TABLE t1;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
+#
+# Test #8 - same as test #4, but UTF-8.
+# Using a CHAR column that can have > 42 UTF-8 characters.
+# Using a VARCHAR to create a table with dynamic row format.
+# Using an index which can be disabled during bulk insert.
+CREATE TABLE t1 (
+ c1 CHAR(50),
+ c2 VARCHAR(1),
+ KEY (c1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+#
+# Insert 100 rows. This turns bulk insert on during the copy phase of
+# ALTER TABLE. Bulk insert disables keys before the insert and re-enables
+# them by repair after the insert.
+--disable_query_log
+let $count= 100;
+--echo # Insert $count rows. Query log disabled.
+while ($count)
+{
+ INSERT INTO t1 VALUES ('a', 'b');
+ dec $count;
+}
+--enable_query_log
+#
+# Change most of the rows into long character values with > 42 characters.
+# Using Tamil Letter A, Unicode U+0B85
+UPDATE t1 SET c1=REPEAT(_utf8 x'e0ae85',43) LIMIT 90;
+SELECT COUNT(*) FROM t1;
+ALTER TABLE t1 ENGINE=MyISAM;
+#
+# With bug present, this shows that all long rows are gone.
+SELECT COUNT(*) FROM t1;
+CHECK TABLE t1;
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
+#
+# Bug#29182 - MyISAMCHK reports wrong character set
+#
+CREATE TABLE t1 (
+ c1 VARCHAR(10) NOT NULL,
+ c2 CHAR(10) DEFAULT NULL,
+ c3 VARCHAR(10) NOT NULL,
+ KEY (c1),
+ KEY (c2)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYISAMCHK -d $MYSQLTEST_VARDIR/master-data/test/t1
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index c35626e06b7..c4e447988db 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -14,6 +14,10 @@
drop table if exists t1;
--enable_warnings
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a int) partition by list ((a/3)*10 div 1)
+(partition p0 values in (0), partition p1 values in (1));
+
#
# Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes the Server to crash.
#
@@ -35,7 +39,7 @@ PARTITION `p5` VALUES LESS THAN (2010)
COMMENT 'APSTART \' APEND'
);
#--exec sed 's/APSTART \\/APSTART /' var/master-data/test/t1.frm > tmpt1.frm && mv tmpt1.frm var/master-data/test/t1.frm
-#--error 1064
+#--error ER_PARSE_ERROR
SELECT * FROM t1 LIMIT 1;
DROP TABLE t1;
@@ -49,6 +53,7 @@ create table t1 (id int auto_increment, s1 int, primary key (id));
insert into t1 values (null,1);
insert into t1 values (null,6);
+-- sorted_result
select * from t1;
alter table t1 partition by range (id) (
@@ -79,24 +84,6 @@ partition by key(a)
partitions 1e+300;
#
-# Bug 21350: Data Directory problems
-#
--- error ER_WRONG_TABLE_NAME
-create table t1 (a int)
-partition by key (a)
-(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-
-#
-# Insert a test that manages to create the first partition and fails with
-# the second, ensure that we clean up afterwards in a proper manner.
-#
---error ER_WRONG_TABLE_NAME
-create table t1 (a int)
-partition by key (a)
-(partition p0,
- partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-
-#
# Bug 19309 Partitions: Crash if double procedural alter
#
create table t1 (a int)
@@ -618,12 +605,14 @@ partition by key (a)
(partition p0, partition p1);
show create table t1;
---error ER_MIX_HANDLER_ERROR
+# Since alter, it already have ENGINE=HEAP from before on table level
+# -> OK
alter table t1
partition by key(a)
(partition p0, partition p1 engine=heap);
---error ER_MIX_HANDLER_ERROR
+# Since alter, it already have ENGINE=HEAP from before on table level
+# -> OK
alter table t1
partition by key(a)
(partition p0 engine=heap, partition p1);
@@ -1208,9 +1197,11 @@ SHOW TABLE STATUS;
DELETE from t1 where a = 1;
--replace_column 9 0 12 NULL 13 NULL 14 NULL
SHOW TABLE STATUS;
+# restore this after WL#4176 is completed
+-- error ER_CHECK_NOT_IMPLEMENTED
ALTER TABLE t1 OPTIMIZE PARTITION p0;
---replace_column 12 NULL 13 NULL 14 NULL
-SHOW TABLE STATUS;
+#--replace_column 12 NULL 13 NULL 14 NULL
+#SHOW TABLE STATUS;
DROP TABLE t1;
#
@@ -1224,13 +1215,15 @@ DROP TABLE t1;
#
# Bug 17455 Partitions: Wrong message and error when using Repair/Optimize
# table on partitioned table
-#
+# (added check/analyze for gcov of Bug#20129)
create table t1 (a int)
engine=MEMORY
partition by key (a);
REPAIR TABLE t1;
OPTIMIZE TABLE t1;
+CHECK TABLE t1;
+ANALYZE TABLE t1;
drop table t1;
@@ -1533,16 +1526,24 @@ select c1 from t1 group by (select c0 from t1 limit 1);
drop table t1;
# Bug #30495: optimize table t1,t2,t3 extended errors
-#
+# (added more maintenace commands for Bug#20129
CREATE TABLE t1(a int)
PARTITION BY RANGE (a) (
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN (20)
);
---error 1064
+--error ER_PARSE_ERROR
ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED;
---error 1064
+--error ER_PARSE_ERROR
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
+--error ER_CHECK_NOT_IMPLEMENTED
+ALTER TABLE t1 ANALYZE PARTITION p1;
+--error ER_CHECK_NOT_IMPLEMENTED
+ALTER TABLE t1 CHECK PARTITION p1;
+--error ER_CHECK_NOT_IMPLEMENTED
+ALTER TABLE t1 REPAIR PARTITION p1;
+--error ER_CHECK_NOT_IMPLEMENTED
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
DROP TABLE t1;
#
diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test
index 61d3cb42c7b..7440a9bf3a3 100644
--- a/mysql-test/t/partition_datatype.test
+++ b/mysql-test/t/partition_datatype.test
@@ -11,11 +11,11 @@
drop table if exists t1;
--enable_warnings
-# FIXME: disabled this test because of valgrind error
-#create table t1 (a bit not null) partition by key (a);
-#insert into t1 values (b'1');
-#select * from t1 where a = b'1';
-#drop table t1;
+-- echo # test with not null
+create table t1 (a bit not null) partition by key (a);
+insert into t1 values (b'1');
+select hex(a) from t1 where a = b'1';
+drop table t1;
create table t1 (a tinyint not null) partition by key (a);
insert into t1 values (2);
select * from t1 where a = 2;
@@ -37,14 +37,14 @@ insert into t1 values (2);
select * from t1 where a = 2;
drop table t1;
create table t1 (a float not null) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
drop table t1;
create table t1 (a double not null) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
drop table t1;
-create table t1 (a decimal not null) partition by key (a);
+create table t1 (a decimal(4,2) not null) partition by key (a);
insert into t1 values (2.1);
select * from t1 where a = 2.1;
drop table t1;
@@ -100,11 +100,14 @@ create table t1 (a set('y','n') not null) partition by key (a);
insert into t1 values ('y');
select * from t1 where a = 'y';
drop table t1;
-# FIXME: disabled this test because of valgrind error
-#create table t1 (a bit) partition by key (a);
-#insert into t1 values (b'1');
-#select * from t1 where a = b'1';
-#drop table t1;
+-- echo # test with null allowed
+create table t1 (a bit) partition by key (a);
+insert into t1 values (b'1');
+insert into t1 values (NULL);
+select hex(a) from t1 where a = b'1';
+select hex(a) from t1 where a is NULL;
+select hex(a) from t1 order by a;
+drop table t1;
create table t1 (a tinyint) partition by key (a);
insert into t1 values (2);
select * from t1 where a = 2;
@@ -126,14 +129,14 @@ insert into t1 values (2);
select * from t1 where a = 2;
drop table t1;
create table t1 (a float) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
drop table t1;
create table t1 (a double) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
drop table t1;
-create table t1 (a decimal) partition by key (a);
+create table t1 (a decimal(4,2)) partition by key (a);
insert into t1 values (2.1);
select * from t1 where a = 2.1;
drop table t1;
@@ -192,18 +195,23 @@ drop table t1;
create table t1 (a varchar(65531)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
select * from t1 where a like 'aaa%';
+select * from t1 where a = 'bbbb';
drop table t1;
create table t1 (a varchar(65532)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
select * from t1 where a like 'aaa%';
+select * from t1 where a = 'bbbb';
drop table t1;
create table t1 (a varchar(65533) not null) partition by key (a);
+insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
+select * from t1 where a like 'aaa%';
+select * from t1 where a = 'bbbb';
drop table t1;
-- error ER_TOO_BIG_ROWSIZE
create table t1 (a varchar(65533)) partition by key (a);
@@ -211,3 +219,14 @@ create table t1 (a varchar(65533)) partition by key (a);
create table t1 (a varchar(65534) not null) partition by key (a);
-- error ER_TOO_BIG_ROWSIZE
create table t1 (a varchar(65535)) partition by key (a);
+
+#
+# Bug#34358: error in key_restore for bitfields with uneven bits
+#
+create table t1 (a bit(27), primary key (a)) engine=myisam
+partition by hash (a)
+(partition p0, partition p1, partition p2);
+show create table t1;
+insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
+select hex(a) from t1 where a = 7;
+drop table t1;
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index c9b95fc1664..d470fb67b49 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -9,6 +9,24 @@ drop table if exists t1;
--enable_warnings
#
+# Bug#31931: Mix of handlers error message
+#
+--error ER_MIX_HANDLER_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (a)
+( PARTITION p0 ENGINE=MyISAM,
+ PARTITION p1);
+--error ER_MIX_HANDLER_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY LIST (a)
+SUBPARTITION BY HASH (a)
+( PARTITION p0 VALUES IN (0)
+( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
+ PARTITION p1 VALUES IN (1)
+( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
+
+
+#
# Bug 29368:
# Incorrect error, 1467, for syntax error when creating partition
--error ER_PARTITION_REQUIRES_VALUES_ERROR
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 76a54b36942..932855cc877 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -104,6 +104,7 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
+-- error ER_MIX_HANDLER_ERROR
alter table t1 engine = x;
show create table t1;
drop table t1;
@@ -182,8 +183,10 @@ DROP TABLE t1;
create table t1 (int_column int, char_column char(5))
PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2
(PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
-alter table t1 PARTITION BY RANGE (int_column)
+alter table t1
+ENGINE = MyISAM
+PARTITION BY RANGE (int_column)
subpartition by key (char_column) subpartitions 2
- (PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam);
+ (PARTITION p1 VALUES LESS THAN (5));
show create table t1;
drop table t1;
diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test
index 103fb05029e..d7108d5af98 100644
--- a/mysql-test/t/partition_not_windows.test
+++ b/mysql-test/t/partition_not_windows.test
@@ -11,13 +11,9 @@
# Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize
# doesn't remove old directory
---disable_query_log
-eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/tmp''';
-let $data_directory = `select @data_dir`;
+let $data_directory = DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
-eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/tmp''';
-let $inx_directory = `select @inx_dir`;
---enable_query_log
+let $inx_directory = INDEX DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t1 (a int) engine myisam
@@ -26,7 +22,7 @@ subpartition by hash (a)
(partition p0 VALUES LESS THAN (1) $data_directory $inx_directory
(SUBPARTITION subpart00, SUBPARTITION subpart01));
---echo Checking if file exists before alter
+--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
@@ -45,7 +41,7 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
partition p2 VALUES LESS THAN (2) $data_directory $inx_directory
(SUBPARTITION subpart20, SUBPARTITION subpart21));
---echo Checking if file exists after alter
+--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
@@ -98,18 +94,18 @@ set @@sql_mode=@org_mode;
# 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)
PARTITION BY KEY (a)
(PARTITION p0 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)
PARTITION BY KEY (a)
(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test');
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
@@ -121,7 +117,7 @@ SUBPARTITION s0b
));
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) (
@@ -144,7 +140,59 @@ SUBPARTITION s0b
DROP TABLE IF EXISTS `example`;
--enable_warnings
---disable_abort_on_error
+--mkdir $MYSQLTEST_VARDIR/p0Data
+--mkdir $MYSQLTEST_VARDIR/p1Data
+--mkdir $MYSQLTEST_VARDIR/p2Data
+--mkdir $MYSQLTEST_VARDIR/p3Data
+--mkdir $MYSQLTEST_VARDIR/p0Index
+--mkdir $MYSQLTEST_VARDIR/p1Index
+--mkdir $MYSQLTEST_VARDIR/p2Index
+--mkdir $MYSQLTEST_VARDIR/p3Index
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE `example` (
+ `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `DESCRIPTION` varchar(30) NOT NULL,
+ `LEVEL` smallint(5) unsigned DEFAULT NULL,
+ PRIMARY KEY (`ID_EXAMPLE`)
+) ENGINE = MYISAM
+PARTITION BY HASH(ID_EXAMPLE)(
+PARTITION p0 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p0Data'
+INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p0Index',
+PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p1Data'
+INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p1Index',
+PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p2Data'
+INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p2Index',
+PARTITION p3 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p3Data'
+INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p3Index'
+);
+--echo # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYD
+--file_exists $MYSQLTEST_VARDIR/p0Data/example#P#p0.MYD
+--file_exists $MYSQLTEST_VARDIR/p0Index/example#P#p0.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYD
+--file_exists $MYSQLTEST_VARDIR/p1Data/example#P#p1.MYD
+--file_exists $MYSQLTEST_VARDIR/p1Index/example#P#p1.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYD
+--file_exists $MYSQLTEST_VARDIR/p2Data/example#P#p2.MYD
+--file_exists $MYSQLTEST_VARDIR/p2Index/example#P#p2.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYI
+--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYD
+--file_exists $MYSQLTEST_VARDIR/p3Data/example#P#p3.MYD
+--file_exists $MYSQLTEST_VARDIR/p3Index/example#P#p3.MYI
+DROP TABLE example;
+--rmdir $MYSQLTEST_VARDIR/p0Data
+--rmdir $MYSQLTEST_VARDIR/p1Data
+--rmdir $MYSQLTEST_VARDIR/p2Data
+--rmdir $MYSQLTEST_VARDIR/p3Data
+--rmdir $MYSQLTEST_VARDIR/p0Index
+--rmdir $MYSQLTEST_VARDIR/p1Index
+--rmdir $MYSQLTEST_VARDIR/p2Index
+--rmdir $MYSQLTEST_VARDIR/p3Index
+
+--error ER_CANT_CREATE_TABLE,1
CREATE TABLE `example` (
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
`DESCRIPTION` varchar(30) NOT NULL,
@@ -152,10 +200,8 @@ CREATE TABLE `example` (
PRIMARY KEY (`ID_EXAMPLE`)
) ENGINE = MYISAM
PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data'
+PARTITION p0 DATA DIRECTORY = '/not/existent/p0Data',
+PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
+PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
+PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
);
---enable_abort_on_error
-
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 6ed3abab46a..bc4231d1d71 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -10,6 +10,51 @@ drop table if exists t1, t2;
--enable_warnings
#
+# BUG 33429: Succeeds in adding partition when maxvalue on last partition
+#
+create table t1 (a int)
+partition by range (a)
+( partition p0 values less than (maxvalue));
+--error ER_PARTITION_MAXVALUE_ERROR
+alter table t1 add partition (partition p1 values less than (100000));
+show create table t1;
+drop table t1;
+
+# BUG 32943:
+# Locking problems in relation to partitioning and triggers
+# Also fixes and test cases of generic lock issues with
+# partition change code.
+#
+create table t1 (a integer)
+partition by range (a)
+( partition p0 values less than (4),
+ partition p1 values less than (100));
+
+delimiter |;
+create trigger tr1 before insert on t1
+for each row begin
+ set @a = 1;
+end|
+
+delimiter ;|
+alter table t1 drop partition p0;
+
+drop table t1;
+
+create table t1 (a integer)
+partition by range (a)
+( partition p0 values less than (4),
+ partition p1 values less than (100));
+LOCK TABLES t1 WRITE;
+alter table t1 drop partition p0;
+alter table t1 reorganize partition p1 into
+( partition p0 values less than (4),
+ partition p1 values less than (100));
+alter table t1 add partition ( partition p2 values less than (200));
+UNLOCK TABLES;
+drop table t1;
+
+#
# BUG 18198: Various tests for partition functions
#
#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test
index 4c6acec64eb..e36e335c0dd 100644
--- a/mysql-test/t/partition_symlink.test
+++ b/mysql-test/t/partition_symlink.test
@@ -2,7 +2,9 @@
# (DATA/INDEX DIR requires symlinks)
-- source include/have_partition.inc
-- source include/have_symlink.inc
-# remove the not_windows line after fixing bug#30459
+# remove the not_windows line after fixing bug#33687
+# symlinks must also work for files, not only directories
+# as in --skip-symbolic-links
-- source include/not_windows.inc
-- disable_warnings
DROP TABLE IF EXISTS t1;
@@ -25,9 +27,6 @@ DROP DATABASE IF EXISTS mysqltest2;
# directory or file that the mysqld-process can use, via DATA/INDEX DIR)
# this is the security flaw that was used in bug#32091 and bug#32111
-#--exec mkdir $MYSQLTEST_VARDIR/tmp/test || true
-#--exec mkdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true
-
-- echo # Creating two non colliding tables mysqltest2.t1 and test.t1
-- echo # test.t1 have partitions in mysqltest2-directory!
-- echo # user root:
@@ -123,5 +122,49 @@ connection default;
DROP USER mysqltest_1@localhost;
disconnect con1;
-#--exec rmdir $MYSQLTEST_VARDIR/tmp/test || true
-#--exec rmdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true
+#
+# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables
+#
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval create table t2 (i int )
+partition by range (i)
+(
+ partition p01 values less than (1000)
+ data directory="$MYSQLTEST_VARDIR/tmp"
+ index directory="$MYSQLTEST_VARDIR/tmp"
+);
+
+set @org_mode=@@sql_mode;
+set @@sql_mode='NO_DIR_IN_CREATE';
+select @@sql_mode;
+create table t1 (i int )
+partition by range (i)
+(
+ partition p01 values less than (1000)
+ data directory='/not/existing'
+ index directory='/not/existing'
+);
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show create table t2;
+DROP TABLE t1, t2;
+set @@sql_mode=@org_mode;
+
+#
+# Bug 21350: Data Directory problems
+#
+-- error ER_WRONG_TABLE_NAME
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+
+#
+# Insert a test that manages to create the first partition and fails with
+# the second, ensure that we clean up afterwards in a proper manner.
+#
+--error ER_WRONG_TABLE_NAME
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+ partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
diff --git a/mysql-test/t/partition_windows.test b/mysql-test/t/partition_windows.test
index a0723feac44..d42a7383c99 100644
--- a/mysql-test/t/partition_windows.test
+++ b/mysql-test/t/partition_windows.test
@@ -7,23 +7,34 @@
#
# Bug 25141: Crash Server on Partitioning command
#
+# Bug#30459: Partitioning across disks failing on Windows
+# updated this test, since symlinked files are not supported on Windows
+# (not the same as symlinked directories that have a special hack
+# on windows). This test is not dependent on have_symlink.
--disable_warnings
-DROP TABLE IF EXISTS `example`;
+DROP TABLE IF EXISTS t1;
--enable_warnings
---disable_abort_on_error
-CREATE TABLE `example` (
- `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `DESCRIPTION` varchar(30) NOT NULL,
- `LEVEL` smallint(5) unsigned DEFAULT NULL,
- PRIMARY KEY (`ID_EXAMPLE`)
+CREATE TABLE t1 (
+ c1 int(10) unsigned NOT NULL AUTO_INCREMENT,
+ c2 varchar(30) NOT NULL,
+ c3 smallint(5) unsigned DEFAULT NULL,
+ PRIMARY KEY (c1)
) ENGINE = MYISAM
-PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data'
+PARTITION BY HASH(c1)(
+ PARTITION p0
+ DATA DIRECTORY = 'C:/mysqltest/p0Data'
+ INDEX DIRECTORY = 'D:/mysqltest/p0Index',
+ PARTITION p1,
+ PARTITION p2
+ DATA DIRECTORY = 'E:/mysqltest/p2Data'
+ INDEX DIRECTORY = 'F:/mysqltest/p2Index'
);
---enable_abort_on_error
+INSERT INTO t1 VALUES (NULL, "first", 1);
+INSERT INTO t1 VALUES (NULL, "second", 2);
+INSERT INTO t1 VALUES (NULL, "third", 3);
+ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
+INSERT INTO t1 VALUES (NULL, "last", 4);
+DROP TABLE t1;
diff --git a/mysql-test/t/plugin_load-master.opt b/mysql-test/t/plugin_load-master.opt
new file mode 100644
index 00000000000..66637841f16
--- /dev/null
+++ b/mysql-test/t/plugin_load-master.opt
@@ -0,0 +1,3 @@
+$EXAMPLE_PLUGIN_OPT
+"--plugin-load=;EXAMPLE=ha_example.so;"
+--loose-plugin-example-enum-var=e2
diff --git a/mysql-test/t/plugin_load.test b/mysql-test/t/plugin_load.test
new file mode 100644
index 00000000000..8555247dd71
--- /dev/null
+++ b/mysql-test/t/plugin_load.test
@@ -0,0 +1,3 @@
+--source include/have_example_plugin.inc
+
+SELECT @@global.example_enum_var = 'e2';
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 771a32e8cd7..0e899da59da 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1298,6 +1298,25 @@ set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
+#
+# Bug#33756 - query cache with concurrent_insert=0 appears broken
+#
+FLUSH STATUS;
+SET GLOBAL query_cache_size=10*1024*1024;
+SET @save_concurrent_insert= @@concurrent_insert;
+SET GLOBAL concurrent_insert= 0;
+CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c1) VALUES (1), (2);
+#
+SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
+SHOW STATUS LIKE 'Qcache_hits';
+SELECT * FROM t1;
+SELECT * FROM t1;
+SHOW STATUS LIKE 'Qcache_hits';
+DROP TABLE t1;
+SET GLOBAL concurrent_insert= @save_concurrent_insert;
+SET GLOBAL query_cache_size= default;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 69535b7d9d1..7de9f6c6de0 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -38,9 +38,8 @@ drop table t2;
# We use t9 here to not crash with tables generated by the backup test
#
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run";
-enable_query_log;
insert into t9 select * from t1;
check table t9;
@@ -66,7 +65,6 @@ drop table t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW CREATE TABLE t9;
-disable_query_log;
--error 1103,1103
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
@@ -81,13 +79,14 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
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
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'
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1,1
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp";
-enable_query_log;
# Check moving table t9 from default database to mysqltest;
# In this case the symlinks should be removed.
@@ -103,20 +102,17 @@ drop database mysqltest;
#
create table t1 (a int not null) engine=myisam;
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
-enable_query_log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
alter table t1 add b int;
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 data directory="$MYSQLTEST_VARDIR/log";
-enable_query_log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 index directory="$MYSQLTEST_VARDIR/log";
-enable_query_log;
show create table t1;
drop table t1;
@@ -125,8 +121,9 @@ drop table t1;
#
--write_file $MYSQLTEST_VARDIR/tmp/t1.MYI
EOF
---replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1
+
+--replace_result $MYSQLTEST_VARDIR TEST_DIR $MYSQLTEST_VARDIR TEST_DIR
+--error 1,1
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp'
INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
@@ -147,18 +144,16 @@ connect (session1,localhost,root,,);
connect (session2,localhost,root,,);
connection session1;
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a;
-enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
connection session2;
-disable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a;
-enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -209,14 +204,24 @@ INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
+--error 1210
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
-DROP TABLE t1;
--replace_result $MYSQLTEST_VARDIR TEST_DIR
+--error 1210
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
-DROP TABLE t1;
--replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var';
+# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
+# silently ignored
+#
+SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
+DROP TABLE t1;
+SET @@SQL_MODE=@OLD_SQL_MODE;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test
index c7f8c59de28..e98555e137b 100644
--- a/mysql-test/t/type_set.test
+++ b/mysql-test/t/type_set.test
@@ -75,4 +75,4 @@ INSERT INTO t1 VALUES(9223372036854775808);
SELECT * FROM t1;
DROP TABLE t1;
---# echo End of 5.0 tests
+--echo End of 5.0 tests