summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_misc.test
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-19 14:54:05 +0500
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-19 14:54:05 +0500
commit426b551bf600e4c2d0a78227fe51dc009d0231c7 (patch)
tree69db6a293a097f50aa1295d09f80aad52edf2555 /mysql-test/t/func_misc.test
parenta634d1bf474aab88c44d448035b6a9a35d6e795d (diff)
downloadmariadb-git-426b551bf600e4c2d0a78227fe51dc009d0231c7.tar.gz
Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
Problem: lying to the optimizer that a function (Item_func_inet_ntoa) cannot return NULL values leads to unexpected results (in the case group keys creation/comparison is broken). Fix: Item_func_inet_ntoa::maybe_null should be set properly. mysql-test/r/func_misc.result: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - test result. mysql-test/t/func_misc.test: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - test case. sql/item_strfunc.h: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - set Item_func_inet_ntoa::maybe_null flag.
Diffstat (limited to 'mysql-test/t/func_misc.test')
-rw-r--r--mysql-test/t/func_misc.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 8ff62f68e45..5a70daa50e8 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -189,4 +189,12 @@ drop table table_26093;
drop function func_26093_a;
drop function func_26093_b;
+#
+# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
+#
+create table t1 (a int not null);
+insert into t1 values (-1), (-2);
+select min(a) from t1 group by inet_ntoa(a);
+drop table t1;
+
--echo End of 5.0 tests