summaryrefslogtreecommitdiff
path: root/sql/sp_cache.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-08-111-27/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/my/mysql-5.0 mysql-test/t/sp.test: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sp_cache.cc: manual merge
| * Cleanups during review of new codeunknown2005-08-111-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/t/sp.test: Use --disable_parsing instead of comments sql/lock.cc: Remove compiler warning sql/mysqld.cc: Always send valid flag argument to reload_acl_and_cache() sql/sp_cache.cc: Simple optimization Don't use mutex to read 'long' variable Indentation fixes sql/sp_head.cc: Fix comments to use /* */ Set proc_info to 0 after close_thread_tables() sql/sql_base.cc: remove not needed test sql/sql_parse.cc: Always send valid flag argument to reload_acl_and_cache() Fixed indentation Ensure we get an error if reset_master() fails.
* | BUG#12228: Post review fixes: Added test case, code cleanup.unknown2005-08-101-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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"
* | BUG#12228: Pre-review fixes: Fix coding style, handle the case when we're ↵unknown2005-08-091-2/+9
| | | | | | | | out of memory.
* | Fix for BUG#12228: SP cache code:unknown2005-08-081-50/+143
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* sp_rcontext.cc, sp_pcontext.cc, sp_head.cc, sp_cache.cc, ha_federated.cc:unknown2005-06-051-2/+1
| | | | | | | | | | | | | | | | Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/ha_federated.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_cache.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_head.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_pcontext.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_rcontext.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION
* Add USE_PRAGMA_INTERFACE and USE_PRAGMA_IMPLEMENTATION to files not ↵unknown2005-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | existsing in 4.1 sql/hash_filo.h: USE_PRAGMA_INTERFACE sql/sp_cache.cc: USE_PRAGMA_IMPLEMENTATION sql/sp_cache.h: USE_PRAGMA_INTERFACE sql/sp_head.cc: USE_PRAGMA_IMPLEMENTATION sql/sp_head.h: USE_PRAGMA_INTERFACE sql/sp_pcontext.cc: USE_PRAGMA_IMPLEMENTATION sql/sp_pcontext.h: USE_PRAGMA_INTERFACE sql/sp_rcontext.cc: USE_PRAGMA_IMPLEMENTATION sql/sp_rcontext.h: USE_PRAGMA_INTERFACE
* WL#1366: Use the schema (db) associated with an SP.unknown2004-03-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* WL#1366: Use the schema (db) associated with an SP.unknown2004-03-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Phase 2: Make SPs belong to a DB, and use qualified names. As a side effect, using USE in an SP is no longer allowed. (It just doesn't work otherwise.) include/mysqld_error.h: New error code (USE is no longer allowed in a stored procedure). include/sql_state.h: New error state (USE is no longer allowed in a stored procedure). mysql-test/r/sp-error.result: Updated result for test of USE in SP (not allowed now). mysql-test/r/sp-security.result: Updated test results for new db column and qualified procedured names. mysql-test/r/sp.result: Updated results for USE in SP (as it's no longer allowed), and for new db column in status result. mysql-test/t/sp-error.test: Moved test of USE in SP from sp.test (as it's no longer allowed). mysql-test/t/sp-security.test: Ajusted tests for new db column and qualified procedured names. mysql-test/t/sp.test: Moved test of USE in SP to sp-error.test (as it's no longer allowed). Adjusted tests for new db column in status result. sql/mysql_priv.h: mysql_change_db() now has optional arguments for use by SP with qualified names. sql/share/czech/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/danish/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/dutch/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/english/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/estonian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/french/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/german/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/greek/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/hungarian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/italian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/japanese/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/korean/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/norwegian-ny/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/norwegian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/polish/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/portuguese/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/romanian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/russian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/serbian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/slovak/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/spanish/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/swedish/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/share/ukrainian/errmsg.txt: New error message: USE is not allowed in a stored procedure. sql/sp.cc: SPs are now "belong" to a DB and may have qualified names. New functions for changing DB ("use") when parsing and invoking SPs. sql/sp.h: New functions for changing DB ("use") when parsing and invoking SPs. sql/sp_cache.cc: Use the qualified name in the SP cache. sql/sp_head.cc: New function for allocating a qualified SP name (used in sql_yacc.yy). Change DB when executing an SP (if needed). Moved thd_mem_root swap functions from sp_head.h. sql/sp_head.h: New function for allocating a qualified SP name (used in sql_yacc.yy). Moved thd_mem_root swap functions to sp_head.cc. sql/sql_db.cc: mysql_change_db() now has optional arguments for use by SP with qualified names (for use when reading an SP from database and executing it); also allow "unusing" a database, i.e. setting thd->thd to "". sql/sql_yacc.yy: Initialize qualfied SP names correctly. USE is no longer allowed in an SP.
* WL#1366: Use the schema (db) associated with an SP.unknown2004-02-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update for VC++unknown2003-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Fixed project files, compiler warnings etc..) BitKeeper/etc/ignore: added mysql_priv.h VC++Files/libmysqld/libmysqld.dsp: Update for VC++to VC++Files/sql/mysqld.dsp: Update for VC++ client/mysqlbinlog.cc: Remove not used variable sql-common/client.c: Fix for compilation with VC++ sql/filesort.cc: Remove not used variable sql/item_timefunc.cc: Fixed compiler warnings sql/log_event.cc: Fixed compiler warnings - One can't portable allocate an stack-array dynamicly - Changed sql_mode to ulong to match THD.variables.sql_mode (If they are not the same we get a lot of compiler warnings) sql/log_event.h: Changed sql_mode to ulong to match THD.variables.sql_mode (If they are not the same we get a lot of compiler warnings) sql/sp.cc: sql_mode to ulong Don't use strcpy Replaced sprintf() with strmov sql/sp_cache.cc: Fixed compiler warning sql/sp_head.cc: Removed not used variable sql/sp_rcontext.cc: Removed not used variable sql/sp_rcontext.h: Fixed compiler warning sql/sql_class.cc: Portability fix sql/sql_delete.cc: Fixed compiler warning sql/sql_insert.cc: Fixed compiler warning sql/sql_update.cc: Fixed compiler warning
* Fixed various memory leaks.unknown2003-12-151-5/+13
| | | | | | | | | | | | | | | | | | | 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.
* Bugfix of previous WL#1265 commit.unknown2003-10-211-3/+5
| | | | | | | | | | | | | | | 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.
* WL#1265: Fix proper ALTER/DROP support in the SP cache.unknown2003-10-211-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add the new sp cache files too (should have been in previous changeset).unknown2003-07-031-0/+53