• Gleb Shchepa's avatar
    Bug #45360: wrong results · ebaba11c
    Gleb Shchepa authored
    Propagation of a large unsigned numeric constant
    in the WHERE expression led to wrong result.
    
    For example,
    "WHERE a = CAST(0xFFFFFFFFFFFFFFFF AS USIGNED) AND FOO(a)",
    where a is an UNSIGNED BIGINT, and FOO() accepts strings,
    was transformed to "... AND FOO('-1')".
    
    That has been fixed.
    
    Also EXPLAIN EXTENDED printed incorrect numeric constants in
    transformed WHERE expressions like above. That has been
    fixed too.
    
    
    mysql-test/r/bigint.result:
      Added test case for bug #45360.
    mysql-test/t/bigint.test:
      Added test case for bug #45360.
    sql/item.cc:
      Bug #45360: wrong results
      
      As far as Item_int_with_ref (and underlaying Item_int)
      class accepts both signed and unsigned 64bit values,
      Item_int::val_str and Item_int::print methods have been
      modified to take into account unsigned_flag.
    ebaba11c
bigint.test 11.9 KB