diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-11-30 22:03:37 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-11-30 22:03:37 +0300 |
commit | aeebede1954d12b80f4c4aea016460501bfc2f5a (patch) | |
tree | 9ae4570228ac52e0055a55b7ebb3e020f24d0497 /sql/sql_update.cc | |
parent | de1979d3d69e55e40037b62d3ce502a4ddd05910 (diff) | |
download | mariadb-git-aeebede1954d12b80f4c4aea016460501bfc2f5a.tar.gz |
Backport of:
------------------------------------------------------------
revno: 2630.4.11
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-6.0-3726-w
timestamp: Tue 2008-05-27 21:31:53 +0400
message:
WL#3726 "DDL locking for all metadata objects".
After review fixes in progress.
Changed mysql_lock_tables() to be no longer responsible for
reopening table if waiting for the lock on it was aborted.
This allows to get rid of several annoying functions.
sql/ha_ndbcluster_binlog.cc:
lock_tables() now also accepts set of options to be passed to
mysql_lock_tables().
sql/lock.cc:
Changed mysql_lock_tables() always requests caller to reopen
table instead doing this on its own when waiting for lock was
aborted. This allows us to get rid of several functions which
were used in rare cases and significantly complicated our life.
sql/log_event_old.cc:
lock_tables() now also accepts set of options to be passed
to mysql_lock_tables().
sql/mysql_priv.h:
Now mysql_lock_tables() always requests caller to reopen
table instead doing this on its own when waiting for lock was
aborted. So we no longer need wait_for_tables() and
table_is_used() functions and MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN
flag.
open_and_lock_table_derived() and lock_tables() now accept
options to be passed to open_tables() and mysql_lock_tables()
calls.
sql/sql_base.cc:
Since now mysql_lock_tables() always requests caller to
reopen table instead doing this on its own when waiting for
lock was aborted we no longer need wait_for_tables(),
table_is_used() and close_old_data_files() functions.
open_and_lock_table_derived() and lock_tables() now accept
options to be passed to open_tables() and mysql_lock_tables()
calls. This was needed in order to get rid of redundant code
in open_system_tables_for_read() function.
sql/sql_handler.cc:
mysql_lock_tables() is now always requests reopen if waiting
for lock is aborted. MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN flag
was removed.
sql/sql_insert.cc:
handle_delayed_insert():
Since mysql_lock_tables() is no longer responsible for
reopening tables when waiting for lock was aborted we have
to handle such situation outside of this function. To simplify
this extracted code opening table for delayed insert thread to
separate method of Delayed_insert class.
sql/sql_update.cc:
lock_tables() now also accepts set of options to be passed
to mysql_lock_tables().
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1ad39a2f838..5cf6ceaa394 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -222,7 +222,7 @@ int mysql_update(THD *thd, /* convert to multiupdate */ DBUG_RETURN(2); } - if (!lock_tables(thd, table_list, table_count, &need_reopen)) + if (!lock_tables(thd, table_list, table_count, 0, &need_reopen)) break; if (!need_reopen) DBUG_RETURN(1); @@ -1099,7 +1099,7 @@ reopen_tables: /* now lock and fill tables */ if (!thd->stmt_arena->is_stmt_prepare() && - lock_tables(thd, table_list, table_count, &need_reopen)) + lock_tables(thd, table_list, table_count, 0, &need_reopen)) { if (!need_reopen) DBUG_RETURN(TRUE); |