diff options
author | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-05-29 17:13:17 +0200 |
---|---|---|
committer | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-05-29 17:13:17 +0200 |
commit | 48a31944208ed4aa035e0a4cce3cd3eb2a27ea80 (patch) | |
tree | 0058d5e80cc240c37a2d7038af1a983283d0e998 /sql/handler.cc | |
parent | ff3a6b5587574af3abd5fd2da8740eb07c87d9b9 (diff) | |
download | mariadb-git-48a31944208ed4aa035e0a4cce3cd3eb2a27ea80.tar.gz |
WL#3303 (RBR: Engine-controlled logging format):
Moving code to check storage engine capabilities to after tables
are locked. Moving code to cache table flags so that table flags
are read from the storage engine at the beginning of the statement
in addition to when the storage engine is opened.
To handle CREATE-SELECT, the decision function is called after the
table is created and it is called with all tables that are in the select
part of the statement as well as the newly created table.
sql/handler.cc:
Changing code to cache table flags on a per-statement basis. The table
flags are now retrieved inside ha_external_lock().
sql/handler.h:
Extending TABLEOP_HOOKS with postlock() member.
sql/mysql_priv.h:
Adding prototype declaration of decide_logging_format() function.
sql/sql_base.cc:
Factoring out code to check capabilities into decide_logging_format().
Moving code to check engine capabilities to after the tables are locked.
Correcting a bug causing row-based to not be set when the engines
were not statement-logging capable.
sql/sql_class.h:
Adding selected tables as select_create::select_tables member variable.
sql/sql_insert.cc:
Introducing logic to handle post-locking hook.
select_create::prepare now uses post-lock hook instead of pre-lock hook.
Deciding on logging format especially for CREATE-SELECT by calling
decide_logging_format() in the post-lock hook.
sql/sql_parse.cc:
Adding selected tables as argument to select_create constructor.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index e0018a66400..95b30953039 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3607,7 +3607,15 @@ int handler::ha_external_lock(THD *thd, int lock_type) taken a table lock), ha_release_auto_increment() was too. */ DBUG_ASSERT(next_insert_id == 0); - DBUG_RETURN(external_lock(thd, lock_type)); + + /* + We cache the table flags if the locking succeeded. Otherwise, we + keep them as they were when they were fetched in ha_open(). + */ + int error= external_lock(thd, lock_type); + if (error == 0) + cached_table_flags= table_flags(); + DBUG_RETURN(error); } |