Repository navigation
test(import): a CSV all the way to the statements that load it - #655
Merged
Merged
Conversation
The parser and the INSERT builder each had tests; nothing checked that what comes out of one is what the other needs. That gap is where the empty-cell distinction was lost before #578 — `,,` and `,"",` both arriving as `""`. Twelve cases through both: absent versus empty, a quote inside a value, a value built to end its own statement, a comma and a newline inside a quoted field, a doubled quote, a short row, a column name that needs quoting, batching at 100, a header-only file, the literal word NULL, and a leading zero. The SQL they produce was run against MySQL 8.0.46 and the rows read back are the ones asserted here. Import audit F8.
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.
Import audit F8, the last item in #362 worth doing.
The parser and the INSERT builder each had tests. Nothing checked that what comes out of one is what the other needs — which is exactly where the empty-cell distinction was lost before #578:
,,and,"",both arrived as""and both became NULL.Twelve cases through both stages:
NULLversus'')execute_querydoes not accept params #285)NULL, which is a string when the file wrote itThe SQL they produce was run against MySQL 8.0.46 and the rows read back are the ones asserted here.
2715 unit tests.