From 73eafcbf1cc57d0e9a890dad38ba611d496ab5ea Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Oct 2007 14:54:05 +0500 Subject: 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. --- mysql-test/r/func_misc.result | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/r/func_misc.result') diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 35101e26ff6..db2490bd261 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -185,4 +185,10 @@ ERROR 21000: Operand should contain 1 column(s) drop table table_26093; drop function func_26093_a; drop function func_26093_b; +create table t1 (a int not null); +insert into t1 values (-1), (-2); +select min(a) from t1 group by inet_ntoa(a); +min(a) +-2 +drop table t1; End of 5.0 tests -- cgit v1.2.1