Skip to content

Commit

Permalink
0005092: Lexical error when issuing a foreign key correction with a
Browse files Browse the repository at this point in the history
carriage return in the data
  • Loading branch information
Philip Marzullo committed Sep 28, 2021
1 parent 17c33f4 commit 8d5aaf1
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -2539,7 +2539,10 @@ public void reloadMissingForeignKeyRowsReverse(String sourceNodeId, Table table,
}

public void reloadMissingForeignKeyRowsForLoad(String sourceNodeId, long batchId, long rowNumber, Table table, CsvData data, String channelId) {
String rowData = CsvUtils.escapeCsvData(data.getCsvData(CsvData.ROW_DATA));
String rowData = data.getCsvData(CsvData.ROW_DATA);
// Replace all actual newlines and carriage returns with \n and \r strings
rowData = rowData.replaceAll("\n", "\\n").replaceAll("\r", "\\r");
rowData = CsvUtils.escapeCsvData(rowData);
Node sourceNode = engine.getNodeService().findNode(sourceNodeId);
String script = "try { engine.getDataService().sendMissingForeignKeyRowsForLoad(" + batchId + ", \""
+ engine.getNodeId() + "\", " + rowNumber + ", " + rowData + "); } catch (Exception e) { }";
Expand Down

0 comments on commit 8d5aaf1

Please sign in to comment.