Skip to content

Commit 01b3cb2

Browse files
committed
cleanup: whitespace, etc
1 parent 93049e3 commit 01b3cb2

File tree

6 files changed

+43
-58
lines changed

6 files changed

+43
-58
lines changed

mysql-test/main/alter_table_online_debug.result

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ insert t1 values (5), (5);
2828
connection con2;
2929
set debug_sync= 'now WAIT_FOR ended';
3030
connection default;
31-
set session lock_wait_timeout=1;
3231
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
33-
alter table t1 add unique (a), algorithm= copy, lock= none;
32+
alter table t1 nowait add unique (a), algorithm= copy, lock= none;
3433
connection con2;
3534
start transaction;
3635
insert into t1 values (123), (456), (789);
@@ -51,16 +50,14 @@ a
5150
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
5251
variable_value-@otd
5352
1
54-
set session lock_wait_timeout=default;
5553
# long transaction and add column
5654
create or replace table t1 (a int);
5755
insert t1 values (5);
5856
connection con2;
5957
set debug_sync= 'now WAIT_FOR ended';
6058
connection default;
6159
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
62-
set session lock_wait_timeout=1;
63-
alter table t1 add b int NULL, algorithm= copy, lock= none;
60+
alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
6461
connection con2;
6562
start transaction;
6663
insert into t1 values (123), (456), (789);
@@ -70,7 +67,6 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
7067
select * from t1;
7168
a
7269
5
73-
set session lock_wait_timeout=default;
7470
connection con2;
7571
rollback;
7672
connection default;

mysql-test/main/alter_table_online_debug.test

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ insert t1 values (5), (5);
4343
set debug_sync= 'now WAIT_FOR ended';
4444

4545
--connection default
46-
set session lock_wait_timeout=1;
4746
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
4847

4948
--send
50-
alter table t1 add unique (a), algorithm= copy, lock= none;
49+
alter table t1 nowait add unique (a), algorithm= copy, lock= none;
5150

5251
--connection con2
5352
--reap
@@ -64,7 +63,6 @@ commit;
6463
select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
6564
select * from t1;
6665
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
67-
set session lock_wait_timeout=default;
6866

6967
--echo # long transaction and add column
7068
create or replace table t1 (a int);
@@ -76,9 +74,8 @@ set debug_sync= 'now WAIT_FOR ended';
7674

7775
--connection default
7876
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
79-
set session lock_wait_timeout=1;
8077
--send
81-
alter table t1 add b int NULL, algorithm= copy, lock= none;
78+
alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
8279

8380
--connection con2
8481
--reap
@@ -90,7 +87,6 @@ set debug_sync= 'now SIGNAL end';
9087
--error ER_LOCK_WAIT_TIMEOUT
9188
--reap
9289
select * from t1;
93-
set session lock_wait_timeout=default;
9490
--connection con2
9591
rollback;
9692
--connection default

sql/log_event.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4811,7 +4811,7 @@ class Rows_log_event : public Log_event
48114811

48124812
ASSERT_OR_RETURN_ERROR(m_curr_row <= m_rows_end, HA_ERR_CORRUPT_EVENT);
48134813
return ::unpack_row(rgi, m_table, m_width, m_curr_row, cols,
4814-
&m_curr_row_end, &m_master_reclength, m_rows_end);
4814+
&m_curr_row_end, &m_master_reclength, m_rows_end);
48154815
}
48164816

48174817
// Unpack the current row into m_table->record[0]
@@ -4821,10 +4821,9 @@ class Rows_log_event : public Log_event
48214821

48224822
ASSERT_OR_RETURN_ERROR(m_curr_row <= m_rows_end, HA_ERR_CORRUPT_EVENT);
48234823
return ::unpack_row(rgi, m_table, m_width, m_curr_row, &m_cols,
4824-
&m_curr_row_end, &m_master_reclength, m_rows_end);
4824+
&m_curr_row_end, &m_master_reclength, m_rows_end);
48254825
}
4826-
bool process_triggers(trg_event_type event,
4827-
trg_action_time_type time_type,
4826+
bool process_triggers(trg_event_type event, trg_action_time_type time_type,
48284827
bool old_row_is_record1);
48294828

48304829
/**

sql/log_event_server.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7270,7 +7270,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
72707270
{
72717271
DBUG_ENTER("Rows_log_event::find_row");
72727272

7273-
DBUG_ASSERT(m_table && m_table->in_use != NULL);
7273+
DBUG_ASSERT(m_table);
7274+
DBUG_ASSERT(m_table->in_use != NULL);
72747275

72757276
TABLE *table= m_table;
72767277
int error= 0;
@@ -7327,7 +7328,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
73277328
table->s->reclength) == 0);
73287329
73297330
*/
7330-
int error;
73317331
DBUG_PRINT("info",("locating record using primary key (position)"));
73327332

73337333
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)
73897389
table->record[0][table->s->null_bytes - 1]|=
73907390
256U - (1U << table->s->last_null_bit_pos);
73917391

