• Joerg Bruehe's avatar
    This is a backport from 5.1.32 into 5.1.31sp1. · 8a07ce8b
    Joerg Bruehe authored
    The original fix was done by Ramil Kalimullin on 2009-02-05
    All comments are copied from the original fix:
    
    
    Fix for bug#42014: Crash, name_const with collate
    
    Problem: some queries using NAME_CONST(.. COLLATE ...)
    lead to server crash due to failed type cast.
    
    Fix: return the underlying item's type in case of
    NAME_CONST(.. COLLATE ...) to avoid wrong casting.
    
    
    mysql-test/r/func_misc.result:
      Fix for bug#42014: Crash, name_const with coll
        - test result.
    mysql-test/t/func_misc.test:
      Fix for bug#42014: Crash, name_const with coll
        - test case.
    sql/item.cc:
      Fix for bug#42014: Crash, name_const with coll
        - in case of NAME_CONST('name', 'value' COLLATE collation)
      Item_name_const::type() returns type of 'value' argument 
      to avoid wrong type casting of the Item_name_const items.
    8a07ce8b
item.cc 199 KB