Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/jiucheng/tmp 002 #880

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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