#At file:///home/satya/WORK/mysql/mysql-5.1-bugteam/ based on revid:matthias.leich@stripped
2968 Satya B 2009-06-22
Applying InnoDB snashot 5.1-ss5343, Fixes BUG#45357
1. BUG#45357 - 5.1.35 crashes with Failing assertion: index->type & DICT_CLUSTERED
2. Also fixes the compilation problem when the flag -DUNIV_MUST_NOT_INLINE
Detailed revision comments:
r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines
branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown,
refuse to unlock the record.
(Bug #45357, caused by the fix of Bug #39320).
rb://132 approved by Sunny Bains.
r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" so that the code compiles
with -DUNIV_MUST_NOT_INLINE.
added:
mysql-test/r/innodb_bug45357.result
mysql-test/t/innodb_bug45357.test
modified:
storage/innobase/btr/btr0cur.c
storage/innobase/include/trx0rseg.ic
storage/innobase/row/row0mysql.c
storage/innobase/trx/trx0rec.c
=== added file 'mysql-test/r/innodb_bug45357.result'
--- a/mysql-test/r/innodb_bug45357.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_bug45357.result 2009-06-22 11:28:00 +0000
@@ -0,0 +1,7 @@
+set session transaction isolation level read committed;
+create table bug45357(a int, b int,key(b))engine=innodb;
+insert into bug45357 values (25170,6122);
+update bug45357 set a=1 where b=30131;
+delete from bug45357 where b < 20996;
+delete from bug45357 where b < 7001;
+drop table bug45357;
=== added file 'mysql-test/t/innodb_bug45357.test'
--- a/mysql-test/t/innodb_bug45357.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_bug45357.test 2009-06-22 11:28:00 +0000
@@ -0,0 +1,10 @@
+-- source include/have_innodb.inc
+
+set session transaction isolation level read committed;
+
+create table bug45357(a int, b int,key(b))engine=innodb;
+insert into bug45357 values (25170,6122);
+update bug45357 set a=1 where b=30131;
+delete from bug45357 where b < 20996;
+delete from bug45357 where b < 7001;
+drop table bug45357;
=== modified file 'storage/innobase/btr/btr0cur.c'
--- a/storage/innobase/btr/btr0cur.c 2008-12-14 18:13:36 +0000
+++ b/storage/innobase/btr/btr0cur.c 2009-06-22 11:28:00 +0000
@@ -23,6 +23,7 @@ Created 10/16/1994 Heikki Tuuri
#include "btr0cur.ic"
#endif
+#include "mtr0log.h"
#include "page0page.h"
#include "rem0rec.h"
#include "rem0cmp.h"
=== modified file 'storage/innobase/include/trx0rseg.ic'
--- a/storage/innobase/include/trx0rseg.ic 2006-09-05 01:52:15 +0000
+++ b/storage/innobase/include/trx0rseg.ic 2009-06-22 11:28:00 +0000
@@ -7,6 +7,7 @@ Created 3/26/1996 Heikki Tuuri
*******************************************************/
#include "srv0srv.h"
+#include "mtr0log.h"
/**********************************************************************
Gets a rollback segment header. */
=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c 2009-04-15 11:46:08 +0000
+++ b/storage/innobase/row/row0mysql.c 2009-06-22 11:28:00 +0000
@@ -1529,9 +1529,14 @@ row_unlock_for_mysql(
index = btr_pcur_get_btr_cur(clust_pcur)->index;
}
+ if (UNIV_UNLIKELY(!(index->type & DICT_CLUSTERED))) {
+ /* This is not a clustered index record. We
+ do not know how to unlock the record. */
+ goto no_unlock;
+ }
+
/* If the record has been modified by this
transaction, do not unlock it. */
- ut_a(index->type & DICT_CLUSTERED);
if (index->trx_id_offset) {
rec_trx_id = trx_read_trx_id(rec
@@ -1568,7 +1573,7 @@ row_unlock_for_mysql(
prebuilt->select_lock_type);
}
}
-
+no_unlock:
mtr_commit(&mtr);
}
=== modified file 'storage/innobase/trx/trx0rec.c'
--- a/storage/innobase/trx/trx0rec.c 2009-03-03 01:32:04 +0000
+++ b/storage/innobase/trx/trx0rec.c 2009-06-22 11:28:00 +0000
@@ -23,6 +23,7 @@ Created 3/26/1996 Heikki Tuuri
#include "que0que.h"
#include "trx0purge.h"
#include "row0row.h"
+#include "mtr0log.h"
/*=========== UNDO LOG RECORD CREATION AND DECODING ====================*/
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (satya.bn:2968) Bug#45357 | Satya B | 22 Jun |