You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make progress and checkpoint strictly by-statement
Previously --progress and --checkpoint were influenced by linebreaks to
some extent: multiline queries were correctly joined and counted/
dispatched/checkpointed as one query, but multiple queries on a single
line were dispatched together.
That means that the progress estimation could be thrown off somewhat,
depending on the file contents, and more importantly means that a
statement which was part of line with more than one statement might fail
to be written to the line-influenced checkpoint file if that particular
query succeeded, but a subsequent query on the same line failed.
This subtlety is important if we are to use the checkpoint file to
resume scripts, though in general it would be best when running scripts
to avoid all of these corner cases by having one statement per line.
We pull in sqlparse in addition to sqlglot, because sqlparse has the
feature of preserving the input literally when splitting multi-statement
lines.
This also fixes a bug: the generator here named batch_gen was recreated
in the --progress loop, which didn't matter before this change since
iterating over a filehandle covered up the issue.
Tests are added for statements_from_filehandle(), which had no coverage
before.
Incidentally
* fix missing changelog entry
* fix whitespace in a comment
* remove a backslash by double-quoting a string which contains a
single quote
0 commit comments