summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorunknown <karen.langford@oracle.com>2011-04-12 01:36:38 +0200
committerKaren Langford <karen.langford@oracle.com>2011-04-12 01:36:38 +0200
commit914873674b4c08c3f4b726f3a4dba16bfb228ff9 (patch)
treeef4c38c1295090f7e6f0cca209d2d82664899c60 /sql/ha_partition.cc
parentb75d77cb81b6f28bb527c316ec3a842fcd8c019f (diff)
downloadmariadb-git-914873674b4c08c3f4b726f3a4dba16bfb228ff9.tar.gz
Bug#11867664: Fix server crashes on update with join on partitioned table.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index f55c48189fe..bd8e0d397c4 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -4317,7 +4317,8 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
break;
}
}
- m_last_part= part;
+ if (part <= m_part_spec.end_part)
+ m_last_part= part;
}
else
{
@@ -6237,7 +6238,14 @@ void ha_partition::print_error(int error, myf errflag)
{
/* In case m_file has not been initialized, like in bug#42438 */
if (m_file)
+ {
+ if (m_last_part >= m_tot_parts)
+ {
+ DBUG_ASSERT(0);
+ m_last_part= 0;
+ }
m_file[m_last_part]->print_error(error, errflag);
+ }
else
handler::print_error(error, errflag);
}