summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_recoding.result11
-rw-r--r--mysql-test/r/ctype_ucs.result4
-rw-r--r--mysql-test/r/ctype_utf8.result31
-rw-r--r--mysql-test/r/heap_btree.result1
-rw-r--r--mysql-test/r/view.result59
-rw-r--r--mysql-test/t/ctype_recoding.test14
-rw-r--r--mysql-test/t/ctype_ucs.test5
-rw-r--r--mysql-test/t/ctype_utf8.test18
-rw-r--r--mysql-test/t/grant.test2
-rw-r--r--mysql-test/t/handler.test1
-rw-r--r--mysql-test/t/heap_btree.test13
-rw-r--r--mysql-test/t/view.test85
12 files changed, 166 insertions, 78 deletions
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 2042767c042..acb07d1aa5d 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -248,3 +248,14 @@ select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1;
rpad(c1,3,'ö') rpad('ö',3,c1)
ßöö ößß
drop table t1;
+set names koi8r;
+create table t1(a char character set cp1251 default _koi8r 0xFF);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(1) character set cp1251 default 'ÿ'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(a char character set latin1 default _cp1251 0xFF);
+ERROR 42000: Invalid default value for 'a'
+End of 4.1 tests
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 4382d864bde..0d8975c94c7 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -763,10 +763,6 @@ select old_password(name) from bug20536;
old_password(name)
????????
????????
-select encrypt(name, 'SALT') from bug20536;
-encrypt(name, 'SALT')
-SA5pDi1UPZdys
-SA5pDi1UPZdys
select quote(name) from bug20536;
quote(name)
????????
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index c4c322ae2d0..2b9602215fb 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -924,6 +924,37 @@ NULL
select ifnull(NULL, _utf8'string');
ifnull(NULL, _utf8'string')
string
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_lithuanian_ci);
+insert into t1 values ('I'),('K'),('Y');
+select * from t1 where s1 < 'K' and s1 = 'Y';
+s1
+I
+Y
+select * from t1 where 'K' > s1 and s1 = 'Y';
+s1
+I
+Y
+drop table t1;
+create table t1 (s1 char(5) character set utf8 collate utf8_czech_ci);
+insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
+select * from t1 where s1 > 'd' and s1 = 'CH';
+s1
+ch
+CH
+Ch
+select * from t1 where 'd' < s1 and s1 = 'CH';
+s1
+ch
+CH
+Ch
+select * from t1 where s1 = 'cH' and s1 <> 'ch';
+s1
+cH
+select * from t1 where 'cH' = s1 and s1 <> 'ch';
+s1
+cH
+drop table t1;
create table t1 (a varchar(255)) default character set utf8;
insert into t1 values (1.0);
drop table t1;
diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result
index 32c8028679f..fd789a39d88 100644
--- a/mysql-test/r/heap_btree.result
+++ b/mysql-test/r/heap_btree.result
@@ -294,3 +294,4 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 08f51494e20..7e14874a3e6 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2849,6 +2849,36 @@ SHOW TABLES;
Tables_in_test
t1
DROP TABLE t1;
+DROP VIEW IF EXISTS v1;
+CREATE DATABASE bug21261DB;
+USE bug21261DB;
+CREATE TABLE t1 (x INT);
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
+GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
+GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
+CREATE TABLE t2 (y INT);
+GRANT SELECT ON t2 TO 'user21261'@'localhost';
+INSERT INTO v1 (x) VALUES (5);
+UPDATE v1 SET x=1;
+GRANT SELECT ON v1 TO 'user21261'@'localhost';
+GRANT SELECT ON t1 TO 'user21261'@'localhost';
+UPDATE v1,t2 SET x=1 WHERE x=y;
+SELECT * FROM t1;
+x
+1
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
+DROP USER 'user21261'@'localhost';
+DROP VIEW v1;
+DROP TABLE t1;
+DROP DATABASE bug21261DB;
+USE test;
+create table t1 (f1 datetime);
+create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute))
+drop view v1;
+drop table t1;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v2;
@@ -2887,32 +2917,3 @@ DROP FUNCTION f2;
DROP VIEW v1, v2;
DROP TABLE t1;
End of 5.0 tests.
-CREATE DATABASE bug21261DB;
-USE bug21261DB;
-CREATE TABLE t1 (x INT);
-CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
-GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
-GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
-CREATE TABLE t2 (y INT);
-GRANT SELECT ON t2 TO 'user21261'@'localhost';
-INSERT INTO v1 (x) VALUES (5);
-UPDATE v1 SET x=1;
-GRANT SELECT ON v1 TO 'user21261'@'localhost';
-GRANT SELECT ON t1 TO 'user21261'@'localhost';
-UPDATE v1,t2 SET x=1 WHERE x=y;
-SELECT * FROM t1;
-x
-1
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
-DROP USER 'user21261'@'localhost';
-DROP VIEW v1;
-DROP TABLE t1;
-DROP DATABASE bug21261DB;
-USE test;
-create table t1 (f1 datetime);
-create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
-show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute))
-drop view v1;
-drop table t1;
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index 2d6b55600b1..c18c46b6b08 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -187,4 +187,16 @@ select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1;
#select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1;
#select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1;
drop table t1;
-# End of 4.1 tests
+
+#
+# Bug 20695: problem with field default value's character set
+#
+
+set names koi8r;
+create table t1(a char character set cp1251 default _koi8r 0xFF);
+show create table t1;
+drop table t1;
+--error 1067
+create table t1(a char character set latin1 default _cp1251 0xFF);
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 3690ac958a2..8116d39e3db 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -491,11 +491,16 @@ select export_set(5, name, upper(name), ",", 5) from bug20536;
select password(name) from bug20536;
select old_password(name) from bug20536;
+# Disable test case as encrypt relies on 'crypt' function.
+# "decrypt" is noramlly tested in func_crypt.test which have a
+# "have_crypt.inc" test
+--disable_parsing
# ENCRYPT relies on OS function crypt() which takes a NUL-terminated string; it
# doesn't return good results for strings with embedded 0 bytes. It won't be
# fixed unless we choose to re-implement the crypt() function ourselves to take
# an extra size_t string_length argument.
select encrypt(name, 'SALT') from bug20536;
+--enable_parsing
# QUOTE doesn't work with UCS2 data. It would require a total rewrite
# of Item_func_quote::val_str(), which isn't worthwhile until UCS2 is
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 6c4bc4fff1a..5e3a3f640b1 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -728,6 +728,24 @@ select repeat(_utf8'+',3) as h union select NULL;
select ifnull(NULL, _utf8'string');
#
+# Bug#9509 Optimizer: wrong result after AND with comparisons
+#
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_lithuanian_ci);
+insert into t1 values ('I'),('K'),('Y');
+select * from t1 where s1 < 'K' and s1 = 'Y';
+select * from t1 where 'K' > s1 and s1 = 'Y';
+drop table t1;
+
+create table t1 (s1 char(5) character set utf8 collate utf8_czech_ci);
+insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
+select * from t1 where s1 > 'd' and s1 = 'CH';
+select * from t1 where 'd' < s1 and s1 = 'CH';
+select * from t1 where s1 = 'cH' and s1 <> 'ch';
+select * from t1 where 'cH' = s1 and s1 <> 'ch';
+drop table t1;
+
+#
# Bug#10714: Inserting double value into utf8 column crashes server
#
create table t1 (a varchar(255)) default character set utf8;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index d3689a07237..d3781d58780 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -682,8 +682,6 @@ drop table t2;
drop table t1;
-
-
#
# Bug#20214: Incorrect error when user calls SHOW CREATE VIEW on non
# privileged view
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
index a7f1eeaa2cc..bf18b8da941 100644
--- a/mysql-test/t/handler.test
+++ b/mysql-test/t/handler.test
@@ -1,3 +1,4 @@
+-- source include/not_embedded.inc
#
# test of HANDLER ...
#
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index e74e9723ca6..12c911aa9c9 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -204,3 +204,16 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1;
+select a from t1 where a > 2;
+delete from t1 where a < 4;
+select a from t1 order by a;
+insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
+select a from t1 where a > 4;
+delete from t1 where a > 4;
+select a from t1 order by a;
+select a from t1 where a > 3;
+delete from t1 where a >= 2;
+select a from t1 order by a;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 9f818a4c9f2..ee9c3b2ed45 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2720,8 +2720,51 @@ DROP VIEW t1,v1;
SHOW TABLES;
DROP TABLE t1;
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+#
+# Bug #21261: Wrong access rights was required for an insert to a view
+#
+CREATE DATABASE bug21261DB;
+USE bug21261DB;
+CONNECT (root,localhost,root,,bug21261DB);
+CONNECTION root;
+CREATE TABLE t1 (x INT);
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
+GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
+GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
+CREATE TABLE t2 (y INT);
+GRANT SELECT ON t2 TO 'user21261'@'localhost';
+CONNECT (user21261, localhost, user21261,, bug21261DB);
+CONNECTION user21261;
+INSERT INTO v1 (x) VALUES (5);
+UPDATE v1 SET x=1;
+CONNECTION root;
+GRANT SELECT ON v1 TO 'user21261'@'localhost';
+GRANT SELECT ON t1 TO 'user21261'@'localhost';
+CONNECTION user21261;
+UPDATE v1,t2 SET x=1 WHERE x=y;
+CONNECTION root;
+SELECT * FROM t1;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
+DROP USER 'user21261'@'localhost';
+DROP VIEW v1;
+DROP TABLE t1;
+DROP DATABASE bug21261DB;
+USE test;
+
+#
+# Bug #15950: NOW() optimized away in VIEWs
+#
+create table t1 (f1 datetime);
+create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
+show create view v1;
+drop view v1;
+drop table t1;
#
# Test for BUG#16899: Possible buffer overflow in handling of DEFINER-clause.
#
@@ -2797,45 +2840,3 @@ DROP TABLE t1;
--echo End of 5.0 tests.
-
-#
-# Bug #21261: Wrong access rights was required for an insert to a view
-#
-CREATE DATABASE bug21261DB;
-USE bug21261DB;
-CONNECT (root,localhost,root,,bug21261DB);
-CONNECTION root;
-
-CREATE TABLE t1 (x INT);
-CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
-GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
-GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
-CREATE TABLE t2 (y INT);
-GRANT SELECT ON t2 TO 'user21261'@'localhost';
-
-CONNECT (user21261, localhost, user21261,, bug21261DB);
-CONNECTION user21261;
-INSERT INTO v1 (x) VALUES (5);
-UPDATE v1 SET x=1;
-CONNECTION root;
-GRANT SELECT ON v1 TO 'user21261'@'localhost';
-GRANT SELECT ON t1 TO 'user21261'@'localhost';
-CONNECTION user21261;
-UPDATE v1,t2 SET x=1 WHERE x=y;
-CONNECTION root;
-SELECT * FROM t1;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
-DROP USER 'user21261'@'localhost';
-DROP VIEW v1;
-DROP TABLE t1;
-DROP DATABASE bug21261DB;
-USE test;
-
-#
-# Bug #15950: NOW() optimized away in VIEWs
-#
-create table t1 (f1 datetime);
-create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
-show create view v1;
-drop view v1;
-drop table t1;