diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/disabled.def | 2 | ||||
-rw-r--r-- | mysql-test/t/fulltext.test | 12 | ||||
-rw-r--r-- | mysql-test/t/func_math.test | 14 | ||||
-rw-r--r-- | mysql-test/t/group_min_max.test | 21 | ||||
-rw-r--r-- | mysql-test/t/having.test | 16 | ||||
-rw-r--r-- | mysql-test/t/ndb_blob.test | 6 | ||||
-rw-r--r-- | mysql-test/t/ndb_index_unique.test | 14 | ||||
-rw-r--r-- | mysql-test/t/sp-destruct.test | 11 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 5 | ||||
-rw-r--r-- | mysql-test/t/view.test | 17 |
10 files changed, 112 insertions, 6 deletions
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5010e8afb81..a3d00ae73fe 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -33,3 +33,5 @@ rpl_ndb_auto_inc : MySQL Bugs:17086 rpl_ndb_relay_space : Bug 16993 ndb_binlog_ddl_multi : Bug #17038 rpl_ndb_log : MySQL Bugs: #17158 +subselect : Bug#15706 +ndb_load : Bug #17233 diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 7974b74081a..590a7dc495b 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -371,4 +371,16 @@ CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a)); SHOW CREATE TABLE t1; DROP TABLE t1; +# +# BUG#14496: Crash or strange results with prepared statement, +# MATCH and FULLTEXT +# +CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a)); +INSERT INTO t1 VALUES('test'),('test1'),('test'); +PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')"; +EXECUTE stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 9cf0ee452cd..8dc4eb215c7 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -141,3 +141,17 @@ select log(2,-1); select log(-2,1); set sql_mode=''; +# +# Bug #8461 truncate() and round() return false results 2nd argument negative. +# +# round(a,-b) log_10(b) > a +select round(111,-10); +# round on bigint +select round(-5000111000111000155,-1); +# round on unsigned bigint +select round(15000111000111000155,-1); +# truncate on bigint +select truncate(-5000111000111000155,-1); +# truncate on unsigned bigint +select truncate(15000111000111000155,-1); + diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index e15ef92116c..8dc55532bbf 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -715,3 +715,24 @@ select distinct c1, c2 from t1 order by c2; select c1,min(c2) as c2 from t1 group by c1 order by c2; select c1,c2 from t1 group by c1,c2 order by c2; drop table t1; + +# +# Bug #16203: Analysis for possible min/max optimization erroneously +# returns impossible range +# + +CREATE TABLE t1 (a varchar(5), b int(11), PRIMARY KEY (a,b)); +INSERT INTO t1 VALUES ('AA',1), ('AA',2), ('AA',3), ('BB',1), ('AA',4); +OPTIMIZE TABLE t1; + +SELECT a FROM t1 WHERE a='AA' GROUP BY a; +SELECT a FROM t1 WHERE a='BB' GROUP BY a; + +EXPLAIN SELECT a FROM t1 WHERE a='AA' GROUP BY a; +EXPLAIN SELECT a FROM t1 WHERE a='BB' GROUP BY a; + +SELECT DISTINCT a FROM t1 WHERE a='BB'; +SELECT DISTINCT a FROM t1 WHERE a LIKE 'B%'; +SELECT a FROM t1 WHERE a LIKE 'B%' GROUP BY a; + +DROP TABLE t1; diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 1cc894697f9..78628bef198 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -135,6 +135,22 @@ SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a); DROP TABLE t1; +# +# Bug #14927: HAVING clause containing constant false conjunct +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1), (2), (1), (3), (2), (1); + +SELECT a FROM t1 GROUP BY a HAVING a > 1; +SELECT a FROM t1 GROUP BY a HAVING 1 != 1 AND a > 1; +SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1; + +EXPLAIN SELECT a FROM t1 GROUP BY a HAVING 1 != 1 AND a > 1; +EXPLAIN SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1; + +DROP table t1; + # End of 4.1 tests # diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index a12ebee2f0d..f80b7f71281 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -338,7 +338,7 @@ select * from t1 order by a; drop table t1; drop database test2; -# -- bug-5252 tinytext crashes plus no-commit result -- +# -- bug-5252 tinytext crashes + no-commit result + replace -- set autocommit=0; create table t1 ( @@ -352,6 +352,10 @@ select * from t1; delete from t1; select * from t1; commit; +replace t1 set a=2, b='y'; +select * from t1; +delete from t1; +select * from t1; drop table t1; # -- bug-5013 insert empty string to text -- diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 2185276c2c6..8561b3794c4 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -309,4 +309,18 @@ select * from t1 where code = '12' and month = 4 and year = 2004 ; drop table t1; +# bug#15918 Unique Key Limit in NDB Engine + +create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) +engine=ndb charset=utf8; + +insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); +--error 1062 +insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); +select a, sha1(b) from t1; + +# perl -e 'print pack("H2000","e288ab6474"x200)' | sha1sum + +drop table t1; + # End of 4.1 tests diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 25f87f9e661..5fc81c338c6 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -127,6 +127,15 @@ create trigger t1_ai after insert on t1 for each row call bug14233_3(); insert into t1 values (0); # Clean-up -delete from mysql.proc where name like 'bug14233%'; drop trigger t1_ai; drop table t1; + +# +# BUG#16303: erroneus stored procedures and functions should be droppable +# +drop function bug14233_1; +drop function bug14233_2; +drop procedure bug14233_3; +# Assert: These should show nothing. +show procedure status; +show function status; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 74585a0d3b7..45de4010535 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -5125,10 +5125,7 @@ end| call bug14498_1()| call bug14498_2()| call bug14498_3()| -# We couldn't call this before, due to a known bug (BUG#14643) -# QQ We still can't since the new set_case_expr instruction breaks -# the semantics of case; it won't crash, but will get the wrong result. -#call bug14498_4()| +call bug14498_4()| call bug14498_5()| drop procedure bug14498_1| diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index d5aff94e47c..5d1b5a80a9b 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2358,3 +2358,20 @@ EXPLAIN SELECT MIN(a) FROM v1; DROP VIEW v1; DROP TABLE t1; + +# +# Bug#16382: grouping name is resolved against a view column name +# which coincides with a select column name + +CREATE TABLE t1 (x varchar(10)); +INSERT INTO t1 VALUES (null), ('foo'), ('bar'), (null); +CREATE VIEW v1 AS SELECT * FROM t1; + +SELECT IF(x IS NULL, 'blank', 'not blank') FROM v1 GROUP BY x; +SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM t1 GROUP BY x; +SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM v1; +SELECT IF(x IS NULL, 'blank', 'not blank') AS y FROM v1 GROUP BY y; +SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM v1 GROUP BY x; + +DROP VIEW v1; +DROP TABLE t1; |