diff options
author | unknown <sergefp@mysql.com> | 2005-07-30 08:19:57 +0000 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-07-30 08:19:57 +0000 |
commit | 11abe15eab3f444b600200e965cf18539af55392 (patch) | |
tree | c86ed0f51c03242ad2f553a26b62cff6613ac535 /sql/sp_head.h | |
parent | 482cf550f9cb1bf060aba73ef64d85edee791118 (diff) | |
download | mariadb-git-11abe15eab3f444b600200e965cf18539af55392.tar.gz |
Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for
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
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index 32dc4449174..724cbcc7fc5 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -282,6 +282,10 @@ private: /* Multi-set representing optimized list of tables to be locked by this routine. Does not include tables which are used by invoked routines. + + Note: for prelocking-free SPs this multiset is constructed too. + We do so because the same instance of sp_head may be called both + in prelocked mode and in non-prelocked mode. */ HASH m_sptabs; @@ -383,7 +387,8 @@ class sp_lex_keeper public: sp_lex_keeper(LEX *lex, bool lex_resp) - : m_lex(lex), m_lex_resp(lex_resp) + : m_lex(lex), m_lex_resp(lex_resp), + lex_query_tables_own_last(NULL) { lex->sp_lex_in_use= TRUE; } @@ -418,6 +423,25 @@ private: for LEX deletion. */ bool m_lex_resp; + + /* + Support for being able to execute this statement in two modes: + a) inside prelocked mode set by the calling procedure or its ancestor. + b) outside of prelocked mode, when this statement enters/leaves + prelocked mode itself. + */ + + /* + List of additional tables this statement needs to lock when it + enters/leaves prelocked mode on its own. + */ + TABLE_LIST *prelocking_tables; + + /* + The value m_lex->query_tables_own_last should be set to this when the + statement enters/leaves prelocked mode on its own. + */ + TABLE_LIST **lex_query_tables_own_last; }; |