1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
Files
mariadb/sql
Dmitry Lenev fecca34356 Fix for bug #11762012 - "54553: INNODB ASSERTS IN
HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".

Attempt to update an InnoDB temporary table under LOCK TABLES
led to assertion failure in both debug and production builds
if this temporary table was explicitly locked for READ. The
same scenario works fine for MyISAM temporary tables.

The assertion failure was caused by discrepancy between lock
that was requested on the rows of temporary table at LOCK TABLES
time and by update operation. Since SQL-layer requested a
read-lock at LOCK TABLES time InnoDB engine assumed that upcoming
statements which are going to be executed under LOCK TABLES will
only read table and therefore should acquire only S-lock.
An update operation broken this assumption by requesting X-lock.

Possible approaches to fixing this problem are:

1) Skip locking of temporary tables as locking doesn't make any
   sense for connection-local objects.
2) Prohibit changing of temporary table locked by LOCK TABLES ...
   READ.

Unfortunately both of these approaches have drawbacks which make
them unviable for stable versions of server.

So this patch takes another approach and changes code in such way
that LOCK TABLES for a temporary table will always request write
lock. In 5.5 version of this patch switch from read lock to write
lock is done on SQL-layer.

mysql-test/suite/innodb/r/innodb_mysql.result:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
mysql-test/suite/innodb/t/innodb_mysql.test:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
sql/sql_parse.cc:
  Since a temporary table locked by LOCK TABLES can be updated even
  if it was only locked for read we always request TL_WRITE locks
  for such tables at LOCK TABLES time. This allows to avoid 
  discrepancy between locks acquired at LOCK TABLES time and by
  a statement executed under LOCK TABLES. Such a discrepancy has
  caused problems for InnoDB storage engine.
  
  To support this change a part of code implementing LOCK TABLES 
  has been moved to a helper function.
2011-05-26 19:50:06 +04:00
..
2011-03-25 14:55:22 +02:00
2010-08-16 14:50:27 +02:00
2011-05-21 10:21:08 +02:00
2011-05-21 10:21:08 +02:00
2010-11-22 10:13:46 +01:00
2011-05-21 10:21:08 +02:00
2010-12-29 01:26:31 +01:00
2011-05-21 10:21:08 +02:00
2011-05-21 10:21:08 +02:00
2010-05-24 14:51:59 +02:00
2011-05-21 10:21:08 +02:00
2011-04-20 19:53:08 +02:00
2011-05-21 10:21:08 +02:00
2011-05-06 00:50:31 +01:00
2010-05-28 19:53:26 -03:00
2010-03-31 16:05:33 +02:00
2010-07-30 16:56:57 +03:00
2010-12-29 01:26:31 +01:00
2011-05-21 10:21:08 +02:00
2011-05-26 14:09:25 +04:00
2011-05-21 10:21:08 +02:00
2011-03-03 18:46:30 +03:00
2011-04-12 14:13:15 +04:00
2011-02-02 10:18:44 +01:00
2011-05-18 10:59:04 +04:00
2011-03-30 11:25:49 +04:00
2010-03-31 16:05:33 +02:00
2011-03-04 12:46:48 +01:00
2011-05-26 12:56:17 +02:00
2011-05-21 10:59:32 +02:00
2011-03-04 13:12:31 +01:00
2010-12-29 01:26:31 +01:00
2011-05-12 05:32:06 +01:00
2011-05-26 12:56:17 +02:00
2011-05-18 19:47:29 +05:30
2011-04-20 19:53:08 +02:00
2011-04-15 08:54:05 +02:00
2010-11-23 13:47:35 +03:00
2010-12-07 16:11:13 +00:00
2011-05-24 00:33:55 +01:00
2011-03-04 13:12:31 +01:00
2011-05-21 10:21:08 +02:00
2010-12-29 01:26:31 +01:00
2010-04-13 19:04:45 +04:00
2011-05-06 00:50:31 +01:00
2010-12-07 16:11:13 +00:00
2011-05-21 10:59:32 +02:00
2010-09-06 17:04:32 +02:00
2011-05-26 13:33:21 +01:00
2011-05-21 10:21:08 +02:00
2011-03-07 10:08:10 +01:00
2011-05-21 10:21:08 +02:00
2010-10-12 14:07:13 +04:00
2011-05-21 10:59:32 +02:00
2011-05-19 10:49:43 +02:00
2011-05-21 10:59:32 +02:00
2011-03-04 12:35:24 +01:00
2011-03-16 15:11:20 +01:00
2011-02-11 15:00:09 +01:00
2011-02-11 15:00:09 +01:00
2011-05-21 10:21:08 +02:00
2011-01-26 15:30:06 +08:00
2011-03-08 09:41:57 +01:00
2011-05-12 10:41:17 +01:00
2011-05-21 10:21:08 +02:00
2011-05-21 10:21:08 +02:00
2011-05-21 10:59:32 +02:00
2010-12-14 13:46:00 +03:00
2011-05-21 10:21:08 +02:00
2010-12-07 16:11:13 +00:00
2011-05-21 10:21:08 +02:00
2011-04-22 11:39:42 +04:00
2010-08-12 20:44:41 +04:00
2011-02-17 12:53:09 +01:00
2011-05-21 10:21:08 +02:00
2011-03-07 10:08:10 +01:00
2011-05-12 06:23:16 +01:00
2011-02-11 15:00:09 +01:00
2011-05-21 10:21:08 +02:00
2011-05-24 00:33:55 +01:00
2009-12-03 21:37:38 +03:00
2011-05-21 10:21:08 +02:00