Skip to content

fix: fail CSV export on final write error; relocatable LOAD DATA path - #61

Closed
aptend wants to merge 2 commits into
mainfrom
fix-csv-contract-30628-30481
Closed

aptend wants to merge 2 commits into
mainfrom
fix-csv-contract-30628-30481

Conversation

@aptend

@aptend aptend commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Stacked on #60 (touches the same showLoad).

  • matrixone#30628 — the final Flush error of the CSV writer and the Close error of the CSV file were discarded, so a failing last write still produced MODUMP SUCCESS and a restorable-but-truncated dump. Both are now surfaced (export exits non-zero).
  • matrixone#30481 — LOAD DATA LOCAL INFILE embedded the absolute export path, pinning restores to the original machine/directory. It now emits the relative CSV file name, so the .sql + .csv pair restores anywhere; server-side LOAD DATA INFILE keeps the absolute path (resolved on the server).

Tests: Test_loadDataInfilePath, Test_toCsvLineFlushError pass. Test_toCsvFields/Test_toCsvLine failures pre-exist on main (escapeString doubles backslashes; unrelated).

Confirmed orthogonal to open #57 (source-row iteration errors).

Closes matrixorigin/matrixone#30628
Closes matrixorigin/matrixone#30481

… escaping

- matrixone#30596: DOUBLE NaN/+-Inf are no longer emitted as bare tokens
  (previously restore failed at the first INSERT); float/double specials
  are now quoted alike.
- matrixone#30598: near-max FLOAT wire text above MaxFloat32 is emitted
  as a quoted literal (unquoted it fails restore, out of range); -0 for
  float/double keeps its sign via quoting instead of numeric passthrough.
- matrixone#30590: LOAD DATA path and field-delimiter are interpolated
  as doubled-quote SQL literals; a backslash field delimiter (no portable
  literal form) is rejected at validation instead of a broken export.
- matrixone#30587: string literals no longer rely on backslash escapes:
  quotes are doubled and backslash bytes go through CHAR(92), so dumps
  restore with and without NO_BACKSLASH_ESCAPES; BIT NUL bytes use the
  same _binary-piece/CHAR(0) join (also fixing raw-quote corruption).

Tests: TestConvertValueFloatBoundary, TestConvertValueSqlModeSafe,
TestConvertValueBit, TestSqlStringLiteral, TestCheckFieldDelimiterBackslash.
(Test_toCsvFields/Test_toCsvLine failures are pre-existing on main:
escapeString already doubles backslashes; untouched here.)
- matrixone#30628: toCsvLine now surfaces the final Flush error and
  showLoad checks Close, instead of MODUMP SUCCESS over truncated CSV.
- matrixone#30481: LOCAL INFILE emits a relative file name so the
  .sql+.csv pair restores from any directory/host; server-side INFILE
  keeps the absolute export path.
Tests: Test_loadDataInfilePath, Test_toCsvLineFlushError.
(Test_toCsvFields/Test_toCsvLine failures pre-exist on main.)
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@aptend

aptend commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #58, whose single commit covers #30628 (fail the dump on csv write/close errors) and #30481 (relative CSV path) with live ulimit-truncation validation. Same conflict reasoning as #60. Closing; unit tests (loadDataInfilePath, flush error) can be ported in a follow-up if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant