|
|||||||||||
|
bk commit into 5.0 tree (ramil:1.2542) BUG#31349
From: <ramil(at)mysql.com>
Date: Fri Oct 19 2007 - 05:54:08 EDT
ChangeSet@1.2542, 2007-10-19 14:54:05+05:00, ramil@mysql.com +3 -0 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@1.28, 2007-10-19 14:54:03+05:00, ramil@mysql.com +6 -0 Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
mysql-test/t/func_misc.test@1.22, 2007-10-19 14:54:03+05:00, ramil@mysql.com +8 -0 Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
sql/item_strfunc.h@1.124, 2007-10-19 14:54:03+05:00, ramil@mysql.com +6 -1 Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
diff -Nrup a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result --- a/mysql-test/r/func_misc.result 2007-03-02 06:20:46 +04:00@@ -185,4 +185,10 @@ ERROR 21000: Operand should contain 1 co 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 diff -Nrup a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test --- a/mysql-test/t/func_misc.test 2007-03-02 06:20:46 +04:00@@ -189,4 +189,12 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; +# --- a/sql/item_strfunc.h 2007-07-27 18:42:24 +05:00 String* val_str(String* str); const char *func_name() const { return "inet_ntoa"; } - void fix_length_and_dec() { decimals = 0; max_length=3*8+7; } + void fix_length_and_dec() + { + decimals= 0; + max_length= 3 * 8 + 7; + maybe_null= 1; + } }; class Item_func_quote :public Item_str_func -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Fri Oct 19 05:54:54 2007 This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 10:13:14 EDT |
||||||||||
|
|||||||||||