Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,14 @@ public Boolean doInStatement(Statement stmt) throws SQLException, DataAccessExce
// 解决当数据库名称为关键字如"Order"的时候,会报错,无法同步
result &= stmt.execute("use `" + data.getDdlSchemaName() + "`");
}
result &= stmt.execute(data.getSql());
// 跳过删除表时目标库无此表报错
String sql = data.getSql();
if (dbDialect instanceof MysqlDialect) {
if (sql.startsWith("DROP TABLE `")) {
sql = "DROP TABLE IF EXISTS" + sql.substring(10);
}
}
result &= stmt.execute(sql);
return result;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,12 @@ private EventData internParse(Pipeline pipeline, Entry entry, RowChange rowChang
// eventData.setKeys(columns);
// }
} else {
throw new SelectException("this rowdata has no pks , entry: " + entry.toString() + " and rowData: "
+ rowData);
// throw new SelectException("this rowdata has no pks , entry: " + entry.toString() + " and rowData: "
// + rowData);
if (logger.isWarnEnabled()) {
logger.warn("this rowdata has no pks ,schemaName={},tableName={}", eventData.getSchemaName(), eventData.getTableName());
}
return null;
}

return eventData;
Expand Down