List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:October 23 2007 1:26pm
Subject:bk commit into 5.1 tree (sergefp:1.2592) BUG#31450
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of psergey. When psergey 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@stripped, 2007-10-23 15:26:36+04:00, sergefp@stripped +3 -0
  BUG#31450: Query causes error 1048
  - Let Item::save_in_field() call set_field_to_null_with_conversions() 
    for decimal type, like this is done for the other item result types.

  mysql-test/r/type_decimal.result@stripped, 2007-10-23 15:26:31+04:00, sergefp@stripped +11
-0
    BUG#31450: Query causes error 1048: testcase

  mysql-test/t/type_decimal.test@stripped, 2007-10-23 15:26:32+04:00, sergefp@stripped +19 -0
    BUG#31450: Query causes error 1048: testcase

  sql/item.cc@stripped, 2007-10-23 15:26:32+04:00, sergefp@stripped +1 -1
    BUG#31450: Query causes error 1048
    - Let Item::save_in_field() call set_field_to_null_with_conversions() 
      for decimal type, like this is done for the other item result types.

diff -Nrup a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
--- a/mysql-test/r/type_decimal.result	2007-10-15 13:18:22 +04:00
+++ b/mysql-test/r/type_decimal.result	2007-10-23 15:26:31 +04:00
@@ -805,3 +805,14 @@ SELECT 1 % .1234567891234567891234567891
 SELECT MOD(1,
.123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS
'MOD()';
 MOD()
 0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
+create table t1 (
+ua_id decimal(22,0) not null,
+ua_invited_by_id decimal(22,0) default NULL,
+primary key(ua_id)
+);
+insert into t1 values (123, NULL), (456, NULL);
+this must not produce error 1048: 
+select * from t1 where ua_invited_by_id not in (select ua_id from t1);
+ua_id	ua_invited_by_id
+drop table t1;
+End of 5.1 tests
diff -Nrup a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
--- a/mysql-test/t/type_decimal.test	2007-10-08 02:43:15 +04:00
+++ b/mysql-test/t/type_decimal.test	2007-10-23 15:26:32 +04:00
@@ -416,3 +416,22 @@ DROP TABLE t1;
 
 SELECT 1 %
.123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS
'%';
 SELECT MOD(1,
.123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS
'MOD()';
+
+
+#
+# BUG#31450 "Query causes error 1048"
+#
+create table t1 (
+  ua_id decimal(22,0) not null,
+  ua_invited_by_id decimal(22,0) default NULL,
+  primary key(ua_id)
+);
+insert into t1 values (123, NULL), (456, NULL);
+
+--echo this must not produce error 1048: 
+select * from t1 where ua_invited_by_id not in (select ua_id from t1);
+
+drop table t1;
+
+--echo End of 5.1 tests
+
diff -Nrup a/sql/item.cc b/sql/item.cc
--- a/sql/item.cc	2007-10-21 21:47:23 +04:00
+++ b/sql/item.cc	2007-10-23 15:26:32 +04:00
@@ -4641,7 +4641,7 @@ int Item::save_in_field(Field *field, bo
     my_decimal decimal_value;
     my_decimal *value= val_decimal(&decimal_value);
     if (null_value)
-      return set_field_to_null(field);
+      return set_field_to_null_with_conversions(field, no_conversions);
     field->set_notnull();
     error=field->store_decimal(value);
   }
Thread
bk commit into 5.1 tree (sergefp:1.2592) BUG#31450Sergey Petrunia23 Oct