Several problems here :
 1. The conversion to double of an hex string const item
 was not taking into account the unsigned flag.
 
 2. IN was not behaving in the same was way as comparisons
 when performed over an INT/DATE/DATETIME/TIMESTAMP column
 and a constant. The ordinary comparisons in that case 
 convert the constant to an INTEGER value and do int 
 comparisons. Fixed the IN to do the same.
 
 3. IN is not taking into account the unsigned flag when 
 calculating <expr> IN (<int_const1>, <int_const2>, ...).
 Extended the implementation of IN to store and process
 the unsigned flag for its arguments.


mysql-test/r/func_in.result:
  Bug #19342: test case
mysql-test/t/func_in.test:
  Bug #19342: test case
sql/item.h:
  Bug #19342: correct handling of sign in conersion to real.
sql/item_cmpfunc.cc:
  Bug #19342: exteneded the IN values list
   to support unsigned longlong values.
   Correct comparison of integers in IN with
   regard of signedness.
   Compare DATE/DATETIME/TIMESTAMP values as
   integers in IN.
sql/item_cmpfunc.h:
  Bug #19342: exteneded the IN values list
   to support unsigned longlong values.
   Correct comparison of integers in IN with
   regard of signedness.
This commit is contained in:
unknown 2007-03-02 16:25:56 +02:00
commit b114118ab7
5 changed files with 268 additions and 8 deletions

View file

@ -1766,7 +1766,10 @@ public:
Item_hex_string(const char *str,uint str_length);
enum Type type() const { return VARBIN_ITEM; }
double val_real()
{ DBUG_ASSERT(fixed == 1); return (double) Item_hex_string::val_int(); }
{
DBUG_ASSERT(fixed == 1);
return (double) (ulonglong) Item_hex_string::val_int();
}
longlong val_int();
bool basic_const_item() const { return 1; }
String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }