summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-09-30 15:57:33 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-09-30 15:57:33 +0200
commitc485854945cf73ad96594eea838fdd4286c53b33 (patch)
treed929eed8492fa6d7e1bf088ce2ec9eefb6277614 /sql/ha_partition.cc
parentaf951a6c368a234d9521cb1afc347fd53fae141e (diff)
downloadmariadb-git-c485854945cf73ad96594eea838fdd4286c53b33.tar.gz
Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
Bug#57113: ha_partition::extra(ha_extra_function): Assertion `m_extra_cache' failed Fix for bug#55458 included DBUG_ASSERTS causing debug builds of the server to crash on another multi-table update. Removed the asserts since they where wrong. (updated after testing the patch in 5.5). mysql-test/r/partition.result: updated result mysql-test/t/partition.test: Added test for bug#57113 sql/ha_partition.cc: Removed the assert for m_extra_cache when ::extra(HA_PREPARE_FOR_UPDATE) was called.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 4fff6cc703c..42920ef18f7 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5550,7 +5550,6 @@ int ha_partition::extra(enum ha_extra_function operation)
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.
@@ -5558,6 +5557,8 @@ int ha_partition::extra(enum ha_extra_function operation)
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));
}
@@ -5820,19 +5821,22 @@ void ha_partition::late_extra_cache(uint partition_id)
{
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;