#At file:///Users/mattiasj/mysql-bzr/test-5.5-bugteam/ based on revid:georgi.kodinov@stripped
3211 Mattias Jonsson 2010-09-30 [merge]
Manual merge of post push fix for bug#55458 (bug#57113)
into mysql-5.5-bugteam
modified:
mysql-test/r/partition.result
mysql-test/t/partition.test
sql/ha_partition.cc
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result 2010-09-13 13:56:56 +0000
+++ b/mysql-test/r/partition.result 2010-09-30 14:03:32 +0000
@@ -1,5 +1,20 @@
drop table if exists t1, t2;
#
+# Bug#57113: ha_partition::extra(ha_extra_function):
+# Assertion `m_extra_cache' failed
+CREATE TABLE t1
+(id INT NOT NULL PRIMARY KEY,
+name VARCHAR(16) NOT NULL,
+year YEAR,
+INDEX name (name(8))
+)
+PARTITION BY HASH(id) PARTITIONS 2;
+INSERT INTO t1 VALUES ( 1, 'FooBar', '1924' );
+CREATE TABLE t2 (id INT);
+INSERT INTO t2 VALUES (1),(2);
+UPDATE t1, t2 SET t1.year = '1955' WHERE t1.name = 'FooBar';
+DROP TABLE t1, t2;
+#
# Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
#
CREATE TABLE t1 (
=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test 2010-09-13 13:56:56 +0000
+++ b/mysql-test/t/partition.test 2010-09-30 14:03:32 +0000
@@ -15,6 +15,28 @@ drop table if exists t1, t2;
--enable_warnings
--echo #
+--echo # Bug#57113: ha_partition::extra(ha_extra_function):
+--echo # Assertion `m_extra_cache' failed
+CREATE TABLE t1
+(id INT NOT NULL PRIMARY KEY,
+ name VARCHAR(16) NOT NULL,
+ year YEAR,
+ INDEX name (name(8))
+)
+PARTITION BY HASH(id) PARTITIONS 2;
+
+INSERT INTO t1 VALUES ( 1, 'FooBar', '1924' );
+
+CREATE TABLE t2 (id INT);
+
+INSERT INTO t2 VALUES (1),(2);
+
+UPDATE t1, t2 SET t1.year = '1955' WHERE t1.name = 'FooBar';
+
+DROP TABLE t1, t2;
+
+
+--echo #
--echo # Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
--echo #
CREATE TABLE t1 (
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2010-09-13 13:56:56 +0000
+++ b/sql/ha_partition.cc 2010-09-30 14:03:32 +0000
@@ -5698,7 +5698,6 @@ int ha_partition::extra(enum ha_extra_fu
DBUG_RETURN(prepare_for_rename());
break;
case HA_EXTRA_PREPARE_FOR_UPDATE:
- DBUG_ASSERT(m_extra_cache);
/*
Needs to be run on the first partition in the range now, and
later in late_extra_cache, when switching to a new partition to scan.
@@ -5706,6 +5705,8 @@ int ha_partition::extra(enum ha_extra_fu
m_extra_prepare_for_update= TRUE;
if (m_part_spec.start_part != NO_CURRENT_PART_ID)
{
+ if (!m_extra_cache)
+ m_extra_cache_part_id= m_part_spec.start_part;
DBUG_ASSERT(m_extra_cache_part_id == m_part_spec.start_part);
(void) m_file[m_part_spec.start_part]->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
}
@@ -5977,19 +5978,22 @@ void ha_partition::late_extra_cache(uint
{
handler *file;
DBUG_ENTER("ha_partition::late_extra_cache");
- DBUG_PRINT("info", ("extra_cache %u partid %u size %u", m_extra_cache,
+ DBUG_PRINT("info", ("extra_cache %u prepare %u partid %u size %u",
+ m_extra_cache, m_extra_prepare_for_update,
partition_id, m_extra_cache_size));
if (!m_extra_cache && !m_extra_prepare_for_update)
DBUG_VOID_RETURN;
file= m_file[partition_id];
- if (m_extra_cache_size == 0)
- (void) file->extra(HA_EXTRA_CACHE);
- else
- (void) file->extra_opt(HA_EXTRA_CACHE, m_extra_cache_size);
+ if (m_extra_cache)
+ {
+ if (m_extra_cache_size == 0)
+ (void) file->extra(HA_EXTRA_CACHE);
+ else
+ (void) file->extra_opt(HA_EXTRA_CACHE, m_extra_cache_size);
+ }
if (m_extra_prepare_for_update)
{
- DBUG_ASSERT(m_extra_cache);
(void) file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
}
m_extra_cache_part_id= partition_id;
Attachment: [text/bzr-bundle] bzr/mattias.jonsson@oracle.com-20100930140332-hlghjdafj5f5vmpp.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-bugteam branch (mattias.jonsson:3211) Bug#55458Bug#57113 | Mattias Jonsson | 30 Sep |