Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

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


Below is the list of changes that have just been committed into a local 5.0 repository of ram. When ram does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository.
For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

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'

  • test result.

  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'

  • test case.

  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'

  • set Item_func_inet_ntoa::maybe_null flag.

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

+++ b/mysql-test/r/func_misc.result 2007-10-19 14:54:03 +05: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

+++ b/mysql-test/t/func_misc.test 2007-10-19 14:54:03 +05:00
@@ -189,4 +189,12 @@ drop table table_26093;  drop function func_26093_a;
 drop function func_26093_b;  
Do you need help?X

+#
+# 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
diff -Nrup a/sql/item_strfunc.h b/sql/item_strfunc.h

--- a/sql/item_strfunc.h	2007-07-27 18:42:24 +05:00

+++ b/sql/item_strfunc.h 2007-10-19 14:54:03 +05:00
@@ -683,7 +683,12 @@ public: }

   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.com
Received 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


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library