diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-11-19 17:08:07 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-11-19 17:08:07 +0200 |
commit | 9b891cee5576e2d1b2aa6bf36ad1416d0eec3f9f (patch) | |
tree | 53b07f113d86d9e302a7220eca6d90cf09b9a40c /sql | |
parent | 0fb06a68cedeefd92ac49907e52fb47047ccc9c0 (diff) | |
download | mariadb-git-9b891cee5576e2d1b2aa6bf36ad1416d0eec3f9f.tar.gz |
ha_innobase.cc:
Backport of bug fix in 4.0: do not x-lock rows under LOCK TABLES READ unless the table is a temp table
sql/ha_innobase.cc:
Backport of bug fix in 4.0: do not x-lock rows under LOCK TABLES READ unless the table is a temp table
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innobase.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 6b5ba7d841e..2f79f8d6ba9 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -3453,7 +3453,7 @@ ha_innobase::start_stmt( prebuilt->hint_no_need_to_fetch_extra_cols = TRUE; prebuilt->read_just_key = 0; - if (prebuilt->select_lock_type == LOCK_NONE) { + if (!prebuilt->mysql_has_locked) { /* This handle is for a temporary table created inside this same LOCK TABLES; since MySQL does NOT call external_lock in this case, we must use x-row locks inside InnoDB to be @@ -3510,6 +3510,7 @@ ha_innobase::external_lock( thd->transaction.all.innodb_active_trans = 1; trx->n_mysql_tables_in_use++; + prebuilt->mysql_has_locked = TRUE; if (thd->tx_isolation == ISO_SERIALIZABLE && prebuilt->select_lock_type == LOCK_NONE) { @@ -3527,6 +3528,7 @@ ha_innobase::external_lock( } } else { trx->n_mysql_tables_in_use--; + prebuilt->mysql_has_locked = FALSE; auto_inc_counter_for_this_stat = 0; if (trx->n_mysql_tables_in_use == 0) { |