diff options
author | unknown <heikki@hundin.mysql.fi> | 2005-01-13 20:08:28 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2005-01-13 20:08:28 +0200 |
commit | 97f5b3260037f013918e71ab0c8f01494ae707e5 (patch) | |
tree | d4396486d133efac631e7ab1f8c61fde0d18b4de /sql/ha_innodb.cc | |
parent | c9882adf81ca011d71e60095f48e445426134f57 (diff) | |
download | mariadb-git-97f5b3260037f013918e71ab0c8f01494ae707e5.tar.gz |
ha_innodb.cc:
Merge from 4.0: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables
sql/ha_innodb.cc:
Merge from 4.0: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 14b143ca04b..4c13902c31e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5265,7 +5265,9 @@ ha_innobase::store_lock( if ((lock_type == TL_READ && thd->in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || - lock_type == TL_READ_NO_INSERT) { + lock_type == TL_READ_NO_INSERT || + thd->lex->sql_command != SQLCOM_SELECT) { + /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or 2) (we do not know when TL_READ_HIGH_PRIORITY is used), or @@ -5273,7 +5275,10 @@ ha_innobase::store_lock( 4) we are doing a complex SQL statement like INSERT INTO ... SELECT ... and the logical logging (MySQL binlog) requires the use of a locking read, or - MySQL is doing LOCK TABLES ... READ. */ + MySQL is doing LOCK TABLES ... READ. + 5) we let InnoDB do locking reads for all SQL statements that + are not simple SELECTs; note that select_lock_type in this + case may get strengthened in ::external_lock() to LOCK_X. */ prebuilt->select_lock_type = LOCK_S; prebuilt->stored_select_lock_type = LOCK_S; |