• unknown's avatar
    "Fix" for bug #11394 "Recursion in SP crash server" and bug #11600 · 0f64a495
    unknown authored
    "Stored procedures: crash with function calling itself".
    
    Disallow recursive stored routines until we either make Item's and LEX
    reentrant safe or will use spearate sp_head instances (and thus separate
    LEX objects and Item trees) for each routine invocation.
    
    
    mysql-test/r/sp-error.result:
      Added tests for bug #11394 "Recursion in SP crash server" and
      bug #11600 "Stored procedures: crash with function calling itself".
      (We simply disallow recursion for stored routines).
    mysql-test/r/sp.result:
      Disabled test cases containing recursive stored routines until we will
      support for them.
    mysql-test/t/sp-error.test:
      Added tests for bug #11394 "Recursion in SP crash server" and
      bug #11600 "Stored procedures: crash with function calling itself".
      (We simply disallow recursion for stored routines).
    mysql-test/t/sp.test:
      Disabled test cases containing recursive stored routines until we will
      support for them.
    sql/share/errmsg.txt:
      Added error message saying that recursive stored routines are disallowed.
    sql/sp_head.cc:
      sp_head::execute():
        Since many Item's and LEX members can't be used in reentrant fashion
        we have to disable recursion for stored routines. So let us track
        routine invocations using sp_head::m_is_invoked member and raise
        error when one attempts to call routine recursively.
    sql/sp_head.h:
      sp_head:
        Added m_is_invoked member for tracking of routine invocations and
        preventing recursion.
    0f64a495
sp_head.cc 58.9 KB