Commit 01b3cb2f authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: whitespace, etc

parent 93049e3d
...@@ -28,9 +28,8 @@ insert t1 values (5), (5); ...@@ -28,9 +28,8 @@ insert t1 values (5), (5);
connection con2; connection con2;
set debug_sync= 'now WAIT_FOR ended'; set debug_sync= 'now WAIT_FOR ended';
connection default; connection default;
set session lock_wait_timeout=1;
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end'; set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
alter table t1 add unique (a), algorithm= copy, lock= none; alter table t1 nowait add unique (a), algorithm= copy, lock= none;
connection con2; connection con2;
start transaction; start transaction;
insert into t1 values (123), (456), (789); insert into t1 values (123), (456), (789);
...@@ -51,7 +50,6 @@ a ...@@ -51,7 +50,6 @@ a
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions'; select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
variable_value-@otd variable_value-@otd
1 1
set session lock_wait_timeout=default;
# long transaction and add column # long transaction and add column
create or replace table t1 (a int); create or replace table t1 (a int);
insert t1 values (5); insert t1 values (5);
...@@ -59,8 +57,7 @@ connection con2; ...@@ -59,8 +57,7 @@ connection con2;
set debug_sync= 'now WAIT_FOR ended'; set debug_sync= 'now WAIT_FOR ended';
connection default; connection default;
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end'; set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
set session lock_wait_timeout=1; alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
alter table t1 add b int NULL, algorithm= copy, lock= none;
connection con2; connection con2;
start transaction; start transaction;
insert into t1 values (123), (456), (789); insert into t1 values (123), (456), (789);
...@@ -70,7 +67,6 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction ...@@ -70,7 +67,6 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1; select * from t1;
a a
5 5
set session lock_wait_timeout=default;
connection con2; connection con2;
rollback; rollback;
connection default; connection default;
......
...@@ -43,11 +43,10 @@ insert t1 values (5), (5); ...@@ -43,11 +43,10 @@ insert t1 values (5), (5);
set debug_sync= 'now WAIT_FOR ended'; set debug_sync= 'now WAIT_FOR ended';
--connection default --connection default
set session lock_wait_timeout=1;
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end'; set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
--send --send
alter table t1 add unique (a), algorithm= copy, lock= none; alter table t1 nowait add unique (a), algorithm= copy, lock= none;
--connection con2 --connection con2
--reap --reap
...@@ -64,7 +63,6 @@ commit; ...@@ -64,7 +63,6 @@ commit;
select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions'; select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
select * from t1; select * from t1;
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions'; select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
set session lock_wait_timeout=default;
--echo # long transaction and add column --echo # long transaction and add column
create or replace table t1 (a int); create or replace table t1 (a int);
...@@ -76,9 +74,8 @@ set debug_sync= 'now WAIT_FOR ended'; ...@@ -76,9 +74,8 @@ set debug_sync= 'now WAIT_FOR ended';
--connection default --connection default
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end'; set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
set session lock_wait_timeout=1;
--send --send
alter table t1 add b int NULL, algorithm= copy, lock= none; alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
--connection con2 --connection con2
--reap --reap
...@@ -90,7 +87,6 @@ set debug_sync= 'now SIGNAL end'; ...@@ -90,7 +87,6 @@ set debug_sync= 'now SIGNAL end';
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT
--reap --reap
select * from t1; select * from t1;
set session lock_wait_timeout=default;
--connection con2 --connection con2
rollback; rollback;
--connection default --connection default
......
...@@ -4823,8 +4823,7 @@ class Rows_log_event : public Log_event ...@@ -4823,8 +4823,7 @@ class Rows_log_event : public Log_event
return ::unpack_row(rgi, m_table, m_width, m_curr_row, &m_cols, return ::unpack_row(rgi, m_table, m_width, m_curr_row, &m_cols,
&m_curr_row_end, &m_master_reclength, m_rows_end); &m_curr_row_end, &m_master_reclength, m_rows_end);
} }
bool process_triggers(trg_event_type event, bool process_triggers(trg_event_type event, trg_action_time_type time_type,
trg_action_time_type time_type,
bool old_row_is_record1); bool old_row_is_record1);
/** /**
......
...@@ -7270,7 +7270,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi) ...@@ -7270,7 +7270,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
{ {
DBUG_ENTER("Rows_log_event::find_row"); DBUG_ENTER("Rows_log_event::find_row");
DBUG_ASSERT(m_table && m_table->in_use != NULL); DBUG_ASSERT(m_table);
DBUG_ASSERT(m_table->in_use != NULL);
TABLE *table= m_table; TABLE *table= m_table;
int error= 0; int error= 0;
...@@ -7327,7 +7328,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi) ...@@ -7327,7 +7328,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
table->s->reclength) == 0); table->s->reclength) == 0);
*/ */
int error;
DBUG_PRINT("info",("locating record using primary key (position)")); DBUG_PRINT("info",("locating record using primary key (position)"));
error= table->file->ha_rnd_pos_by_record(table->record[0]); error= table->file->ha_rnd_pos_by_record(table->record[0]);
...@@ -7389,10 +7389,9 @@ int Rows_log_event::find_row(rpl_group_info *rgi) ...@@ -7389,10 +7389,9 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
table->record[0][table->s->null_bytes - 1]|= table->record[0][table->s->null_bytes - 1]|=
256U - (1U << table->s->last_null_bit_pos); 256U - (1U << table->s->last_null_bit_pos);
if (unlikely((error= table->file->ha_index_read_map(table->record[0], error= table->file->ha_index_read_map(table->record[0], m_key, HA_WHOLE_KEY,
m_key, HA_READ_KEY_EXACT);
HA_WHOLE_KEY, if (unlikely(error))
HA_READ_KEY_EXACT))))
{ {
DBUG_PRINT("info",("no record matching the key found in the table")); DBUG_PRINT("info",("no record matching the key found in the table"));
if (error == HA_ERR_KEY_NOT_FOUND) if (error == HA_ERR_KEY_NOT_FOUND)
...@@ -7498,9 +7497,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi) ...@@ -7498,9 +7497,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
/* Continue until we find the right record or have made a full loop */ /* Continue until we find the right record or have made a full loop */
do do
{ {
error= table->file->ha_rnd_next(table->record[0]); if (unlikely((error= table->file->ha_rnd_next(table->record[0]))))
if (unlikely(error))
DBUG_PRINT("info", ("error: %s", HA_ERR(error))); DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
switch (error) { switch (error) {
......
...@@ -144,7 +144,33 @@ pack_row(TABLE *table, MY_BITMAP const* cols, ...@@ -144,7 +144,33 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
#endif #endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
static int fill_extra_persistent_columns(TABLE *table, int master_cols); /**
Fills @c table->record[0] with computed values of extra persistent column
which are present on slave but not on master.
@param table Table whose record[0] buffer is prepared.
@param master_cols No of columns on master
@returns 0 on success
*/
static int fill_extra_persistent_columns(TABLE *table, int master_cols)
{
int error= 0;
if (!table->vfield)
return 0;
for (Field **vfield_ptr= table->vfield; *vfield_ptr; ++vfield_ptr)
{
Field *vfield= *vfield_ptr;
if (vfield->field_index >= master_cols && (vfield->stored_in_db() ||
(vfield->flags & (PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG))))
{
bitmap_set_bit(table->write_set, vfield->field_index);
error= vfield->vcol_info->expr->save_in_field(vfield,0);
}
}
return error;
}
/** /**
Unpack a row into @c table->record[0]. Unpack a row into @c table->record[0].
...@@ -190,9 +216,7 @@ static int fill_extra_persistent_columns(TABLE *table, int master_cols); ...@@ -190,9 +216,7 @@ static int fill_extra_persistent_columns(TABLE *table, int master_cols);
@retval HA_ERR_CORRUPT_EVENT @retval HA_ERR_CORRUPT_EVENT
Found error when trying to unpack fields. Found error when trying to unpack fields.
*/ */
int int unpack_row(rpl_group_info *rgi, TABLE *table, uint const colcnt,
unpack_row(rpl_group_info *rgi,
TABLE *table, uint const colcnt,
uchar const *const row_data, MY_BITMAP const *cols, uchar const *const row_data, MY_BITMAP const *cols,
uchar const **const current_row_end, ulong *const master_reclength, uchar const **const current_row_end, ulong *const master_reclength,
uchar const *const row_end) uchar const *const row_end)
...@@ -497,31 +521,4 @@ int prepare_record(TABLE *const table, const uint skip, const bool check) ...@@ -497,31 +521,4 @@ int prepare_record(TABLE *const table, const uint skip, const bool check)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/**
Fills @c table->record[0] with computed values of extra persistent column
which are present on slave but not on master.
@param table Table whose record[0] buffer is prepared.
@param master_cols No of columns on master
@returns 0 on success
*/
static int fill_extra_persistent_columns(TABLE *table, int master_cols)
{
int error= 0;
Field **vfield_ptr, *vfield;
if (!table->vfield)
return 0;
for (vfield_ptr= table->vfield; *vfield_ptr; ++vfield_ptr)
{
vfield= *vfield_ptr;
if (vfield->field_index >= master_cols && (vfield->stored_in_db() ||
(vfield->flags & (PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG))))
{
bitmap_set_bit(table->write_set, vfield->field_index);
error= vfield->vcol_info->expr->save_in_field(vfield,0);
}
}
return error;
}
#endif // HAVE_REPLICATION #endif // HAVE_REPLICATION
...@@ -3463,8 +3463,8 @@ int wsrep_ignored_error_code(Log_event* ev, int error) ...@@ -3463,8 +3463,8 @@ int wsrep_ignored_error_code(Log_event* ev, int error)
const THD* thd= ev->thd; const THD* thd= ev->thd;
DBUG_ASSERT(error); DBUG_ASSERT(error);
DBUG_ASSERT(wsrep_thd_is_applying(thd) && DBUG_ASSERT(wsrep_thd_is_applying(thd));
!wsrep_thd_is_local_toi(thd)); DBUG_ASSERT(!wsrep_thd_is_local_toi(thd));
if ((wsrep_ignore_apply_errors & WSREP_IGNORE_ERRORS_ON_RECONCILING_DML)) if ((wsrep_ignore_apply_errors & WSREP_IGNORE_ERRORS_ON_RECONCILING_DML))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment