-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite dumpiter dumps invalid script when virtual tables are used #64662
Comments
when using virtual tables, dumpiter generates a broken db script sqlite3 test.db "create virtual table test using fts4(example);" |
apsw contains code that handles the issues with dumping SQLite databases very well. I plan to integrate this code into pysqlite. We can then later port the fix to the sqlite3 module. See ghaering/pysqlite#10 for the tasks and |
Attached is patch with a fix for this issue. This is not as comprehensive as the solution in apsw but I think this should cover most of the cases. The result for Ronny dump after this fix is: BEGIN TRANSACTION; |
My plan for |
…108340) Co-authored-by: Aviv Palivoda <[email protected]>
Hm, bug or feature; this issue was originally labeled as a "bug". But, the source code clearly included the comment: # NOTE: Virtual table support not implemented In this case, I believe the correct label should have been "feature", not "bug", so I'm inclined not to backport it. |
I'm going to close this as resolved. Virtual table support has been added to Python 3.13. If you disagree, please ping me, or re-open. cc. @palaviv @RonnyPfannschmidt @ghaering |
I consider it a bug as the output wasn't valid,it should error if it cant make it, |
Hm, yeah, that is a valid point that weighs heavier than the comment. |
OTOH, this changes the behaviour, which is an argument not to backport it. |
@erlend-aasland personally i prefer people see a error when they dump rather than when they later load that dump this bug in the worst case makes a broken backup silently appear working - not failing early causes more damage silent breakage/invalid datagen is imho worse than adding a error where else people have hidden broken data until they test again |
ftr - imho its fine to have a backport that just finally raises a NotImplementedError rather than silently dumping broken data |
I'd rather backport the fix. Anyway, you've convinced me; I agree that this is more a bugfix than a new feature. I'll prepare backports through 3.11. |
…n.iterdump (python#108340) (cherry picked from commit d0160c7) Co-authored-by: Aviv Palivoda <[email protected]>
…n.iterdump (python#108340) (cherry picked from commit d0160c7) Co-authored-by: Aviv Palivoda <[email protected]>
Thanks for you input, @RonnyPfannschmidt. |
…dump (#108340) (#108564) (cherry picked from commit d0160c7) Co-authored-by: Aviv Palivoda <[email protected]>
Backports are queued; marking this as resolved. |
…dump (#108340) (#108563) * [3.12] gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340) (cherry picked from commit d0160c7) Co-authored-by: Aviv Palivoda <[email protected]> * The _quote_value helper is not part of 3.12; spell out the replacement * With quotes * Ok, let's use explicit quoting --------- Co-authored-by: Aviv Palivoda <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: