From: Date: March 5 2007 11:52am Subject: bk commit into 4.1 tree (istruewing:1.2607) BUG#26464 List-Archive: http://lists.mysql.com/commits/21139 X-Bug: 26464 Message-Id: Below is the list of changes that have just been committed into a local 4.1 repository of istruewing. When istruewing does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-03-05 11:52:28+01:00, istruewing@stripped +3 -0 Bug#26464 - insert delayed + update + merge = corruption Using INSERT DELAYED on MERGE tables could lead to table corruptions. The manual lists a couple of storage engines, which can be used with INSERT DELAYED. MERGE is not in this list. The attempt to try it anyway has not been rejected yet. This bug was not detected earlier as it can work under special circumstances. Most notable is low concurrency. To be safe, this patch rejects any attempt to use INSERT DELAYED on MERGE tables. mysql-test/r/merge.result@stripped, 2007-03-05 11:52:25+01:00, istruewing@stripped +5 -0 Bug#26464 - insert delayed + update + merge = corruption Added test result. mysql-test/t/merge.test@stripped, 2007-03-05 11:52:26+01:00, istruewing@stripped +9 -0 Bug#26464 - insert delayed + update + merge = corruption Added test. sql/ha_myisammrg.h@stripped, 2007-03-05 11:52:26+01:00, istruewing@stripped +1 -1 Bug#26464 - insert delayed + update + merge = corruption Removed HA_CAN_INSERT_DELAYED flag from table_flags(). The insert delayed thread upgrades the lock from the first entry in MYSQL_LOCK::locks only. Hence it is incapable to handle MERGE tables, which have as many entries in this array as they have MyISAM sub-tables. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: istruewing # Host: chilla.local # Root: /home/mydev/mysql-4.1-bug26464 --- 1.39/sql/ha_myisammrg.h 2007-03-05 11:52:32 +01:00 +++ 1.40/sql/ha_myisammrg.h 2007-03-05 11:52:32 +01:00 @@ -37,7 +37,7 @@ class ha_myisammrg: public handler { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | - HA_CAN_INSERT_DELAYED | HA_ANY_INDEX_MAY_BE_UNIQUE); + HA_ANY_INDEX_MAY_BE_UNIQUE); } ulong index_flags(uint inx, uint part, bool all_parts) const { --- 1.44/mysql-test/r/merge.result 2007-03-05 11:52:32 +01:00 +++ 1.45/mysql-test/r/merge.result 2007-03-05 11:52:32 +01:00 @@ -801,3 +801,8 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, SELECT * FROM tm1; ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +INSERT DELAYED INTO t2 VALUES(1); +ERROR HY000: Table storage engine for 't2' doesn't have this option +DROP TABLE t1, t2; --- 1.41/mysql-test/t/merge.test 2007-03-05 11:52:32 +01:00 +++ 1.42/mysql-test/t/merge.test 2007-03-05 11:52:32 +01:00 @@ -428,4 +428,13 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, SELECT * FROM tm1; DROP TABLE t1, tm1; +# +# Bug#26464 - insert delayed + update + merge = corruption +# +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +--error 1031 +INSERT DELAYED INTO t2 VALUES(1); +DROP TABLE t1, t2; + # End of 4.1 tests