7392-
if (unlikely((error= table->file->ha_index_read_map(table->record[0],
7393-
m_key,
7394-
HA_WHOLE_KEY,
7395-
HA_READ_KEY_EXACT))))
7392+
error= table->file->ha_index_read_map(table->record[0], m_key, HA_WHOLE_KEY,
7393+
HA_READ_KEY_EXACT);
7394+
if (unlikely(error))
73967395
{
73977396
DBUG_PRINT("info",("no record matching the key found in the table"));
73987397
if (error == HA_ERR_KEY_NOT_FOUND)
@@ -7498,9 +7497,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
74987497
/* Continue until we find the right record or have made a full loop */
74997498
do
75007499
{
7501-
error= table->file->ha_rnd_next(table->record[0]);
7502-
7503-
if (unlikely(error))
7500+
if (unlikely((error= table->file->ha_rnd_next(table->record[0]))))
75047501
DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
75057502
switch (error) {
75067503

sql/rpl_record.cc

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,33 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
144144
#endif
145145

146146
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
147-
static int fill_extra_persistent_columns(TABLE *table, int master_cols);
147+
/**
148+
Fills @c table->record[0] with computed values of extra persistent column
149+
which are present on slave but not on master.
150+
151+
@param table Table whose record[0] buffer is prepared.
152+
@param master_cols No of columns on master
153+
@returns 0 on success
154+
*/
155+
static int fill_extra_persistent_columns(TABLE *table, int master_cols)
156+
{
157+
int error= 0;
158+
159+
if (!table->vfield)
160+
return 0;
161+
for (Field **vfield_ptr= table->vfield; *vfield_ptr; ++vfield_ptr)
162+
{
163+
Field *vfield= *vfield_ptr;
164+
if (vfield->field_index >= master_cols && (vfield->stored_in_db() ||
165+
(vfield->flags & (PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG))))
166+
{
167+
bitmap_set_bit(table->write_set, vfield->field_index);
168+
error= vfield->vcol_info->expr->save_in_field(vfield,0);
169+
}
170+
}
171+
return error;
172+
}
173+
148174

149175
/**
150176
Unpack a row into @c table->record[0].
@@ -190,9 +216,7 @@ static int fill_extra_persistent_columns(TABLE *table, int master_cols);
190216
@retval HA_ERR_CORRUPT_EVENT
191217
Found error when trying to unpack fields.
192218
*/
193-
int
194-
unpack_row(rpl_group_info *rgi,
195-
TABLE *table, uint const colcnt,
219+
int unpack_row(rpl_group_info *rgi, TABLE *table, uint const colcnt,
196220
uchar const *const row_data, MY_BITMAP const *cols,
197221
uchar const **const current_row_end, ulong *const master_reclength,
198222
uchar const *const row_end)
@@ -497,31 +521,4 @@ int prepare_record(TABLE *const table, const uint skip, const bool check)
497521

498522
DBUG_RETURN(0);
499523
}
500-
/**
501-
Fills @c table->record[0] with computed values of extra persistent column
502-
which are present on slave but not on master.
503-
504-
@param table Table whose record[0] buffer is prepared.
505-
@param master_cols No of columns on master
506-
@returns 0 on success
507-
*/
508-
static int fill_extra_persistent_columns(TABLE *table, int master_cols)
509-
{
510-
int error= 0;
511-
Field **vfield_ptr, *vfield;
512-
513-
if (!table->vfield)
514-
return 0;
515-
for (vfield_ptr= table->vfield; *vfield_ptr; ++vfield_ptr)
516-
{
517-
vfield= *vfield_ptr;
518-
if (vfield->field_index >= master_cols && (vfield->stored_in_db() ||
519-
(vfield->flags & (PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG))))
520-
{
521-
bitmap_set_bit(table->write_set, vfield->field_index);
522-
error= vfield->vcol_info->expr->save_in_field(vfield,0);
523-
}
524-
}
525-
return error;
526-
}
527524
#endif // HAVE_REPLICATION

sql/wsrep_mysqld.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,8 +3463,8 @@ int wsrep_ignored_error_code(Log_event* ev, int error)
34633463
const THD* thd= ev->thd;
34643464

34653465
DBUG_ASSERT(error);
3466-
DBUG_ASSERT(wsrep_thd_is_applying(thd) &&
3467-
!wsrep_thd_is_local_toi(thd));
3466+
DBUG_ASSERT(wsrep_thd_is_applying(thd));
3467+
DBUG_ASSERT(!wsrep_thd_is_local_toi(thd));
34683468

34693469
if ((wsrep_ignore_apply_errors & WSREP_IGNORE_ERRORS_ON_RECONCILING_DML))
34703470
{

0 commit comments

Comments
 (0)