• unknown's avatar
    Fix for bug #32103: optimizer crash when join on int and mediumint with · 0a7a55d1
    unknown authored
    variable in where clause.
    
    Problem: the new_item() method of Item_uint used an incorrect
    constructor. "new Item_uint(name, max_length)" calls
    Item_uint::Item_uint(const char *str_arg, uint length) which assumes the
    first argument to be the string representation of the value, not the
    item's name. This could result in either a server crash or incorrect
    results depending on usage scenarios.
    
    Fixed by using the correct constructor in new_item():
    Item_uint::Item_uint(const char *str_arg, longlong i, uint length).
    
    
    mysql-test/r/select.result:
      Added a test case for bug #32103.
    mysql-test/t/select.test:
      Added a test case for bug #32103.
    sql/item.h:
      Use the correct constructor for Item_uint in Item_uint::new_item().
    0a7a55d1
item.h 45.5 KB