• unknown's avatar
    Fixed BUG#1862 (flush table in SPs didn't work). · 1017f0cb
    unknown authored
    Fixed various bugs: setting local variables to NULL, SELECT INTO var now actually
    might work, SELECT INTO with not row now gives a "no data" warning (instead of
    the "empty query" error), etc.
    Updated test cases accordingly.
    
    
    mysql-test/r/sp-error.result:
      Corrected security syntax for alter/create procedure.
    mysql-test/r/sp.result:
      Corrected security syntax for alter/create procedure.
      New tests for setting local variables to null,
      bug fixes for SELECT INTO var, FLUSH TABLES calls (BUG#1862),
      and corrected "no data" warning for SELECT INTO with no rows.
    mysql-test/t/sp-error.test:
      Corrected security syntax for alter/create procedure.
    mysql-test/t/sp.test:
      Corrected security syntax for alter/create procedure.
      New tests for setting local variables to null,
      bug fixes for SELECT INTO var, FLUSH TABLES calls (BUG#1862),
      and corrected "no data" warning for SELECT INTO with no rows.
    sql/lex.h:
      Added SQL_SYM (and added a few _SYM suffixes for new symbols).
    sql/sp_head.cc:
      Fixed bug in the item_list copying for "with_wild" cases (list nodes ended
      up in the wrong memroot).
      Catch errors and warnings even if return values is 0 from sub-statements.
      Restore table_list which is zapped by SQLCOM_CREATE_TABLE and INSERT_SELECT.
      Set old table pointers to NULL after sub-statement call (since all tables are
      closed).
    sql/sql_class.cc:
      Corrected error message when no rows return by a SELECT INTO var; should
      be a "no data" warning.
    sql/sql_lex.h:
      Have to store the original table_list first pointer for some
      sub-statements in SPs.
    sql/sql_yacc.yy:
      Corrected SECURITY INVOKER/DEFINER syntax ("SQL" missing), added some _SYM
      suffixes, and fixed valgrind complaints for SP COMMENTs.
      (Also removed some now irrelevant comments.)
    1017f0cb
sp-error.test 5.56 KB