Skip to content

Commit

Permalink
feat(binlog): unsupported DDL in binlog layer should be filtered.(sto…
Browse files Browse the repository at this point in the history
…neatom#1186)

Filter the errors of secondary index、unique index、fulltext index、trigger、
foreign key in binlog layer.
  • Loading branch information
DandreChen committed Jan 10, 2023
1 parent 3fa2aab commit f015ae1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/mysqld_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -1129,4 +1129,14 @@ static const int errmsg_section_size[] = { 889, 234 };
#define ER_WRITE_SET_EXCEEDS_LIMIT 3231
#define ER_DEPRECATED_TLS_VERSION_SESSION 3232
#define ER_WARN_DEPRECATED_TLS_VERSION 3233
#define ER_TIANMU_NOT_SUPPORTED_SECONDARY_INDEX 3234
#define ER_TIANMU_NOT_SUPPORTED_UNIQUE_INDEX 3235
#define ER_TIANMU_NOT_SUPPORTED_FULLTEXT_INDEX 3236
#define ER_TIANMU_NOT_SUPPORTED_GEOMETRY 3237
#define ER_TIANMU_NOT_SUPPORTED_ENUM 3238
#define ER_TIANMU_NOT_SUPPORTED_SET 3239
#define ER_TIANMU_NOT_SUPPORTED_TRIGGER 3240
#define ER_TIANMU_NOT_SUPPORTED_FOREIGN_KEY 3241
#define ER_TIANMU_NOT_SUPPORTED_PARTITION 3242
#define ER_TIANMU_NOT_FOUND_INDEX 3243
#endif
15 changes: 15 additions & 0 deletions sql/log_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4972,6 +4972,21 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
thd->killed= THD::NOT_KILLED;
}
/*
Tianmu engine as slave: ingnor some errors
*/
else if(ER_TIANMU_NOT_SUPPORTED_SECONDARY_INDEX == actual_error
|| ER_TIANMU_NOT_SUPPORTED_UNIQUE_INDEX == actual_error
|| ER_TIANMU_NOT_SUPPORTED_FULLTEXT_INDEX == actual_error
|| ER_TIANMU_NOT_SUPPORTED_TRIGGER == actual_error
|| ER_TIANMU_NOT_SUPPORTED_FOREIGN_KEY == actual_error
|| ER_TIANMU_NOT_FOUND_INDEX == actual_error)

{
DBUG_PRINT("info",("error ignored"));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
thd->killed= THD::NOT_KILLED;
}
/*
Other cases: mostly we expected no error and get one.
*/
Expand Down

0 comments on commit f015ae1

Please sign in to comment.