MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:gluh Date:November 9 2005 11:38am
Subject:bk commit into 5.0 tree (gluh:1.1977) BUG#14543
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh 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.1977 05/11/09 15:38:31 gluh@stripped +3 -0
  Fix for bug#14543 Relative UPDATE query changing unsigned 
                    int to -1 overflows (value=4294967295)
    set unsigned int field to 0 in case of negative value

  sql/field.cc
    1.290 05/11/09 15:37:09 gluh@stripped +1 -1
    Fix for bug#14543 Relative UPDATE query changing unsigned 
                      int to -1 overflows (value=4294967295)
      set unsigned int field to 0 in case of negative value

  mysql-test/t/type_uint.test
    1.8 05/11/09 15:37:09 gluh@stripped +11 -0
    Fix for bug#14543 Relative UPDATE query changing unsigned 
                      int to -1 overflows (value=4294967295)
      test case

  mysql-test/r/type_uint.result
    1.12 05/11/09 15:37:09 gluh@stripped +10 -0
    Fix for bug#14543 Relative UPDATE query changing unsigned 
                      int to -1 overflows (value=4294967295)
      test case

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/5.0.14543

--- 1.289/sql/field.cc	Mon Nov  7 19:18:31 2005
+++ 1.290/sql/field.cc	Wed Nov  9 15:37:09 2005
@@ -3423,7 +3423,7 @@
   
   if (unsigned_flag)
   {
-    if (nr < 0 && !unsigned_val)
+    if (nr < 0)
     {
       res=0;
       error= 1;

--- 1.11/mysql-test/r/type_uint.result	Tue Sep 28 22:07:51 2004
+++ 1.12/mysql-test/r/type_uint.result	Wed Nov  9 15:37:09 2005
@@ -14,3 +14,13 @@
 0
 4294967295
 drop table t1;
+create table t1 (f1 varchar(50) not null default '' primary key,
+f2 int unsigned not null default 0);
+insert into t1 (f1, f2) values ('insert_update_relative', 0);
+update t1 set f2 = f2 - 1 where f1 = 'insert_update_relative';
+Warnings:
+Warning	1264	Out of range value adjusted for column 'f2' at row 1
+select * from t1;
+f1	f2
+insert_update_relative	0
+drop table t1;

--- 1.7/mysql-test/t/type_uint.test	Thu Jul 28 05:21:50 2005
+++ 1.8/mysql-test/t/type_uint.test	Wed Nov  9 15:37:09 2005
@@ -15,3 +15,14 @@
 drop table t1;
 
 # End of 4.1 tests
+
+#
+# Fix for bug#14543: Relative UPDATE query changing 
+#                    unsigned int to -1 overflows (value=4294967295)
+#
+create table t1 (f1 varchar(50) not null default '' primary key,
+                 f2 int unsigned not null default 0);
+insert into t1 (f1, f2) values ('insert_update_relative', 0);
+update t1 set f2 = f2 - 1 where f1 = 'insert_update_relative';
+select * from t1;
+drop table t1;
Thread
bk commit into 5.0 tree (gluh:1.1977) BUG#14543gluh9 Nov