summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-10-23 11:26:37 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-10-23 11:26:37 +0300
commit933bf869543b43f2a020ad09b881deba736ee838 (patch)
tree2073e303a9bbc3a1a46ace38e3f0734f0c2caab9 /mysql-test/t
parentaec287fd670e7ee51c4ab7dfcd1b18da96ff3dea (diff)
parent578c23860021d7eda334e42b17c90e039474587f (diff)
downloadmariadb-git-933bf869543b43f2a020ad09b881deba736ee838.tar.gz
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt sql/field.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ctype_ucs.test5
-rw-r--r--mysql-test/t/ctype_utf8.test27
-rw-r--r--mysql-test/t/derived.test3
-rw-r--r--mysql-test/t/func_group.test13
-rw-r--r--mysql-test/t/func_regexp.test11
-rw-r--r--mysql-test/t/func_str.test12
-rw-r--r--mysql-test/t/null.test27
-rw-r--r--mysql-test/t/type_date.test22
-rw-r--r--mysql-test/t/type_decimal.test8
-rw-r--r--mysql-test/t/variables.test9
10 files changed, 132 insertions, 5 deletions
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index bca3a9c3a96..5525a5beb6f 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -651,4 +651,9 @@ select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
drop table t1;
+#
+# Bug#30981 CHAR(0x41 USING ucs2) doesn't add leading zero
+#
+select hex(char(0x41 using ucs2));
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index f8eed0bae9a..0ae4b2be0ca 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1403,3 +1403,30 @@ SELECT b FROM t2 UNION SELECT c FROM t1;
SELECT i FROM t2 UNION SELECT c FROM t1;
DROP TABLE t1, t2;
+
+#
+# Bug#30982: CHAR(..USING..) can return a not-well-formed string
+# Bug #30986: Character set introducer followed by a HEX string can return bad result
+#
+set sql_mode=traditional;
+select hex(char(0xFF using utf8));
+select hex(convert(0xFF using utf8));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8 X'616263FF');
+set sql_mode=default;
+select hex(char(0xFF using utf8));
+select hex(convert(0xFF using utf8));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8 X'616263FF');
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 4d8a8e3c3af..4e79fac584f 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -211,7 +211,8 @@ drop table t2;
# select list counter
#
CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
-insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
+insert into t1 values (128, 'rozn', 2, curdate(), 10),
+ (128, 'rozn', 1, curdate(), 10);
SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
DROP TABLE t1;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 2293ac71454..8c020eb3dc8 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -860,5 +860,18 @@ SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
DROP TABLE t1, t2, t3, t4, t5;
+#
+# Bug #31156: mysqld: item_sum.cc:918:
+# virtual bool Item_sum_distinct::setup(THD*): Assertion
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 values (),(),();
+SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1
+ GROUP BY x;
+SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) );
+
+DROP TABLE t1;
+
###
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test
index 23070c71fe9..5eff404bc0f 100644
--- a/mysql-test/t/func_regexp.test
+++ b/mysql-test/t/func_regexp.test
@@ -74,4 +74,13 @@ execute stmt1 using @a;
deallocate prepare stmt1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+
+#
+# Bug #31440: 'select 1 regex null' asserts debug server
+#
+
+SELECT 1 REGEXP NULL;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 1a32580aa0f..e04276fa305 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1124,4 +1124,16 @@ SELECT SUBSTR(a,1,len) FROM t1;
DROP TABLE t1;
+#
+# Bug #28850: Potential bugs related to the return type of the CHAR function
+#
+
+CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from t1;
+DROP TABLE t1;
+
+CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from v1;
+DROP VIEW v1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 65e09b006ec..2878b54c357 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -1,6 +1,6 @@
# Initialise
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2;
--enable_warnings
#
@@ -231,4 +231,27 @@ drop table bug19145a;
drop table bug19145b;
drop table bug19145c;
-# End of 4.1 tests
+--echo # End of 4.1 tests
+
+--echo #
+--echo # Bug #31471: decimal_bin_size: Assertion `scale >= 0 &&
+--echo # precision > 0 && scale <= precision'
+--echo #
+
+CREATE TABLE t1 (a DECIMAL (1, 0) ZEROFILL, b DECIMAL (1, 0) ZEROFILL);
+INSERT INTO t1 (a, b) VALUES (0, 0);
+
+CREATE TABLE t2 SELECT IFNULL(a, b) FROM t1;
+DESCRIBE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT IFNULL(a, NULL) FROM t1;
+DESCRIBE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT IFNULL(NULL, b) FROM t1;
+DESCRIBE t2;
+
+DROP TABLE t1, t2;
+
+--echo # End of 5.0 tests
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index aeb88f3acc2..d4b5e6c6254 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -149,3 +149,25 @@ INSERT INTO t1 VALUES (NULL);
SELECT str_to_date( '', a ) FROM t1;
DROP TABLE t1;
+
+
+#
+# Bug #31221: Optimizer incorrectly identifies impossible WHERE clause
+#
+
+CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (DATE(NOW()), 1);
+SELECT COUNT(*) FROM t1 WHERE a = NOW();
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
+INSERT INTO t1 VALUES (DATE(NOW()), 2);
+SELECT COUNT(*) FROM t1 WHERE a = NOW();
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
+SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1;
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SELECT COUNT(*) FROM t1 WHERE a = NOW();
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 5538f19f5f9..c154b2685dd 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -408,3 +408,11 @@ INSERT INTO t1 VALUES (1.1325,3);
SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
DROP TABLE t1;
+
+#
+# Bug#31019: MOD() function and operator crashes MySQL when
+# divisor is very long and < 1
+#
+
+SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
+SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 0ad85a32568..ed9fc91587d 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -535,7 +535,14 @@ set @test = @@query_prealloc_size;
set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
-# End of 4.1 tests
+#
+# Bug#31588 buffer overrun when setting variables
+#
+# Buffer-size Off By One. Should throw valgrind-warning without fix #31588.
+--error 1231
+set global sql_mode=repeat('a',80);
+
+--echo End of 4.1 tests
#
# Bug#6282 Packet error with SELECT INTO