Details:
- add subtest with drop unrelated view
- rearrange existing tests so that a distinction
between drop procedure and drop function effects
is possible
Bug#12093 "SP not found on second PS execution if another thread
drops other SP in between" and
Bug#21294 "executing a prepared statement that executes a stored
function which was recreat"
Stored functions are resolved at prepared statement prepare only.
If someone flushes the stored functions cache between prepare and
execute, execution fails.
The fix is to detect the situation of the cache flush and automatically
reprepare the prepared statement after it.
mysql-test/r/ps_ddl.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/r/ps_ddl1.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/r/sp-error.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/t/ps_ddl.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
mysql-test/t/ps_ddl1.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
mysql-test/t/sp-error.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
sql/sp_cache.cc:
Implement sp_cache_version() -- returns the current version of
a stored routines cache.
sql/sp_cache.h:
Declare sp_cache_version().
sql/sql_prepare.cc:
Keep track of stored functions cache version, and invalidate
the statement if it changed between prepared statement
prepare and execute (and the statement actually uses stored routines).
and table DDL changed after PREPARE" to pass in embedded mode.
mysql-test/r/ps.result:
Update results (Bug#27430)
mysql-test/r/ps_ddl.result:
Update results (Bug#27430)
mysql-test/t/ps.test:
Add a test case for Bug#27430. ps.test is not run in --embedded-server,
thus it now contains the part of the test for Bug#27430 that
doesn't work in embedded server.
mysql-test/t/ps_ddl.test:
Move a part of the test for Bug#27430 that doesn't work
in embedded server to ps.test, that includes not_embedded.inc.
mysql-test/r/ps_ddl.result:
Updated results
mysql-test/t/ps_ddl.test:
- add missing subtests
- add comments + minor reformatting for better overview on content
mysql-test/r/ps_ddl1.result:
Expected results
mysql-test/t/ps_ddl1.test:
Script for tests which do not really fit into ps_ddl
Add metadata validation to ~20 more SQL commands. Make sure that
these commands actually work in ps-protocol, since until now they
were enabled, but not carefully tested.
Fixes the ml003 bug found by Matthias during internal testing of the
patch.
mysql-test/r/ps_ddl.result:
Update test results (WL#4165)
mysql-test/t/ps_ddl.test:
Cover with tests metadata validation of 26 SQL statements.
sql/mysql_priv.h:
Fix the name in the comment.
sql/sp_head.cc:
Changed the way the observer is removed in case of stored procedures
to support validation prepare stmt from "call p1(<expr>)": whereas
tables used in the expression must be validated, substatements
of p1 must not.
The previous scheme used to silence the observer only in stored
functions and triggers.
sql/sql_class.cc:
Now the observer is silenced in sp_head::execute(). Remove it from
Sub_statement_state.
sql/sql_class.h:
Now the observer is silenced in sp_head::execute(). Remove it from
Sub_statement_state.
sql/sql_parse.cc:
Add CF_REEXECUTION_FRAGILE to 20 more SQLCOMs that need it.
sql/sql_prepare.cc:
Add metadata validation to ~20 new SQLCOMs that need it.
Fix memory leaks with expressions used in SHOW DATABASES and CALL
(and prepared statements).
We need to fix all expressions at prepare, since if these expressions
use subqueries, there are one-time transformations of the parse
tree that must be done at prepare.
List of fixed commands includes: SHOW TABLES, SHOW DATABASES,
SHOW TRIGGERS, SHOW EVENTS, SHOW OPEN TABLES,SHOW KEYS, SHOW FIELDS,
SHOW COLLATIONS, SHOW CHARSETS, SHOW VARIABLES, SHOW TATUS, SHOW TABLE
STATUS, SHOW PROCEDURE STATUS, SHOW FUNCTION STATUS, CALL.
Add comment to set_parameters().
sql/table.h:
Update comments.