Loading mysql-test/t/cast.test +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR); 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); Loading sql/item.h +1 −0 Original line number Diff line number Diff line Loading @@ -842,6 +842,7 @@ class Item_varbinary :public Item 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() {} Loading Loading
mysql-test/t/cast.test +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR); 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); Loading
sql/item.h +1 −0 Original line number Diff line number Diff line Loading @@ -842,6 +842,7 @@ class Item_varbinary :public Item 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() {} Loading