summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-01-14 15:23:34 +0200
committerunknown <marko@hundin.mysql.fi>2005-01-14 15:23:34 +0200
commit6d9f637870208e1657bf88a80a49b7d0a9126187 (patch)
tree11bb53344d5f984bf93f67720b2e31be7731a581 /sql/ha_innodb.cc
parent8dc27f1ef94d909f063dd2fa3cea2619eae74518 (diff)
parent8870b671b02bcdd87a2ac64fb3b19fb2da3686ee (diff)
downloadmariadb-git-6d9f637870208e1657bf88a80a49b7d0a9126187.tar.gz
Merge marko@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/marko/k/mysql-4.1 innobase/os/os0file.c: Auto merged sql/ha_innodb.cc: Auto merged
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index f82b9c03505..502f8eb92f3 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -5267,7 +5267,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
@@ -5275,7 +5277,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;