mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.2 merge.
two tests still fail: main.innodb_icp and main.range_vs_index_merge_innodb call records_in_range() with both range ends being open (which triggers an assert)
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
#include "rpl_utility.h"
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
|
||||
#include "rpl_rli.h"
|
||||
|
||||
/*********************************************************************
|
||||
@ -229,6 +229,64 @@ table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table)
|
||||
return error;
|
||||
}
|
||||
|
||||
Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL)
|
||||
{
|
||||
my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16);
|
||||
}
|
||||
|
||||
Deferred_log_events::~Deferred_log_events()
|
||||
{
|
||||
delete_dynamic(&array);
|
||||
}
|
||||
|
||||
int Deferred_log_events::add(Log_event *ev)
|
||||
{
|
||||
last_added= ev;
|
||||
insert_dynamic(&array, (uchar*) &ev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Deferred_log_events::is_empty()
|
||||
{
|
||||
return array.elements == 0;
|
||||
}
|
||||
|
||||
bool Deferred_log_events::execute(Relay_log_info *rli)
|
||||
{
|
||||
bool res= false;
|
||||
|
||||
DBUG_ASSERT(rli->deferred_events_collecting);
|
||||
|
||||
rli->deferred_events_collecting= false;
|
||||
for (uint i= 0; !res && i < array.elements; i++)
|
||||
{
|
||||
Log_event *ev= (* (Log_event **)
|
||||
dynamic_array_ptr(&array, i));
|
||||
res= ev->apply_event(rli);
|
||||
}
|
||||
rli->deferred_events_collecting= true;
|
||||
return res;
|
||||
}
|
||||
|
||||
void Deferred_log_events::rewind()
|
||||
{
|
||||
/*
|
||||
Reset preceeding Query log event events which execution was
|
||||
deferred because of slave side filtering.
|
||||
*/
|
||||
if (!is_empty())
|
||||
{
|
||||
for (uint i= 0; i < array.elements; i++)
|
||||
{
|
||||
Log_event *ev= *(Log_event **) dynamic_array_ptr(&array, i);
|
||||
delete ev;
|
||||
}
|
||||
if (array.elements > array.max_element)
|
||||
freeze_size(&array);
|
||||
reset_dynamic(&array);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MYSQL_CLIENT */
|
||||
|
||||
|
||||
@ -287,3 +345,4 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
|
||||
}
|
||||
return DBUG_EVALUATE_IF("simulate_checksum_test_failure", TRUE, res);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user