diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/alter_table_trans.test | 12 | ||||
-rw-r--r-- | mysql-test/t/ctype_cp1251.test | 8 | ||||
-rw-r--r-- | mysql-test/t/ctype_latin1.test | 4 | ||||
-rw-r--r-- | mysql-test/t/ctype_ucs2_query_cache.test | 1 | ||||
-rw-r--r-- | mysql-test/t/fulltext.test | 43 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 28 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 13 | ||||
-rw-r--r-- | mysql-test/t/having.test | 36 | ||||
-rw-r--r-- | mysql-test/t/multi_update.test | 41 | ||||
-rw-r--r-- | mysql-test/t/mysql_upgrade.test | 1 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 15 | ||||
-rw-r--r-- | mysql-test/t/parser.test | 25 | ||||
-rw-r--r-- | mysql-test/t/plugin.test | 3 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 6 | ||||
-rw-r--r-- | mysql-test/t/type_date.test | 29 | ||||
-rw-r--r-- | mysql-test/t/type_datetime.test | 30 | ||||
-rw-r--r-- | mysql-test/t/view.test | 34 | ||||
-rw-r--r-- | mysql-test/t/xml.test | 14 |
18 files changed, 340 insertions, 3 deletions
diff --git a/mysql-test/t/alter_table_trans.test b/mysql-test/t/alter_table_trans.test index 29b9b4c212f..19b40d84b22 100644 --- a/mysql-test/t/alter_table_trans.test +++ b/mysql-test/t/alter_table_trans.test @@ -32,4 +32,16 @@ insert t1 values (repeat('3', 8193),3,1,1); ALTER TABLE t1 ADD PRIMARY KEY (col4(10)) , ADD UNIQUE KEY uidx (col3); DROP TABLE t1; +# +# MDEV-5743 Server crashes in mysql_alter_table on an attempt to add a primary key to InnoDB table +# + +CREATE TABLE t1 (a INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (2); +ALTER TABLE t1 ADD PRIMARY KEY (a); +ALTER TABLE t1 DROP PRIMARY KEY; +INSERT INTO t1 VALUES (2); +--error ER_DUP_ENTRY +ALTER TABLE t1 ADD PRIMARY KEY (a); +DROP TABLE t1; diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index ab260f0c7e8..0455f579922 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -95,6 +95,14 @@ SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1; SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-5459 Illegal mix of collations for datetime +--echo # +SET NAMES cp1251; +CREATE TABLE t1 (dt DATETIME); +INSERT INTO t1 VALUES ('2014-01-02 10:20:30'); +SELECT date(dt) FROM t1 WHERE (CASE WHEN 1 THEN date(dt) ELSE null END >= '2013-12-01 00:00:00'); +DROP TABLE t1; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index d893b9d9458..99ac2d19b70 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -79,6 +79,10 @@ select 'a' regexp 'A' collate latin1_general_cs; select 'a' regexp 'A' collate latin1_bin; +SET @test_character_set= 'latin1'; +SET @test_collation= 'latin1_swedish_ci'; +-- source include/ctype_common.inc + SET collation_connection='latin1_swedish_ci'; -- source include/ctype_filesort.inc -- source include/ctype_like_escape.inc diff --git a/mysql-test/t/ctype_ucs2_query_cache.test b/mysql-test/t/ctype_ucs2_query_cache.test index bdc1d079d5e..0ac09b2ba4b 100644 --- a/mysql-test/t/ctype_ucs2_query_cache.test +++ b/mysql-test/t/ctype_ucs2_query_cache.test @@ -12,6 +12,7 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3),(4); SELECT * FROM t1; +SELECT * FROM t1; DROP TABLE t1; --echo # diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 6e44b4c1578..9dfc49d3dfd 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -647,6 +647,49 @@ DROP TABLE t1; --echo End of 5.1 tests +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-6146 Can't mix (latin1_swedish_ci,NUMERIC) and (utf8_unicode_ci,IMPLICIT) for MATCH +--echo # +SET NAMES utf8; +CREATE TABLE t1 +( + txt text COLLATE utf8_unicode_ci NOT NULL, + uid int(11) NOT NULL, + id2 int(11) NOT NULL, + KEY uid (uid), + KEY id2 (id2) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t1 VALUES ('txt1',1234,5678); +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('txt1' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('1234' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('5678' IN BOOLEAN MODE); +DROP TABLE t1; + +CREATE TABLE t1 ( + txt1 text COLLATE utf8_unicode_ci NOT NULL, + txt2 text COLLATE latin1_swedish_ci NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t1 VALUES ('nnn1 x1 y1 ööö1','mmm1 ùùù1'); +INSERT INTO t1 VALUES ('nnn2 x2 y2 ööö2','mmm2 ùùù2'); +INSERT INTO t1 VALUES ('nnn3 x3 y3 ööö3','mmm3 ùùù3'); +INSERT INTO t1 VALUES ('nnn4 x4 y4 ööö4','mmm4 ùùù4'); +INSERT INTO t1 VALUES ('nnn5 x5 y5 ööö5','mmm5 '); +SELECT * FROM t1 WHERE MATCH (txt1,txt2) AGAINST ('ööö1' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (txt1,txt2) AGAINST ('ùùù2' IN BOOLEAN MODE); +DROP TABLE t1; + +--echo # +--echo # End of 5.5 tests +--echo # + +# +# MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). +# + CREATE TABLE t1 ( id int(11) auto_increment, title varchar(100) default '', diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 5257c47741b..ed11333dd95 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1409,6 +1409,34 @@ drop table t1; --echo End of 5.1 tests +--echo # +--echo # Start of 5.3 tests +--echo # + +--echo # +--echo # Bug#11829861: SUBSTRING_INDEX() RESULTS IN MISSING CHARACTERS WHEN USED +--echo # INSIDE LOWER() +--echo # +SET @user_at_host = 'root@mytinyhost-PC.local'; +SELECT LOWER(SUBSTRING_INDEX(@user_at_host, '@', -1)); +--echo # End of test BUG#11829861 + +--echo # +--echo # Bug#42404: SUBSTRING_INDEX() RESULTS ARE INCONSISTENT +--echo # + +CREATE TABLE t (i INT NOT NULL, c CHAR(255) NOT NULL); +INSERT INTO t VALUES (0,'.www.mysql.com'),(1,'.wwwmysqlcom'); +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t WHERE i = 1; +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t; +DROP TABLE t; +--echo # End of test BUG#42404 + +--echo # +--echo # End of 5.3 tests +--echo # + + --echo Start of 5.4 tests # # WL#4584 Internationalized number format diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index e92780f0523..5d59acf9320 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1643,6 +1643,18 @@ FROM t1 JOIN t2 ON c = b GROUP BY b WITH ROLLUP; DROP TABLE t1,t2; --echo # +--echo # MDEV-6129: Server crashes during UNION with ORDER BY field IS NULL +--echo # + +SET sql_mode='ONLY_FULL_GROUP_BY'; +SELECT 1 AS test UNION SELECT 2 AS test ORDER BY test IS NULL ASC; +SET sql_mode=''; + +# +# End of MariaDB 5.5 tests +# + +--echo # --echo # Bug #58782 --echo # Missing rows with SELECT .. WHERE .. IN subquery --echo # with full GROUP BY and no aggr @@ -1690,3 +1702,4 @@ DROP TABLE t1; DROP TABLE where_subselect; --echo # End of Bug #58782 + diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 78f6ff4a880..cd6a4c9d328 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -659,6 +659,41 @@ drop table t1,t2,t3; --echo End of 5.2 tests --echo # +--echo # Bug mdev-6116: an equality in the conjunction of HAVING +--echo # and IN subquery in WHERE +--echo # (The bug is caused by the same problem as bug mdev-5927) +--echo # + +CREATE TABLE t1 (f_key varchar(1), f_nokey varchar(1), INDEX(f_key)); +INSERT INTO t1 VALUES ('v','v'),('s','s'); + +CREATE TABLE t2 (f_int int, f_key varchar(1), INDEX(f_key)); +INSERT INTO t2 VALUES +(4,'j'),(6,'v'),(3,'c'),(5,'m'),(3,'d'),(2,'d'),(2,'y'), +(9,'t'),(3,'d'),(8,'s'),(1,'r'),(8,'m'),(8,'b'),(5,'x'); + +SELECT t2.f_int FROM t1 INNER JOIN t2 ON (t2.f_key = t1.f_nokey) +WHERE t1.f_nokey IN ( + SELECT t1.f_key FROM t1, t2 WHERE t1.f_key = t2.f_key +) HAVING t2.f_int >= 0 AND t2.f_int != 0; + +DROP TABLE t1,t2; + +--echo # +--echo # Bug mdev-5927: an equality in the conjunction of HAVING +--echo # and an equality in WHERE +--echo # + +CREATE TABLE t1 (pk int PRIMARY KEY, f int NOT NULL, INDEX(f)); +INSERT INTO t1 VALUES (1,0), (2,8); + +SELECT * FROM t1 WHERE f = 2 HAVING ( pk IN ( SELECT 9 ) AND f != 0 ); + +DROP TABLE t1; + +--echo End of 5.3 tests + +--echo # --echo # Bug mdev-5160: two-way join with HAVING over the second table --echo # @@ -673,3 +708,4 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; DROP TABLE t1,t2; --echo End of 10.0 tests + diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 78f0076f98c..4f8736f0c2d 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -808,6 +808,47 @@ SELECT * FROM t2; DROP TABLE t1,t2; +--echo # +--echo # MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only +--echo # sub-table fails +--echo # MDEV-6193: Problems with multi-table updates that JOIN against +--echo # read-only table +--echo # + +CREATE TABLE t1 ( + id int(10) unsigned, + a int(11) +) ENGINE=MyISAM; + +CREATE TABLE t3 ( + id int(10) unsigned, + b int(11) +) ENGINE=MyISAM; + +CREATE TABLE t2 ( + id int(10) unsigned, + b int(11) +) ENGINE=MRG_MyISAM UNION=(t3); + +FLUSH TABLES; + +let $MYSQLD_DATADIR= `select @@datadir`; +--disable_result_log +--exec $MYISAMPACK -f $MYSQLD_DATADIR/test/t3 +--exec $MYISAMCHK -rq $MYSQLD_DATADIR/test/t3 +--enable_result_log + +update t1 join t2 using (id) set t1.a=t2.b; +create view v2 as select * from t2; +update t1 join v2 using (id) set t1.a=0; +create view v1 as select * from t3; +update t1 join v1 using (id) set t1.a=0; +update t1 join INFORMATION_SCHEMA.CHARACTER_SETS on (id=MAXLEN) set t1.a=0; +create view v3 as select t2.id, t3.b from t2 join t3 using(id); +update t1 join v3 using (id) set t1.a=0; +drop view v1, v2, v3; +drop table t2, t3, t1; + --echo end of 5.5 tests diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index 6de81879001..8c641428353 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -131,7 +131,6 @@ let $MYSQLD_DATADIR= `select @@datadir`; # so the following command should never fail. --remove_file $MYSQLD_DATADIR/mysql_upgrade_info - --echo # --echo # MDEV-4332 Increase username length from 16 characters --echo # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 6e717e85122..9d6789541c0 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2458,3 +2458,18 @@ drop table t1, t2; --echo # --echo # End of 5.1 tests --echo # + +# +# MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server +# +--error 2 +--exec $MYSQL_DUMP -hunknownhost --dump-slave nulldb + +# +# MDEV-6056 [PATCH] mysqldump writes usage to stdout even when not explicitly requested +# +--replace_result mysqldump.exe mysqldump +--error 1 +--exec $MYSQL_DUMP --user=foo 2>&1 > $MYSQLTEST_VARDIR/tmp/bug6056.out +--exec $MYSQL_DUMP --help > $MYSQLTEST_VARDIR/tmp/bug6056.out + diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index 2c8cfafb90a..f59a5d01cf5 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -733,3 +733,28 @@ DROP TABLE t1, t2, t3; --echo # End of 5.1 tests --echo # +--echo # +--echo # Bug#17075846 : unquoted file names for variable values are +--echo # accepted but parsed incorrectly +--echo # +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine=a.myisam; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = .a.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = a.b.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.`MyISAM`; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = "a.MYISAM"; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = 'a.MYISAM'; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = `a.MYISAM`; +CREATE TABLE t1 (s VARCHAR(100)); +--ERROR ER_BAD_FIELD_ERROR +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +DROP TABLE t1; diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index fb608ee5bf8..0655aff9fc9 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -26,9 +26,12 @@ SELECT * FROM t1; # a couple of tests for variables set global example_ulong_var=500; set global example_enum_var= e1; +set session example_int_var= -1; show status like 'example%'; show variables like 'example%'; +select @@session.example_int_var; + UNINSTALL SONAME 'ha_example'; # the engine is NOT uninstalled yet, diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e7cb505b19f..d1c3774947a 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5884,3 +5884,9 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B DROP TABLE t1,t2; +--echo # +--echo # MDEV-5991: crash in Item_field::used_tables +--echo # +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +drop table t1; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 6cfd9711c3e..6b8ed128f4b 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -319,9 +319,36 @@ SELECT DATE('0'), IFNULL(DATE('0'),CURRENT_DATE) AS d1, DATE('20011107')>IFNULL(DATE('0'),CURRENT_DATE) AS cmp; -SET @@timestamp=DEFAULT; --echo # +--echo # MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +--echo # +SELECT CAST(TIME('-800:20:30') AS DATE); +SELECT CAST(TIME('800:20:30') AS DATE); +SELECT CAST(TIME('33 08:20:30') AS DATE); +CREATE TABLE t1 (a DATE); +INSERT INTO t1 VALUES (TIME('800:20:30')); +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +DROP TABLE t1; +DELIMITER |; +CREATE PROCEDURE test5041() +BEGIN + DECLARE t TIME; + DECLARE d DATE; + SET t= TIME('800:00:00'); + SET d= t; + SELECT d; +END;| +DELIMITER ;| +call test5041(); +drop procedure test5041; + +SET @@timestamp=DEFAULT; +--echo # --echo # End of 5.3 tests --echo # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index a1c0509666a..b841d8b1def 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -491,6 +491,36 @@ drop table t1,t2; --echo # SELECT CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5'); + +--echo # +--echo # MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +--echo # +SET @@timestamp=UNIX_TIMESTAMP('2013-08-19 20:30:00'); +SELECT CAST(TIME('-800:20:30') AS DATETIME); +SELECT CAST(TIME('800:20:30') AS DATETIME); +SELECT CAST(TIME('33 08:20:30') AS DATETIME); +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (TIME('800:20:30')); +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +DROP TABLE t1; +DELIMITER |; +CREATE PROCEDURE test5041() +BEGIN + DECLARE t TIME; + DECLARE dt DATETIME; + SET t= TIME('800:20:30'); + SET dt= t; + SELECT dt; +END;| +DELIMITER ;| +call test5041(); +drop procedure test5041; + +SET @@timestamp=DEFAULT; --echo End of 5.3 tests --echo # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 7402e992350..e36e22bdfac 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -750,6 +750,21 @@ drop view v1; drop table t1; # +# VIEW over non-existing column +# +create table t1 (a varchar(20)); +create view v1 as select a from t1; +alter table t1 change a aa int; +--error ER_VIEW_INVALID +select * from v1; +--replace_column 8 # 12 # 13 # +show table status; +show create view v1; +drop view v1; +drop table t1; + + +# # VIEW with floating point (long number) as column # create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1; @@ -4937,6 +4952,25 @@ select * from v1; drop view v1; drop table t1; +--echo # +--echo # MDEV-5981: name resolution issues with views and multi-update +--echo # in ps-protocol +--echo # + +create table t1 (id1 int primary key, val1 varchar(20)); +insert into t1 values (1, 'test1'); +create table t2 (id2 int primary key, val2 varchar(20)); +insert into t2 values (1, 'test2'); +create algorithm=merge view v1 as select id1 as id1v1, val1 as val1v1 from t1; +create algorithm=merge view v2 as +select t2.id2 as id2v2, t2.val2 as val2v2 +from t2, v1 +where t2.id2 = v1.id1v1; +prepare stmt1 from "update v2 set val2v2 = 'test19' where 1 = id2v2"; +execute stmt1; +deallocate prepare stmt1; +drop view v1,v2; +drop table t1,t2; --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index bc9a74fd8cd..371fcb72b0d 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -53,7 +53,7 @@ SELECT extractValue(@xml,'/a//@x'); SELECT extractValue(@xml,'/a//@x[1]'); SELECT extractValue(@xml,'/a//@x[2]'); -SET @xml='<a><b>b1</b><b>b2</b><c><b>c1b1</b><b>c1b2</b></c><c><b>c2b1</c></b></a>'; +SET @xml='<a><b>b1</b><b>b2</b><c><b>c1b1</b><b>c1b2</b></c><c><b>c2b1</b></c></a>'; SELECT extractValue(@xml,'//b[1]'); SELECT extractValue(@xml,'/descendant::b[1]'); @@ -653,6 +653,18 @@ SELECT ExtractValue(CONVERT('<\"', BINARY(10)), 1); --echo End of 5.1 tests +--echo # +--echo # Start of 5.3 tests +--echo # + +--echo # +--echo # MDEV-5338 XML parser accepts malformed data +--echo # +SELECT ExtractValue('<a>xxx</c>','/a/b'); +SELECT ExtractValue('<a><b>xxx</c></a>','/a/b'); + +--echo # +--echo # End of 5.3 tests --echo # --echo # Start of 5.5 tests |