• unknown's avatar
    Fixed BUG#3583: query cache doesn't work for stored procedures. · 7aaa1865
    unknown authored
    
    mysql-test/r/sp.result:
      New test case for BUG#3583.
      (And current query is now set correctly.)
    mysql-test/t/sp.test:
      New test case for BUG#3583.
    sql/sp_head.cc:
      Set the thd->query and try to use cached query, if any, when executing a statement.
    sql/sp_head.h:
      Extract the sub-query and store in sp_instr_stmt.
    sql/sql_cache.cc:
      Keep the net->pkt_nr up-to-date when using query cache.
      This makes it work with stored procedures too.
    sql/sql_cache.h:
      Keep the net->pkt_nr up-to-date when using query cache.
      This makes it work with stored procedures too.
    sql/sql_yacc.yy:
      Extract the sub-query and store in sp_instr_stmt.
      (And it's never safe to cache references to local variables.)
    7aaa1865
sql_yacc.yy 198 KB