3680 Rohit Kalhans 2012-04-19
WL#5597: fixing RPL_ROW_IDEMPOTENCY failure.
modified:
sql/log_event.cc
sql/rpl_utility.cc
3679 Rohit Kalhans 2012-04-19
Adding assertion for !m_table->file->inited
in Rows_log_event::row_operations_scan_and_key_teardown()
modified:
sql/log_event.cc
3678 Rohit Kalhans 2012-04-19
WL#5597:
Changes handling review comments from Luis.
-Renaming finish_row_update_or_delete() -> row_operations_scan_and_key_teardown()
-Renaming init_row_update_or_delete() -> row_operations_scan_and_key_setup()
modified:
sql/log_event.cc
sql/log_event.h
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2012-04-19 12:00:53 +0000
+++ b/sql/log_event.cc 2012-04-19 16:46:25 +0000
@@ -9231,9 +9231,9 @@ err:
int
Rows_log_event::row_operations_scan_and_key_teardown(int error)
{
-
DBUG_ENTER("Rows_log_event::row_operations_scan_and_key_teardown");
+ DBUG_ASSERT(!m_table->file->inited);
switch (m_rows_lookup_algorithm)
{
case ROW_LOOKUP_HASH_SCAN:
@@ -9467,9 +9467,12 @@ Rows_log_event::close_record_scan()
{
DBUG_ENTER("Rows_log_event::close_record_scan");
int error= 0;
+
+ // if there is something to actually close
if (m_key_index < MAX_KEY)
{
- error= m_table->file->ha_index_end();
+ if (m_table->file->inited)
+ error= m_table->file->ha_index_end();
if(m_rows_lookup_algorithm == ROW_LOOKUP_HASH_SCAN)
{
@@ -9480,9 +9483,8 @@ Rows_log_event::close_record_scan()
my_free(key_val);
}
}
- else
- if (m_table->file->inited)
- error= m_table->file->ha_rnd_end();
+ else if (m_table->file->inited)
+ error= m_table->file->ha_rnd_end();
DBUG_RETURN(error);
}
@@ -9851,8 +9853,14 @@ end:
else
error= do_apply_row(rli);
- if (table->file->inited)
- close_record_scan();
+ if (!error)
+ error= close_record_scan();
+ else
+ /*
+ we are already with errors. Keep the error code and
+ try to close the scan anyway.
+ */
+ (void) close_record_scan();
if ((get_type_code() == UPDATE_ROWS_EVENT) &&
(saved_m_curr_row == m_curr_row))
@@ -10043,8 +10051,14 @@ close_table:
" (ha_rnd_next returns %d)",error));
}
- if (m_table->file->inited)
- close_record_scan();
+ if (!error)
+ error= close_record_scan();
+ else
+ /*
+ we are already with errors. Keep the error code and
+ try to close the scan anyway.
+ */
+ (void) close_record_scan();
if (error == HA_ERR_RECORD_DELETED)
error= 0;
@@ -10143,7 +10157,16 @@ end:
else
error= do_apply_row(rli);
- error= close_record_scan();
+
+ if (!error)
+ error= close_record_scan();
+ else
+ /*
+ we are already with errors. Keep the error code and
+ try to close the scan anyway.
+ */
+ (void) close_record_scan();
+
if ((get_type_code() == UPDATE_ROWS_EVENT) &&
(saved_m_curr_row == m_curr_row)) // we need to unpack the AI
{
=== modified file 'sql/rpl_utility.cc'
--- a/sql/rpl_utility.cc 2012-04-19 10:02:15 +0000
+++ b/sql/rpl_utility.cc 2012-04-19 16:46:25 +0000
@@ -1380,8 +1380,6 @@ bool Hash_slave_rows::next(HASH_ROW_ENTR
preamble->search_state= state;
preamble->is_search_state_inited= true;
}
- else
- *entry= NULL;
DBUG_RETURN(false);
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl5597 branch (rohit.kalhans:3678 to 3680) WL#5597 | Rohit Kalhans | 20 Apr |