• unknown's avatar
    Fix bug #14482 Wrongly applied optimization in resolve_const_item() caused · 76fb5711
    unknown authored
    crash
    
    resolve_const_item() substitutes item which will evaluate to constant with
    equvalent constant item, basing on the item's result type. In this case
    subselect was resolved as constant, and resolve_const_item() was substituting
    it's result's Item_caches to Item_null. Later Item_cache's function was called
    for Item_null object, which caused server crash.
    
    resolve_const_item() now substitutes constants for items with 
    result_type == ROW_RESULT only for Item_rows.
    
    
    sql/item.cc:
      Fix bug #14482 Wrongly applied optimization in resolve_const_item() caused
      crash
      
      resolve_const_item() now applies optimization for items with
      result_type == ROW_RESULT only to Item_rows.
    mysql-test/t/select.test:
      Test case for bug #14482 Wrongly applied optimization in resolve_const_item() caused crash
    mysql-test/r/select.result:
      Test case for bug #14482 Wrongly applied optimization in resolve_const_item() caused crash
    76fb5711
select.result 68.2 KB