mysql-test/r/sp-threads.result:
Testcase for BUG#12228
mysql-test/t/sp-threads.test:
Testcase for BUG#12228
sql/sp_cache.cc:
BUG#12228: Post-review fixes: small code cleanup
sql/sp_cache.h:
BUG#12228: Post-review fixes: fixed the comment
sql/sql_parse.cc:
BUG#12228: Post-review fixes: in mysql_parse, flush obsolete SPs from the caches only if
the query hasn't been handled by the query cache.
sql/sql_prepare.cc:
BUG#12228: Post-review fixes: in mysql_stmt_prepare/execute, flush SP caches
"closer to the execution"
* Cleanup SP Cache code, now SP Cache only deletes sp_head objects in
sp_cache_flush_obsolete() invalidates all pointers to routines in the cache.
* Use new SP Cache use contract in the code.
There is no test case because it doesn't seem to be possible to cause thread races to end
the same way they end in heavy-load test. This patch removes the crash in heavy test.
mysql-test/r/type_bit.result:
Drop the tables this test tries to create
mysql-test/r/view.result:
Drop function this test creates
mysql-test/t/type_bit.test:
Drop the tables this test tries to create
mysql-test/t/view.test:
Drop function this test creates
sql/sp.cc:
Fix for BUG#12228: When a routine is deleted/modified, invalidate all cached SPs in all
threads. We need to do so because sp_lex_keeper::{prelocking_tables, query_tables_own_last}
in one SP may depend on another SP sp_lex_keeper::m_lex is using.
sql/sp_cache.cc:
Fix for BUG#12228:
* Move class sp_cache to here from sp_cache.h, document the functions.
* sp_cache_insert, sp_cache_remove, sp_cache_invalidate and sp_cache_lookup must not delete
sp_head* objects as they may be called during SP execution when sp_head objects are used.
* Added sp_cache_flush_obsolete() function that may delete sp_head objects.
* Removed sp_cache_remove as there is no need for it now - when we change one SP we should
invalidate all other SPs, because sp_lex_keeper::{prelocking_tables,
query_tables_own_last} from one SP depend on content of another SP (used in
sp_lex_keeper::m_lex).
sql/sp_cache.h:
Fix for BUG#12228:
* Move class sp_cache to sp_cache.cc it is not needed in .h file
* Added comments
sql/sql_parse.cc:
Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before running the query
sql/sql_prepare.cc:
Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before preparing/executing a PS
* Don't activate prelocking mode for evaluating procedure arguments when it is not necessary.
* Code structure simplification and cleanup.
* Cleanup in .test files
mysql-test/r/sp-prelocking.result:
Prelocking-free SPs, post-review fixes:
Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun)
mysql-test/r/sp-security.result:
Don't drop the table we're not using.
mysql-test/r/sp.result:
Prelocking-free SPs, post-review fixes:
remove redundant "drop table if exists t3" statements
mysql-test/t/sp-prelocking.test:
Prelocking-free SPs, post-review fixes:
Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun)
mysql-test/t/sp-security.test:
Don't drop the table we're not using.
mysql-test/t/sp.test:
Prelocking-free SPs, post-review fixes:
remove redundant "drop table if exists t3" statements
sql/sp.cc:
New, better defined, sp_get_prelocking_info() function to get info about
statement prelocking options
sql/sp.h:
Prelocking-free SPs, post-review fixes: New, better defined, sp_get_prelocking_info()
function to get info about statement prelocking options
sql/sp_cache.h:
Prelocking-free SPs, post-review fixes: Amended the comments
sql/sp_head.cc:
Prelocking-free SPs, post-review fixes: Amend the comments, simplify the code that
attaches removes statement's prelocking tables.
sql/sql_base.cc:
Prelocking-free SPs, post-review fixes:
* Use a better defined sp_get_prelocking_info() function to get info about
statement prelocking options
* Don't activate prelocked mode for evaluation of SP arguments that use tables
but don't need prelocking.
sql/sql_class.cc:
Prelocking-free SPs, post-review fixes: Initialize THD members in the order they are declared.
its body, but lets each statement to get/release its own locks. This allows a broader set
of statements to be executed inside PROCEDUREs (but breaks replication)
This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
mysql-test/r/sp-security.result:
Drop tables this test attempts to create
mysql-test/r/sp-threads.result:
Update test results
mysql-test/r/sp.result:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/r/view.result:
Enabled a test case that now works with prelocking-free SPs
mysql-test/t/sp-security.test:
Drop tables this test attempts to create
mysql-test/t/sp.test:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/t/view.test:
Enabled a test case that now works with prelocking-free SPs
sql/handler.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/item_func.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sp.cc:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp.h:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp_cache.h:
Added comments
sql/sp_head.cc:
Non-prelocked SP execution:
* Try to unlock tables after PROCEDURE arguments have been evaluated.
* Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
B) when its statement enters/leaves prelocked mode itself.
sql/sp_head.h:
Non-prelocked SP execution: Make sp_lex_keeper to additionally keep list of tables it
needs to prelock when its statement enters/leaves prelocked mode on its own.
sql/sql_base.cc:
Non-prelocked SP execution: Make open_tables() to
* detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
* Make lex->query_tables_last to point precisely to a boundary in lex->query_tables
list where 'own' tables and views' tables end and added-for-prelocking tables begin.
(it was not true before - view's tables could end up after query_tables_own_last)
sql/sql_class.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_class.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_lex.cc:
Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
sql/sql_parse.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
sql/sql_trigger.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
Phase 4 (final): Remove associated stored procedures when a database is dropped.
mysql-test/r/sp-security.result:
drop database now deletes associated SPs.
mysql-test/r/sp.result:
drop database now deletes associated SPs.
mysql-test/t/sp-security.test:
drop database now deletes associated SPs.
mysql-test/t/sp.test:
drop database now deletes associated SPs.
sql/sp.cc:
New function for deleting all SPs associated with a database.
sql/sp.h:
New function for deleting all SPs associated with a database.
sql/sp_cache.cc:
New function for just invalidating all SP caches (when dropping a database).
sql/sp_cache.h:
New function for just invalidating all SP caches (when dropping a database).
sql/sql_db.cc:
When dropping a database, also delete all associated SPs.
Phase 1: Introduced sp_name class, for qualified name support.
sql/item_func.cc:
Introduced sp_name class; moved some methods from item_func.h.
sql/item_func.h:
Introduced sp_name class; moved some methods to item_func.cc.
sql/sp.cc:
Introduced sp_name class, for qualified name support.
sql/sp.h:
Introduced sp_name class, for qualified name support.
sql/sp_cache.cc:
Introduced sp_name class, for qualified name support.
sql/sp_cache.h:
Introduced sp_name class, for qualified name support.
sql/sp_head.cc:
Introduced sp_name class, for qualified name support.
sql/sp_head.h:
Introduced sp_name class, for qualified name support.
sql/sql_lex.h:
Introduced sp_name class, for qualified name support.
sql/sql_parse.cc:
Introduced sp_name class, for qualified name support.
sql/sql_yacc.yy:
Introduced sp_name class, for qualified name support.
sql/sp.cc:
Fixed memory leaks. Deletion of sps now in sp_cache.
sql/sp_cache.cc:
Fixed memory leaks. Use implicit delete of objects to make sure
they're always freed.
sql/sp_cache.h:
Fixed memory leaks. Use implicit delete of objects to make sure
they're always freed.
sql/sp_head.cc:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
sql/sp_head.h:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
sql/sql_parse.cc:
Fixed memory leaks. Don't forget to free the temporary object created at definition.
sql/sql_yacc.yy:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
Need a sp_cache_remove() function with implicit name lookup to make the WL task
to work. It's a cleaner and more convenient interface anyway...
sql/sp.cc:
Modified sp_cache_remove() function calls; just remove by name.
sql/sp_cache.cc:
Modified sp_cache_remove() function. Get name and lookup/remove, return the
removed entry, if any.
sql/sp_cache.h:
Modified sp_cache_remove() function. Get name and lookup/remove, return the
removed entry, if any.
New sp_cache C API. When an SP is dropped, old caches (in other threads)
become invalid and are cleared.
Also, the caches in THD are only created on demand.
Docs/sp-imp-spec.txt:
Brough the SP cache docs up-to-date.
sql/mysqld.cc:
Initialize SP cache.
sql/sp.cc:
New C API for SP cache.
sql/sp_cache.cc:
New C API for sp_cache.
The class sp_cache is still used, but not directly. The C functions makes takes
care of updating caches when SPs are dropped. (This is done in the simplest
possible way, by simply detecting drops and then clear all old caches.)
The API is also designed so that the sp_cache is created on demand.
sql/sp_cache.h:
New C API for sp_cache.
The class sp_cache is still used, but not directly. The C functions makes takes
care of updating caches when SPs are dropped.
The API is also designed so that the sp_cache is created on demand.
sql/sql_class.cc:
The new sp_cache API creates the caches on demand, to avoid allocating it
when it's not needed.