summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_ucs.result14
-rw-r--r--mysql-test/r/fulltext.result7
-rw-r--r--mysql-test/r/preload.result28
-rw-r--r--mysql-test/r/union.result22
-rw-r--r--mysql-test/t/ctype_ucs.test21
-rw-r--r--mysql-test/t/fulltext.test8
-rw-r--r--mysql-test/t/union.test12
7 files changed, 98 insertions, 14 deletions
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index fe2d76c8ab3..7302ff930ae 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -624,3 +624,17 @@ ucs2_bin 00610009
ucs2_bin 0061
ucs2_bin 00610020
drop table t1;
+SET NAMES latin1;
+SET collation_connection='ucs2_swedish_ci';
+CREATE TABLE t1 (Field1 int(10) default '0');
+INSERT INTO t1 VALUES ('-1');
+SELECT * FROM t1;
+Field1
+-1
+DROP TABLE t1;
+CREATE TABLE t1 (Field1 int(10) unsigned default '0');
+INSERT INTO t1 VALUES ('-1');
+Warnings:
+Warning 1265 Data truncated for column 'Field1' at row 1
+DROP TABLE t1;
+SET NAMES latin1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index f50cae79608..77325c4e88b 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -408,3 +408,10 @@ insert t1 values (1, "aaaa"), (2, "bbbb");
insert t2 values (10, "aaaa"), (2, "cccc");
replace t1 select * from t2;
drop table t1, t2;
+CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t));
+SET NAMES latin1;
+INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück');
+SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE);
+COUNT(*)
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result
index f0b99a8d6f1..7237a0da7e0 100644
--- a/mysql-test/r/preload.result
+++ b/mysql-test/r/preload.result
@@ -74,15 +74,15 @@ Table Op Msg_type Msg_text
test.t1 preload_keys status OK
show status like "key_read%";
Variable_name Value
-Key_read_requests 0
-Key_reads 0
+Key_read_requests 581
+Key_reads 581
select count(*) from t1 where b = 'test1';
count(*)
4181
show status like "key_read%";
Variable_name Value
-Key_read_requests 217
-Key_reads 45
+Key_read_requests 798
+Key_reads 581
flush tables;
flush status;
show status like "key_read%";
@@ -98,15 +98,15 @@ Table Op Msg_type Msg_text
test.t1 preload_keys status OK
show status like "key_read%";
Variable_name Value
-Key_read_requests 0
-Key_reads 0
+Key_read_requests 10
+Key_reads 10
select count(*) from t1 where b = 'test1';
count(*)
4181
show status like "key_read%";
Variable_name Value
-Key_read_requests 217
-Key_reads 45
+Key_read_requests 227
+Key_reads 52
flush tables;
flush status;
show status like "key_read%";
@@ -123,8 +123,8 @@ test.t1 preload_keys status OK
test.t2 preload_keys status OK
show status like "key_read%";
Variable_name Value
-Key_read_requests 0
-Key_reads 0
+Key_read_requests 587
+Key_reads 587
select count(*) from t1 where b = 'test1';
count(*)
4181
@@ -133,8 +133,8 @@ count(*)
2584
show status like "key_read%";
Variable_name Value
-Key_read_requests 351
-Key_reads 73
+Key_read_requests 938
+Key_reads 613
flush tables;
flush status;
show status like "key_read%";
@@ -147,8 +147,8 @@ test.t3 preload_keys error Table 'test.t3' doesn't exist
test.t2 preload_keys status OK
show status like "key_read%";
Variable_name Value
-Key_read_requests 0
-Key_reads 0
+Key_read_requests 355
+Key_reads 355
flush tables;
flush status;
show status like "key_read%";
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 5a60ef8abfb..663793e0b5e 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1173,3 +1173,25 @@ show columns from t4;
Field Type Null Key Default Extra
sdate date YES NULL
drop table t1, t2, t3, t4;
+create table t1 (a int not null, b char (10) not null);
+insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
+select * from ((select * from t1 limit 1)) a;
+a b
+1 a
+select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a;
+a b
+1 a
+select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a;
+a b
+1 a
+select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a;
+a b
+1 a
+2 b
+3 c
+select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a;
+a b
+1 a
+2 b
+3 c
+drop table t1;
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 4780f51ebaa..954c4a8d8ab 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -392,3 +392,24 @@ SET collation_connection='ucs2_general_ci';
SET NAMES latin1;
SET collation_connection='ucs2_bin';
-- source include/ctype_filesort.inc
+
+SET NAMES latin1;
+#
+# Bug#8235
+#
+# This bug also helped to find another problem that
+# INSERT of a UCS2 string containing a negative number
+# into a unsigned int column didn't produce warnings.
+# This test covers both problems.
+#
+SET collation_connection='ucs2_swedish_ci';
+CREATE TABLE t1 (Field1 int(10) default '0');
+# no warnings, negative numbers are allowed
+INSERT INTO t1 VALUES ('-1');
+SELECT * FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (Field1 int(10) unsigned default '0');
+# this should generate a "Data truncated" warning
+INSERT INTO t1 VALUES ('-1');
+DROP TABLE t1;
+SET NAMES latin1;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 62dcecaff68..50d01da080f 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -322,3 +322,11 @@ insert t2 values (10, "aaaa"), (2, "cccc");
replace t1 select * from t2;
drop table t1, t2;
+#
+# bug#8351
+#
+CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t));
+SET NAMES latin1;
+INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück');
+SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE);
+DROP TABLE t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index be6bc7a48d8..5ff22f1d6b6 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -717,3 +717,15 @@ union
order by sdate;
show columns from t4;
drop table t1, t2, t3, t4;
+
+#
+# Bug #2435 UNION with parentheses not supported
+#
+create table t1 (a int not null, b char (10) not null);
+insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
+select * from ((select * from t1 limit 1)) a;
+select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a;
+select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a;
+select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a;
+select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a;
+drop table t1;