List:Internals« Previous MessageNext Message »
From:ramil Date:May 18 2005 2:30pm
Subject:bk commit into 5.0 tree (ramil:1.1852) BUG#10539
View as plain text  
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.1852 05/05/18 17:30:11 ramil@stripped +3 -0
  a fix (bug #10539: When inserting out of range value in BIT, different engines behaves
differently).           

  sql/field.cc
    1.260 05/05/18 17:30:05 ramil@stripped +3 -2
    a fix (bug #10539: When inserting out of range value in BIT, different engines behaves
differently).           
    we have to set the first byte only if there is(are) uneven bit(s).

  mysql-test/t/type_bit.test
    1.9 05/05/18 17:30:05 ramil@stripped +9 -0
    a fix (bug #10539: When inserting out of range value in BIT, different engines behaves
differently).           

  mysql-test/r/type_bit.result
    1.10 05/05/18 17:30:05 ramil@stripped +8 -0
    a fix (bug #10539: When inserting out of range value in BIT, different engines behaves
differently).           

# 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:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/5.0.b10539

--- 1.259/sql/field.cc	2005-05-12 19:36:29 +05:00
+++ 1.260/sql/field.cc	2005-05-18 17:30:05 +05:00
@@ -7821,7 +7821,7 @@
 
 int Field_bit::store(double nr)
 {
-  return (Field_bit::store((longlong) nr));
+  return store((longlong) nr);
 }
 
 
@@ -8004,7 +8004,8 @@
       (delta == 0 && bits && (uint) (uchar) *from >= (uint) (1
<< bits)))
   {
     memset(ptr, 0xff, field_length);
-    *ptr&= ((1 << bits) - 1); /* set first byte */
+    if (bits)
+      *ptr&= ((1 << bits) - 1); /* set first byte */
     set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
     return 1;
   }

--- 1.9/mysql-test/r/type_bit.result	2005-05-05 17:11:23 +05:00
+++ 1.10/mysql-test/r/type_bit.result	2005-05-18 17:30:05 +05:00
@@ -458,3 +458,11 @@
 h
 a
 drop table t1;
+create table t1 (a bit(8)) engine=heap;
+insert into t1 values ('1111100000');
+Warnings:
+Warning	1264	Out of range value adjusted for column 'a' at row 1
+select a+0 from t1;
+a+0
+255
+drop table t1;

--- 1.8/mysql-test/t/type_bit.test	2005-05-05 17:11:23 +05:00
+++ 1.9/mysql-test/t/type_bit.test	2005-05-18 17:30:05 +05:00
@@ -162,3 +162,12 @@
 insert into t1 set a=1;
 select h from t1;
 drop table t1;
+
+#
+# Bug #10539
+#
+
+create table t1 (a bit(8)) engine=heap;
+insert into t1 values ('1111100000');
+select a+0 from t1;
+drop table t1;
Thread
bk commit into 5.0 tree (ramil:1.1852) BUG#10539ramil18 May