[Pkg-mysql-commits] r1393 - in trunk/debian: . patches
Norbert Tretkowski
nobse at alioth.debian.org
Sun Jan 25 08:17:12 UTC 2009
tags 512651 pending
thanks
Author: nobse
Date: 2009-01-25 08:17:12 +0000 (Sun, 25 Jan 2009)
New Revision: 1393
Added:
trunk/debian/patches/62_delete_with_self-join.dpatch
Modified:
trunk/debian/changelog
trunk/debian/patches/00list
Log:
Fix MyISAM storage engine error (134) doing delete with self-join.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2009-01-24 22:03:06 UTC (rev 1392)
+++ trunk/debian/changelog 2009-01-25 08:17:12 UTC (rev 1393)
@@ -2,8 +2,10 @@
* Fix mysql_secure_installation so it does not fail on passwords which need
quoting. (closes: #511929)
+ * Fix MyISAM storage engine error (134) doing delete with self-join.
+ (closes: #512651)
- -- Norbert Tretkowski <nobse at debian.org> Sat, 24 Jan 2009 23:01:04 +0100
+ -- Norbert Tretkowski <nobse at debian.org> Sun, 25 Jan 2009 09:16:14 +0100
mysql-dfsg-5.0 (5.0.51a-21) testing-proposed-updates; urgency=low
Modified: trunk/debian/patches/00list
===================================================================
--- trunk/debian/patches/00list 2009-01-24 22:03:06 UTC (rev 1392)
+++ trunk/debian/patches/00list 2009-01-25 08:17:12 UTC (rev 1393)
@@ -21,6 +21,7 @@
59_fix_relay_logs_corruption.dpatch
60_fix_rpl_path_test.dpatch
61_fix_leap_seconds.dpatch
+62_delete_with_self-join.dpatch
86_PATH_MAX.dpatch
89_ndb__staticlib.dpatch
90_upstreamdebiandir.dpatch
Added: trunk/debian/patches/62_delete_with_self-join.dpatch
===================================================================
--- trunk/debian/patches/62_delete_with_self-join.dpatch (rev 0)
+++ trunk/debian/patches/62_delete_with_self-join.dpatch 2009-01-25 08:17:12 UTC (rev 1393)
@@ -0,0 +1,176 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 62_delete_with_self-join.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=28837
+
+ at DPATCH@
+diff -Nrup a/mysql-test/r/merge.result b/mysql-test/r/merge.result
+--- a/mysql-test/r/merge.result 2007-06-14 15:18:00 +04:00
++++ b/mysql-test/r/merge.result 2007-11-26 18:58:50 +03:00
+@@ -876,4 +876,41 @@ CHECK TABLE tm1;
+ Table Op Msg_type Msg_text
+ test.tm1 check status OK
+ DROP TABLE tm1, t1, t2;
++CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MyISAM;
++CREATE TABLE t2 LIKE t1;
++INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
++INSERT INTO t1 SELECT * FROM t2;
++INSERT INTO t1 SELECT * FROM t2;
++CREATE TABLE t3 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MERGE
++UNION(t1);
++SELECT * FROM t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
++id ref ref
++4 4 5
++4 4 5
++4 4 5
++4 4 5
++SELECT * FROM t3;
++id ref
++1 3
++2 1
++3 2
++4 5
++4 4
++1 3
++2 1
++3 2
++4 5
++4 4
++DELETE FROM a USING t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t3;
++id ref
++1 3
++2 1
++3 2
++4 5
++1 3
++2 1
++3 2
++4 5
++DROP TABLE t1, t2, t3;
+ End of 5.0 tests
+diff -Nrup a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
+--- a/mysql-test/r/myisam.result 2007-05-22 16:58:29 +04:00
++++ b/mysql-test/r/myisam.result 2007-11-26 18:58:50 +03:00
+@@ -1806,4 +1806,26 @@ SELECT a FROM t1 FORCE INDEX (inx) WHERE
+ a
+ 1
+ DROP TABLE t1;
++CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
++CREATE TABLE t2 LIKE t1;
++INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
++INSERT INTO t1 SELECT * FROM t2;
++SELECT * FROM t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
++id ref ref
++4 4 5
++SELECT * FROM t1;
++id ref
++1 3
++2 1
++3 2
++4 5
++4 4
++DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t1;
++id ref
++1 3
++2 1
++3 2
++4 5
++DROP TABLE t1, t2;
+ End of 5.0 tests
+diff -Nrup a/mysql-test/t/merge.test b/mysql-test/t/merge.test
+--- a/mysql-test/t/merge.test 2007-06-06 03:42:39 +04:00
++++ b/mysql-test/t/merge.test 2007-11-26 18:58:50 +03:00
+@@ -507,4 +507,26 @@ SELECT * FROM tm1;
+ CHECK TABLE tm1;
+ DROP TABLE tm1, t1, t2;
+
++#
++# Bug #28837: MyISAM storage engine error (134) doing delete with self-join
++#
++
++CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MyISAM;
++CREATE TABLE t2 LIKE t1;
++
++INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
++INSERT INTO t1 SELECT * FROM t2;
++INSERT INTO t1 SELECT * FROM t2;
++
++CREATE TABLE t3 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MERGE
++ UNION(t1);
++
++SELECT * FROM t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t3;
++DELETE FROM a USING t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t3;
++
++DROP TABLE t1, t2, t3;
++
++
+ --echo End of 5.0 tests
+diff -Nrup a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
+--- a/mysql-test/t/myisam.test 2007-08-29 16:44:21 +04:00
++++ b/mysql-test/t/myisam.test 2007-11-26 18:58:50 +03:00
+@@ -1161,4 +1161,21 @@ ALTER TABLE t1 ENABLE KEYS;
+ SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+ DROP TABLE t1;
+
++#
++# Bug#28837: MyISAM storage engine error (134) doing delete with self-join
++#
++
++CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
++CREATE TABLE t2 LIKE t1;
++
++INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
++INSERT INTO t1 SELECT * FROM t2;
++
++SELECT * FROM t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t1;
++DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
++SELECT * FROM t1;
++
++DROP TABLE t1, t2;
++
+ --echo End of 5.0 tests
+diff -Nrup a/sql/ha_myisam.cc b/sql/ha_myisam.cc
+--- a/sql/ha_myisam.cc 2007-07-19 18:57:48 +04:00
++++ b/sql/ha_myisam.cc 2007-11-26 18:58:51 +03:00
+@@ -1602,10 +1602,14 @@ int ha_myisam::index_next_same(byte * bu
+ const byte *key __attribute__((unused)),
+ uint length __attribute__((unused)))
+ {
++ int error;
+ DBUG_ASSERT(inited==INDEX);
+ statistic_increment(table->in_use->status_var.ha_read_next_count,
+- &LOCK_status);
+- int error=mi_rnext_same(file,buf);
++ &LOCK_status);
++ do
++ {
++ error= mi_rnext_same(file,buf);
++ } while (error == HA_ERR_RECORD_DELETED);
+ table->status=error ? STATUS_NOT_FOUND: 0;
+ return error;
+ }
+diff -Nrup a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
+--- a/sql/ha_myisammrg.cc 2007-06-14 15:18:00 +04:00
++++ b/sql/ha_myisammrg.cc 2007-11-26 18:58:51 +03:00
+@@ -294,9 +294,13 @@ int ha_myisammrg::index_next_same(byte *
+ const byte *key __attribute__((unused)),
+ uint length __attribute__((unused)))
+ {
++ int error;
+ statistic_increment(table->in_use->status_var.ha_read_next_count,
+- &LOCK_status);
+- int error=myrg_rnext_same(file,buf);
++ &LOCK_status);
++ do
++ {
++ error= myrg_rnext_same(file,buf);
++ } while (error == HA_ERR_RECORD_DELETED);
+ table->status=error ? STATUS_NOT_FOUND: 0;
+ return error;
+ }
More information about the Pkg-mysql-commits
mailing list