List:Internals« Previous MessageNext Message »
From:monty Date:September 21 2005 4:28pm
Subject:bk commit into 4.1 tree (monty:1.2443) BUG#7036
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty 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.2443 05/09/21 17:28:25 monty@stripped +2 -0
  Ensure that hex strings are used as integers in cast(... signed/unsigned)
  This fixes the new report for bug #7036

  sql/item.h
    1.191 05/09/21 17:28:23 monty@stripped +1 -0
    Ensure that hex strings are used as integers in cast(... signed/unsigned)

  mysql-test/t/cast.test
    1.19 05/09/21 17:28:23 monty@stripped +4 -0
    Added test for cast(hex-value to signed/unsigned)

# 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:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-4.1

--- 1.190/sql/item.h	2005-08-29 13:44:43 +03:00
+++ 1.191/sql/item.h	2005-09-21 17:28:23 +03:00
@@ -842,6 +842,7 @@
   String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }
   int save_in_field(Field *field, bool no_conversions);
   enum Item_result result_type () const { return STRING_RESULT; }
+  enum Item_result cast_to_int_type() const { return INT_RESULT; }
   enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
   // to prevent drop fixed flag (no need parent cleanup call)
   void cleanup() {}

--- 1.18/mysql-test/t/cast.test	2005-09-15 17:17:10 +03:00
+++ 1.19/mysql-test/t/cast.test	2005-09-21 17:28:23 +03:00
@@ -20,6 +20,10 @@
 select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
 select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
 select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
+select CAST(0xb3 as signed);
+select CAST(0x8fffffffffffffff as signed);
+select CAST(0xffffffffffffffff as unsigned);
+select CAST(0xfffffffffffffffe as signed);
 
 # out-of-range cases
 select cast('18446744073709551616' as unsigned);
Thread
bk commit into 4.1 tree (monty:1.2443) BUG#7036monty21 Sep