• Alexander Nozdrin's avatar
    Bug#16056537: MYSQLD CRASHES IN ITEM_FUNC_GET_USER_VAR::FIX_LENGTH_AND_DEC() · 776b5697
    Alexander Nozdrin authored
    The technical problem was that THD::user_var_events_alloc was reset to NULL
    from a valid value when a stored program is executed during the PREPARE statement.
    
    The user visible problem was that the server crashed if user issued a PREPARE
    statement using some combination of stored functions and user variables.
    
    The fix is to restore THD::user_var_events_alloc to the original value.
    This is a minimal fix for 5.5.
    
    More proper patch has been already implemented for 5.6+. It avoids
    evaluation of stored functions for the PREPARE phase.
    
    From the user point of view, this bug is a regression, introduced by the patch for WL2649
    (Number-to-string conversions), revid: bar@mysql.com-20100211041725-ijbox021olab82nv
    However, the code resetting THD::user_var_events_alloc exists even in 5.1.
    The WL just changed the way arguments are converted to strings and the bug became visible.
    776b5697
sp_head.cc 115 KB