Skip to content

Commit edff3f3

Browse files
committed
[MDEV-6877] Update Update, Delete and Write row log event
The row events no longer require columns arguments.
1 parent 724d5ae commit edff3f3

File tree

3 files changed

+19
-36
lines changed

3 files changed

+19
-36
lines changed

sql/log_event.cc

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11117,9 +11117,9 @@ void Table_map_log_event::print(FILE *, PRINT_EVENT_INFO *print_event_info)
1111711117
#if !defined(MYSQL_CLIENT)
1111811118
Write_rows_log_event::Write_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
1111911119
ulong tid_arg,
11120-
MY_BITMAP const *cols,
1112111120
bool is_transactional)
11122-
: Rows_log_event(thd_arg, tbl_arg, tid_arg, cols, is_transactional, WRITE_ROWS_EVENT_V1)
11121+
: Rows_log_event(thd_arg, tbl_arg, tid_arg, tbl_arg->write_set,
11122+
is_transactional, WRITE_ROWS_EVENT_V1)
1112311123
{
1112411124
}
1112511125
#endif
@@ -12131,9 +12131,9 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
1213112131

1213212132
#ifndef MYSQL_CLIENT
1213312133
Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
12134-
ulong tid, MY_BITMAP const *cols,
12135-
bool is_transactional)
12136-
: Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional, DELETE_ROWS_EVENT_V1)
12134+
ulong tid, bool is_transactional)
12135+
: Rows_log_event(thd_arg, tbl_arg, tid, tbl_arg->read_set, is_transactional,
12136+
DELETE_ROWS_EVENT_V1)
1213712137
{
1213812138
}
1213912139
#endif /* #if !defined(MYSQL_CLIENT) */
@@ -12261,21 +12261,11 @@ uint8 Delete_rows_log_event::get_trg_event_map()
1226112261
#if !defined(MYSQL_CLIENT)
1226212262
Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
1226312263
ulong tid,
12264-
MY_BITMAP const *cols_bi,
12265-
MY_BITMAP const *cols_ai,
12266-
bool is_transactional)
12267-
: Rows_log_event(thd_arg, tbl_arg, tid, cols_bi, is_transactional, UPDATE_ROWS_EVENT_V1)
12268-
{
12269-
init(cols_ai);
12270-
}
12271-
12272-
Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
12273-
ulong tid,
12274-
MY_BITMAP const *cols,
1227512264
bool is_transactional)
12276-
: Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional, UPDATE_ROWS_EVENT_V1)
12265+
: Rows_log_event(thd_arg, tbl_arg, tid, tbl_arg->read_set, is_transactional,
12266+
UPDATE_ROWS_EVENT_V1)
1227712267
{
12278-
init(cols);
12268+
init(tbl_arg->write_set);
1227912269
}
1228012270

1228112271
void Update_rows_log_event::init(MY_BITMAP const *cols)

sql/log_event.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4518,8 +4518,8 @@ class Write_rows_log_event : public Rows_log_event
45184518
};
45194519

45204520
#if defined(MYSQL_SERVER)
4521-
Write_rows_log_event(THD*, TABLE*, ulong table_id,
4522-
MY_BITMAP const *cols, bool is_transactional);
4521+
Write_rows_log_event(THD*, TABLE*, ulong table_id,
4522+
bool is_transactional);
45234523
#endif
45244524
#ifdef HAVE_REPLICATION
45254525
Write_rows_log_event(const char *buf, uint event_len,
@@ -4581,12 +4581,6 @@ class Update_rows_log_event : public Rows_log_event
45814581

45824582
#ifdef MYSQL_SERVER
45834583
Update_rows_log_event(THD*, TABLE*, ulong table_id,
4584-
MY_BITMAP const *cols_bi,
4585-
MY_BITMAP const *cols_ai,
4586-
bool is_transactional);
4587-
4588-
Update_rows_log_event(THD*, TABLE*, ulong table_id,
4589-
MY_BITMAP const *cols,
45904584
bool is_transactional);
45914585

45924586
void init(MY_BITMAP const *cols);
@@ -4665,8 +4659,7 @@ class Delete_rows_log_event : public Rows_log_event
46654659
};
46664660

46674661
#ifdef MYSQL_SERVER
4668-
Delete_rows_log_event(THD*, TABLE*, ulong,
4669-
MY_BITMAP const *cols, bool is_transactional);
4662+
Delete_rows_log_event(THD*, TABLE*, ulong, bool is_transactional);
46704663
#endif
46714664
#ifdef HAVE_REPLICATION
46724665
Delete_rows_log_event(const char *buf, uint event_len,

sql/sql_class.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5967,7 +5967,7 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
59675967
{
59685968
/* Create a new RowsEventT... */
59695969
Rows_log_event* const
5970-
ev= new RowsEventT(this, table, table->s->table_map_id,
5970+
ev= new RowsEventT(this, table, table->s->table_map_id,
59715971
is_transactional);
59725972
if (unlikely(!ev))
59735973
DBUG_RETURN(NULL);
@@ -6136,7 +6136,7 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
61366136
is_trans= 1;
61376137

61386138
Rows_log_event* const ev=
6139-
binlog_prepare_pending_rows_event(table, variables.server_id, cols, colcnt,
6139+
binlog_prepare_pending_rows_event(table, variables.server_id,
61406140
len, is_trans,
61416141
static_cast<Write_rows_log_event*>(0));
61426142

@@ -6185,9 +6185,9 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
61856185
#endif
61866186

61876187
Rows_log_event* const ev=
6188-
binlog_prepare_pending_rows_event(table, variables.server_id, cols, colcnt,
6189-
before_size + after_size, is_trans,
6190-
static_cast<Update_rows_log_event*>(0));
6188+
binlog_prepare_pending_rows_event(table, variables.server_id,
6189+
before_size + after_size, is_trans,
6190+
static_cast<Update_rows_log_event*>(0));
61916191

61926192
if (unlikely(ev == 0))
61936193
return HA_ERR_OUT_OF_MEM;
@@ -6221,9 +6221,9 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans,
62216221
is_trans= 1;
62226222

62236223
Rows_log_event* const ev=
6224-
binlog_prepare_pending_rows_event(table, variables.server_id, cols, colcnt,
6225-
len, is_trans,
6226-
static_cast<Delete_rows_log_event*>(0));
6224+
binlog_prepare_pending_rows_event(table, variables.server_id,
6225+
len, is_trans,
6226+
static_cast<Delete_rows_log_event*>(0));
62276227

62286228
if (unlikely(ev == 0))
62296229
return HA_ERR_OUT_OF_MEM;

0 commit comments

Comments
 (0)