From b2de7a6ee6fa37805d9066ed92ca831499902d12 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2007 14:42:35 +0500 Subject: BUG#28026 - Falcon: crash if partitions and select for update Assertion failure may happen with falcon + partition + select for update. This may affect other engines as well. Though assertion failure is fixed with this patch, falcon still deadlocks when running falcon_bug_28026.test. sql/ha_partition.cc: In case rnd_next fails, we must call ha_rnd_end. This is done conditionally (NO_CURRENT_PART_ID != m_part_spec.start_part) in ha_partition::ha_rnd_end. Thus we may not reset m_part_spec.start_part in case rnd is not ended. --- sql/ha_partition.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/ha_partition.cc') diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0c4f3cf708f..37e42f7a850 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3117,7 +3117,7 @@ int ha_partition::rnd_next(uchar *buf) continue; // Probably MyISAM if (result != HA_ERR_END_OF_FILE) - break; // Return error + goto end_dont_reset_start_part; // Return error /* End current partition */ late_extra_no_cache(part_id); @@ -3143,6 +3143,7 @@ int ha_partition::rnd_next(uchar *buf) end: m_part_spec.start_part= NO_CURRENT_PART_ID; +end_dont_reset_start_part: table->status= STATUS_NOT_FOUND; DBUG_RETURN(result); } -- cgit v1.2.1 From b83c28b2ae07410fedb923b1753ca50bbf2cf5cb Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jun 2007 18:17:20 +0200 Subject: Post-merge fixes. sql/ha_partition.cc: Post-merge fixes. The new function HA_EXTRA_INSERT_WITH_UPDATE needs to be handled in ha_partition::extra(). storage/federated/ha_federated.cc: Post-merge fixes. Removed leftover characters. Added a missing brace. Fixed and improved parenthesis handling in ha_federated::append_stmt_insert(). Moved code from HA_EXTRA_RESET to ha_federated::reset(). storage/federated/ha_federated.h: Post-merge fixes. Changed byte to uchar. Added declaration for ha_federated::reset(). --- sql/ha_partition.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sql/ha_partition.cc') diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 37e42f7a850..b6a27c8df28 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4714,6 +4714,12 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info, HA_EXTRA_KEY_CACHE: HA_EXTRA_NO_KEY_CACHE: This parameters are no longer used and could be removed. + + 7) Parameters only used by federated tables for query processing + ---------------------------------------------------------------- + HA_EXTRA_INSERT_WITH_UPDATE: + Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be + executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. */ int ha_partition::extra(enum ha_extra_function operation) @@ -4795,6 +4801,9 @@ int ha_partition::extra(enum ha_extra_function operation) */ break; } + /* Category 7), used by federated handlers */ + case HA_EXTRA_INSERT_WITH_UPDATE: + DBUG_RETURN(loop_extra(operation)); default: { /* Temporary crash to discover what is wrong */ -- cgit v1.2.1