summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2006-02-28 23:29:58 +0100
committerunknown <kent@mysql.com>2006-02-28 23:29:58 +0100
commit3addd306a66b146ae5500f1bce5e6ddba036c8e8 (patch)
treeefd2f0f295954c586163d618728c858a8dde7543 /mysql-test
parent59b6ab1fe01f48fb4def09f9565b842aa78e5f8e (diff)
parentfb936d2a86416127c031f3972f669e1c2b4291b3 (diff)
downloadmariadb-git-3addd306a66b146ae5500f1bce5e6ddba036c8e8.tar.gz
Merge
configure.in: Auto merged client/mysqlimport.c: Auto merged include/config-win.h: Auto merged mysql-test/r/create.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/disabled.def: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/field.h: Auto merged sql/log_event.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_table.cc: Auto merged mysql-test/t/mysqldump.test: SCCS merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/drop-on-restart.inc3
-rw-r--r--mysql-test/r/partition.result33
-rw-r--r--mysql-test/r/rpl_alter_db.result8
-rw-r--r--mysql-test/r/rpl_bit_npk.result64
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/partition.test40
-rw-r--r--mysql-test/t/rpl_alter_db.test10
7 files changed, 141 insertions, 19 deletions
diff --git a/mysql-test/include/drop-on-restart.inc b/mysql-test/include/drop-on-restart.inc
index 841b636483a..af1d0d893e0 100644
--- a/mysql-test/include/drop-on-restart.inc
+++ b/mysql-test/include/drop-on-restart.inc
@@ -23,6 +23,7 @@ drop database if exists db1_secret;
drop database if exists db2;
drop database if exists federated;
drop database if exists mysqldump_test_db;
+drop database if exists mysqlslap;
drop database if exists mysqltest1;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
@@ -34,6 +35,7 @@ drop database if exists mysqltest_bob;
drop database if exists mysqltest_db1;
drop database if exists mysqltest_prometheus;
drop database if exists mysqltest_sisyfos;
+drop database if exists ndbsynctest;
drop database if exists ndbtest1;
drop database if exists rewrite;
drop database if exists test2;
@@ -429,6 +431,7 @@ drop table if exists new_t2;
drop table if exists not_exist;
drop table if exists r1;
drop table if exists t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t21,t70;
+drop table if exists t00,t03,t04;
drop table if exists t0_template;
drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 6d28ecd8552..c6d341472b7 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -315,4 +315,37 @@ drop table t1;
create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUES in (10), partition x2 values in (20));
alter table t1 add partition (partition x3 values in (30));
drop table t1;
+CREATE TABLE t1 (
+f_int1 INTEGER, f_int2 INTEGER,
+f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000)
+)
+PARTITION BY RANGE(f_int1 DIV 2)
+SUBPARTITION BY HASH(f_int1)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0),
+PARTITION partb VALUES LESS THAN (5),
+PARTITION parte VALUES LESS THAN (10),
+PARTITION partf VALUES LESS THAN (2147483647));
+INSERT INTO t1 SET f_int1 = NULL , f_int2 = -20, f_char1 = CAST(-20 AS CHAR),
+f_char2 = CAST(-20 AS CHAR), f_charbig = '#NULL#';
+SELECT * FROM t1 WHERE f_int1 IS NULL;
+f_int1 f_int2 f_char1 f_char2 f_charbig
+NULL -20 -20 -20 #NULL#
+SELECT * FROM t1;
+f_int1 f_int2 f_char1 f_char2 f_charbig
+NULL -20 -20 -20 #NULL#
+drop table t1;
+CREATE TABLE t1 (
+f_int1 INTEGER, f_int2 INTEGER,
+f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000) )
+PARTITION BY LIST(MOD(f_int1,2))
+SUBPARTITION BY KEY(f_int1)
+(PARTITION part1 VALUES IN (-1) (SUBPARTITION sp1, SUBPARTITION sp2),
+PARTITION part2 VALUES IN (0) (SUBPARTITION sp3, SUBPARTITION sp5),
+PARTITION part3 VALUES IN (1) (SUBPARTITION sp4, SUBPARTITION sp6));
+INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
+INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
+SELECT * FROM t1 WHERE f_int1 IS NULL;
+f_int1 f_int2 f_char1 f_char2 f_charbig
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/rpl_alter_db.result b/mysql-test/r/rpl_alter_db.result
new file mode 100644
index 00000000000..6edbe5d427f
--- /dev/null
+++ b/mysql-test/r/rpl_alter_db.result
@@ -0,0 +1,8 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+use mysql;
+alter database collate latin1_bin;
diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/r/rpl_bit_npk.result
index aeefc77d69b..2850e63aabd 100644
--- a/mysql-test/r/rpl_bit_npk.result
+++ b/mysql-test/r/rpl_bit_npk.result
@@ -45,25 +45,27 @@ GSuppDf TINYINT,
VNotSupp TINYINT,
x034 TINYINT);
LOCK TABLES test.t1 WRITE;
-INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,NULL,1);
INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'0',1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
UNLOCK TABLES;
+UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
+UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
+5 5 3 NULL 1
+5 5 3 2 1
+5 5 3 33 1
+5 5 3 2 50
+5 5 3 33 1
+5 5 3 33 1
+5 5 3 33 1
+5 5 3 33 1
SELECT hex(bit1) from test.t1;
hex(bit1)
3F
@@ -96,14 +98,14 @@ hex(bit3)
1
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
-5 5 3 2 1
+5 5 3 NULL 1
+5 5 3 2 1
+5 5 3 33 1
+5 5 3 2 50
+5 5 3 33 1
+5 5 3 33 1
+5 5 3 33 1
+5 5 3 33 1
SELECT hex(bit1) from test.t1;
hex(bit1)
3F
@@ -134,4 +136,30 @@ hex(bit3)
1
1
1
+CREATE TABLE test.t2 (a INT, b BIT(1));
+INSERT INTO test.t2 VALUES (1, b'0');
+INSERT INTO test.t2 VALUES (1, b'1');
+UPDATE test.t2 SET a = 2 WHERE b = b'1';
+CREATE TABLE test.t3 (a INT, b INT);
+INSERT INTO test.t3 VALUES (1, NULL);
+INSERT INTO test.t3 VALUES (1, 0);
+UPDATE test.t3 SET a = 2 WHERE b = 0;
+SELECT a, hex(b) FROM test.t2;
+a hex(b)
+1 0
+2 1
+SELECT * FROM test.t3;
+a b
+1 NULL
+2 0
+SELECT a, hex(b) FROM test.t2;
+a hex(b)
+1 0
+2 1
+SELECT * FROM test.t3;
+a b
+1 NULL
+2 0
DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 4845aecb88d..6e8314860a3 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -20,7 +20,7 @@ ndb_binlog_ddl_multi : Bug#17038 [PATCH PENDING]
ndb_load : Bug#17233
partition_03ndb : Bug#16385
ps_7ndb : dbug assert in RBR mode when executing test suite
-rpl_bit_npk : Bug#13418
+#rpl_bit_npk : Bug#13418
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
rpl_ndb_2innodb : Bugs#17400, 17687, 17701
rpl_ndb_2myisam : Bugs#17400, 17687, 17701
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 4760219c911..92b0ec55953 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -408,4 +408,44 @@ create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUE
alter table t1 add partition (partition x3 values in (30));
drop table t1;
+#
+# Bug #17432: Partition functions containing NULL values should return
+# LONGLONG_MIN
+#
+CREATE TABLE t1 (
+ f_int1 INTEGER, f_int2 INTEGER,
+ f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000)
+ )
+ PARTITION BY RANGE(f_int1 DIV 2)
+ SUBPARTITION BY HASH(f_int1)
+ SUBPARTITIONS 2
+ (PARTITION parta VALUES LESS THAN (0),
+ PARTITION partb VALUES LESS THAN (5),
+ PARTITION parte VALUES LESS THAN (10),
+ PARTITION partf VALUES LESS THAN (2147483647));
+INSERT INTO t1 SET f_int1 = NULL , f_int2 = -20, f_char1 = CAST(-20 AS CHAR),
+ f_char2 = CAST(-20 AS CHAR), f_charbig = '#NULL#';
+SELECT * FROM t1 WHERE f_int1 IS NULL;
+SELECT * FROM t1;
+drop table t1;
+
+#
+# Bug 17430: Crash when SELECT * from t1 where field IS NULL
+#
+
+CREATE TABLE t1 (
+ f_int1 INTEGER, f_int2 INTEGER,
+ f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000) )
+ PARTITION BY LIST(MOD(f_int1,2))
+ SUBPARTITION BY KEY(f_int1)
+ (PARTITION part1 VALUES IN (-1) (SUBPARTITION sp1, SUBPARTITION sp2),
+ PARTITION part2 VALUES IN (0) (SUBPARTITION sp3, SUBPARTITION sp5),
+ PARTITION part3 VALUES IN (1) (SUBPARTITION sp4, SUBPARTITION sp6));
+
+INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
+INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
+
+SELECT * FROM t1 WHERE f_int1 IS NULL;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/rpl_alter_db.test b/mysql-test/t/rpl_alter_db.test
new file mode 100644
index 00000000000..5ac8a2f4018
--- /dev/null
+++ b/mysql-test/t/rpl_alter_db.test
@@ -0,0 +1,10 @@
+source include/master-slave.inc;
+connection master;
+use mysql; # to be different from initial `test' db of mysqltest client
+alter database collate latin1_bin;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+
+