summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-08-31 15:24:06 -0700
committerjimw@mysql.com <>2005-08-31 15:24:06 -0700
commit1d997477aa848779ea38526e18aaf824fd0ac3de (patch)
tree63161ccb51465f90409872099f902b79a9d23837 /sql/ha_innodb.cc
parent41fc00641cf0bcab8bf52059c4e482c964f261fc (diff)
parente0f3c5c0fb936fd0ebeee54c07ae16265e9537b9 (diff)
downloadmariadb-git-1d997477aa848779ea38526e18aaf824fd0ac3de.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 9ba75acb444..404ac95b81a 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2407,6 +2407,7 @@ ha_innobase::open(
my_free((char*) upd_buff, MYF(0));
my_errno = ENOENT;
+ dict_table_decrement_handle_count(ib_table);
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
@@ -6682,7 +6683,7 @@ ha_innobase::store_lock(
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
- /* Starting from 5.0.7, we weaken also the table locks
+ /* Starting from 5.0.7, we weaken also the table locks
set at the start of a MySQL stored procedure call, just like
we weaken the locks set at the start of an SQL statement.
MySQL does set thd->in_lock_tables TRUE there, but in reality
@@ -6690,6 +6691,21 @@ ha_innobase::store_lock(
single transaction stored procedure call deterministic
(if it does not use a consistent read). */
+ if (lock_type == TL_READ && thd->in_lock_tables) {
+ /* We come here if MySQL is processing LOCK TABLES
+ ... READ LOCAL. MyISAM under that table lock type
+ reads the table as it was at the time the lock was
+ granted (new inserts are allowed, but not seen by the
+ reader). To get a similar effect on an InnoDB table,
+ we must use LOCK TABLES ... READ. We convert the lock
+ type here, so that for InnoDB, READ LOCAL is
+ equivalent to READ. This will change the InnoDB
+ behavior in mysqldump, so that dumps of InnoDB tables
+ are consistent with dumps of MyISAM tables. */
+
+ lock_type = TL_READ_NO_INSERT;
+ }
+
/* If we are not doing a LOCK TABLE or DISCARD/IMPORT
TABLESPACE or TRUNCATE TABLE, then allow multiple writers */