summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_time.result
diff options
context:
space:
mode:
authorGleb Shchepa <gleb.shchepa@oracle.com>2010-10-31 19:04:38 +0300
committerGleb Shchepa <gleb.shchepa@oracle.com>2010-10-31 19:04:38 +0300
commit0389c6aac0bf32718e2166c97ef6dafb25e20e20 (patch)
tree3af3b3116a958e716120f22f95ce5af2b4799b03 /mysql-test/r/func_time.result
parent9cff440d6088146804707cc8979adfe95852380b (diff)
downloadmariadb-git-0389c6aac0bf32718e2166c97ef6dafb25e20e20.tar.gz
Bug #52160: crash and inconsistent results when grouping
by a function and column The bugreport reveals two different bugs about grouping on a function: 1) grouping by the TIME_TO_SEC function result caused a server crash or wrong results and 2) grouping by the function returning a blob caused an unexpected "Duplicate entry" error and wrong result. Details for the 1st bug: TIME_TO_SEC() returns NULL if its argument is invalid (empty string for example). Thus its nullability depends not only on the nullability of its arguments but also on their values. Fixed by (overoptimistically) setting TIME_TO_SEC() to be nullable despite the nullability of its arguments. Details for the 2nd bug: The server is unable to create indices on blobs without explicit blob key part length. However, this fact was ignored for blob function result fields of GROUP BY intermediate tables. Fixed by disabling GROUP BY index creation for blob function result fields like regular blob fields.
Diffstat (limited to 'mysql-test/r/func_time.result')
-rw-r--r--mysql-test/r/func_time.result14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 4ff4cfa586b..48e837f180f 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1343,4 +1343,18 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
1
1
DROP TABLE t1;
+#
+# Bug #52160: crash and inconsistent results when grouping
+# by a function and column
+#
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+Warning 1292 Truncated incorrect time value: ''
+Warning 1292 Truncated incorrect time value: ''
+DROP TABLE t1;
End of 5.1 tests