Skip to content

Commit

Permalink
0004282: Data load wizard truncate sym_node error
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Feb 12, 2020
1 parent b2b2ee0 commit 3a723ee
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -840,11 +840,14 @@ protected String preprocessSqlStatement(String sql) {
DatabaseInfo info = getPlatform().getDatabaseInfo();
String quote = getPlatform().getDdlBuilder().isDelimitedIdentifierModeOn() ? info.getDelimiterToken() : "";
sql = FormatUtils.replace("fullTableName", table.getQualifiedTableName(quote, info.getCatalogSeparator(), info.getSchemaSeparator()), sql);

final String old38CompatibilityTable = "SYM_NODE";

if (ATTRIBUTE_CHANNEL_ID_RELOAD.equals(batch.getChannelId()) && sql.matches(TRUNCATE_PATTERN)) {
if (ATTRIBUTE_CHANNEL_ID_RELOAD.equals(batch.getChannelId()) && sql.matches(TRUNCATE_PATTERN)
&& !table.getNameLowerCase().equals(old38CompatibilityTable)) {
sql = getPlatform().getTruncateSql(table);
} else if (ATTRIBUTE_CHANNEL_ID_RELOAD.equals(batch.getChannelId()) && sql.matches(DELETE_PATTERN)
&& !sql.toUpperCase().contains("WHERE")) {
&& !sql.toUpperCase().contains("WHERE") && !table.getNameLowerCase().equals(old38CompatibilityTable)) {
sql = getPlatform().getDeleteSql(table);
}
}
Expand Down

0 comments on commit 3a723ee

Please sign in to comment.