summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-01 17:39:03 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-01 17:39:03 +0300
commit5969dcda21f67b18d2cb443db555d2b1c087bb62 (patch)
tree289ce39f293fe8250f3dac5ac3d34c4e90909125 /sql/sp_head.cc
parent1b078b3f2df729859807d3905cf3e0b9f1b8d29c (diff)
downloadmariadb-git-5969dcda21f67b18d2cb443db555d2b1c087bb62.tar.gz
Backport of:
---------------------------------------------------------- revno: 2630.4.26 committer: Konstantin Osipov <konstantin@mysql.com> branch nick: mysql-6.0-prelocked_mode-to-push timestamp: Fri 2008-06-06 23:19:04 +0400 message: WL#3726: work on review comments. Remove thd->locked_tables. Always store MYSQL_LOCK instances in thd->lock. Rename thd->prelocked_mode to thd->locked_tables_mode. Use thd->locked_tables_mode to determine if we are under LOCK TABLES. Update the code to not assume that if thd->lock is set, LOCK TABLES mode is off. Review comments. sql/ha_ndbcluster_binlog.cc: Don't unlock the lock under LOCK TABLES (safety). sql/handler.cc: There is no thd->locked_tables any more. Update comments. sql/lock.cc: There is no thd->locked_tables any more. sql/log.cc: Rename thd->prelocked_mode to thd->locked_tables_mode. sql/set_var.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sp_head.cc: Rename thd->prelocked_mode to thd->locked_tables_mode. sql/sql_base.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. Remove thd->locked_tables. sql/sql_cache.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_class.cc: Avoid code duplication. Do not release the table locks prematurely if we're under LOCK TABLES. Use thd->locked_tables_mode instead of thd->locked_tables. sql/sql_class.h: Remove thd->locked_tables. Make prelocked mode a kind of LOCK TABLES mode. Update comments. sql/sql_cursor.cc: Update comments. sql/sql_insert.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. Rename thd->prelocked_mode to thd->locked_tables_mode. sql/sql_load.cc: Rename thd->prelocked_mode to thd->locked_tables_mode. sql/sql_parse.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. Remove thd->locked_tables. sql/sql_partition.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_rename.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_select.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_table.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_trigger.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_update.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. sql/sql_view.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES. storage/myisam/ha_myisam.cc: Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index fdf9909f85e..a0832285742 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1257,7 +1257,7 @@ sp_head::execute(THD *thd)
Will write this SP statement into binlog separately
(TODO: consider changing the condition to "not inside event union")
*/
- if (thd->prelocked_mode == NON_PRELOCKED)
+ if (thd->locked_tables_mode == LTM_NONE)
thd->user_var_events_alloc= thd->mem_root;
err_status= i->execute(thd, &ip);
@@ -1269,7 +1269,7 @@ sp_head::execute(THD *thd)
If we've set thd->user_var_events_alloc to mem_root of this SP
statement, clean all the events allocated in it.
*/
- if (thd->prelocked_mode == NON_PRELOCKED)
+ if (thd->locked_tables_mode == LTM_NONE)
{
reset_dynamic(&thd->user_var_events);
thd->user_var_events_alloc= NULL;//DEBUG
@@ -2740,7 +2740,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
thd->query_id= next_query_id();
pthread_mutex_unlock(&LOCK_thread_count);
- if (thd->prelocked_mode == NON_PRELOCKED)
+ if (thd->locked_tables_mode == LTM_NONE)
{
/*
This statement will enter/leave prelocked mode on its own.