Skip to content

Commit

Permalink
0002077: Sql Server and MySQL bulk database writer should use quoted …
Browse files Browse the repository at this point in the history
…identifiers around table names
  • Loading branch information
chenson42 committed Nov 19, 2014
1 parent 6dd1cb9 commit 43db5eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -183,7 +183,7 @@ protected void flush() {
String sql = String.format("LOAD DATA " + (isLocal ? "LOCAL " : "") +
"INFILE '" + stagedInputFile.getFile().getAbsolutePath()).replace('\\', '/') + "' " +
(isReplace ? "REPLACE " : "IGNORE ") + "INTO TABLE " +
this.getTargetTable().getFullyQualifiedTableName() +
this.getTargetTable().getFullyQualifiedTableName(platform.getDatabaseInfo().getDelimiterToken()) +
" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\\\\' LINES TERMINATED BY '\\n' STARTING BY ''" +
" (" + Table.getCommaDeliminatedColumns(table.getColumns()) + ")";
Statement stmt = c.createStatement();
Expand Down
Expand Up @@ -190,7 +190,7 @@ protected void flush() {
JdbcSqlTransaction jdbcTransaction = (JdbcSqlTransaction) transaction;
Connection c = jdbcTransaction.getConnection();
String sql = String.format("BULK INSERT " +
this.getTargetTable().getFullyQualifiedTableName() +
this.getTargetTable().getFullyQualifiedTableName(platform.getDatabaseInfo().getDelimiterToken()) +
" FROM '" + filename) + "'" +
" WITH ( FIELDTERMINATOR='||', KEEPIDENTITY " + (fireTriggers ? ", FIRE_TRIGGERS" : "") + ");";
Statement stmt = c.createStatement();
Expand Down

0 comments on commit 43db5eb

Please sign in to comment.