• unknown's avatar
    Fix for bug #11896 "Partial locking in case of recursive trigger definitions". · b1921c85
    unknown authored
    If we are in stored function or trigger we should ensure that we won't change
    table that is already used by calling statement (this can damage table or
    easily cause infinite loops). Particularly this means that recursive triggers
    should be disallowed.
    
    
    mysql-test/r/sp-error.result:
      Added tests checking that in functions we don't allow to update tables which
      are used by statements which invoke these functions.
    mysql-test/r/trigger.result:
      Added test for bug #11896 "Partial locking in case of recursive trigger
      definitions".
    mysql-test/t/sp-error.test:
      Added tests checking that in functions we don't allow to update tables which
      are used by statements which invoke these functions.
    mysql-test/t/trigger.test:
      Added test for bug #11896 "Partial locking in case of recursive trigger
      definitions".
    sql/share/errmsg.txt:
      Added error messages for complaining about situations when in function or
      trigger we try to change table which is used in statement invoking this
      function or trigger.
    sql/sql_base.cc:
      open_table():
        If we are in stored function or trigger we should ensure that
        we won't change table that is already used by calling statement
        (this can damage table or easily cause infinite loops).
        So if we are opening table for writing, we should check that it
        is not already open by some calling stamement.
    b1921c85
trigger.result 20.4 KB