Repository navigation
Conversation
… 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.)
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. |
Contributor
Author
|
Superseded by #58, which ships the same four fixes (#30596/#30598/#30590/#30587) in one commit and — unlike this unit-test-only branch — is live-validated end-to-end on dump/restore roundtrips in both sql_modes. The unit tests introduced here (float boundary, sql_mode-safe literal, bit literal, LOAD DATA literal, backslash-delimiter rejection) remain a useful regression matrix if a tests-only follow-up PR is wanted after #58 lands. Closing to avoid a textual conflict post-merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
convertValuetreateddoubleas plain numeric passthrough, soNaN/+Inf/-Infwere emitted as bare SQL tokens and restore failed at the firstINSERT(ambiguous column reference 'NaN'). float and double now share one boundary-aware formatter: special values stay quoted.FLOATwire text (3.4028235e+38, aboveMaxFloat32) restores as an unquoted literal →data out of range;-0for float/double loses its sign as a bare numeric. Both are now emitted as quoted literals, which the restore cast reproduces exactly (same path proven by the passing CSV roundtrip in the issue).showLoadinterpolated the CSV path and the field delimiter raw into single-quotedLOAD DATAliterals. They are now emitted with doubled-quote escaping (sql_mode-independent). A backslash field delimiter has no portable literal form (it parses differently with/withoutNO_BACKSLASH_ESCAPES) and is now rejected at validation instead of succeeding with an unparsable script.\\,\'), which break underNO_BACKSLASH_ESCAPES. Literals are nowsql_mode-independent: quotes are doubled and backslash bytes are carried byCHAR(92)insideCONCAT.BITbyte-0 uses the same trick withCHAR(0)pieces (also fixing a raw-quote-byte corruption in the oldbitbranch).Tests
TestConvertValueFloatBoundary,TestConvertValueSqlModeSafe,TestConvertValueBit,TestSqlStringLiteral,TestCheckFieldDelimiterBackslash— all pass.Test_toCsvFields/Test_toCsvLinefail identically on cleanmain(escapeStringalready doubles backslashes there; this PR does not touch CSV value escaping).Closes matrixorigin/matrixone#30596
Closes matrixorigin/matrixone#30598
Closes matrixorigin/matrixone#30590
Closes matrixorigin/matrixone#30587