From b0bf32fd57def0a364cd2803d48caf8c0975dd05 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Sep 2002 14:50:25 +0300 Subject: [PATCH] ha_innodb.cc: Fix an assertion in btr0pcur.c line 203 when an UPDATE is done inside LOCK TABLES sql/ha_innodb.cc: Fix an assertion in btr0pcur.c line 203 when an UPDATE is done inside LOCK TABLES --- sql/ha_innodb.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 670ea914b21..2c27f565895 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -3672,7 +3672,15 @@ ha_innobase::start_stmt( prebuilt->sql_stat_start = TRUE; prebuilt->hint_no_need_to_fetch_extra_cols = TRUE; prebuilt->read_just_key = 0; - prebuilt->select_lock_type = LOCK_NONE; + + if (prebuilt->select_lock_type == LOCK_NONE) { + /* 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 + prepared for an update of a row */ + + prebuilt->select_lock_type = LOCK_X; + } thd->transaction.all.innodb_active_trans = 1;