Repository navigation
Fix exact number filters, multi-cell BLOB paste and export write errors - #4245
Open
deepsidhu1313 wants to merge 3 commits into
Open
deepsidhu1313 wants to merge 3 commits into
deepsidhu1313 wants to merge 3 commits into
Conversation
An exact filter such as =2 always put the value in quotes. SQLite never considers a number equal to a quoted string when the column has no type affinity, e.g. the result of COUNT(*) in a view, so such a filter never matched anything. Leave numbers unquoted, but only those which are the same number when read as text or as a number. Values like 007, 1.50 or 12345678901234567890123 are kept as text, otherwise they would stop matching the text stored in a text column. Fixes sqlitebrowser#3608
Pasting a single cell already stores binary data as a BLOB, but pasting several cells went through setData(), which always stores the value as text. Binary data copied from a BLOB cell ended up as corrupt TEXT in the destination cells, which other applications can not read back. Use setTypedData() for each cell, like the single cell cases do, and keep the editability check that setData() did. Add test-paste, which copies and pastes cells through the key shortcuts of the table view. Fixes the multi-cell case of sqlitebrowser#3307
When the disk is full, write() first writes as much as still fits and returns the smaller number. The JSON export ignored this, so it reported success and left a truncated file. The CSV export did not notice a failure to write the last chunk of data either, because a QTextStream only writes it when it is flushed, which happened after the last check. Check the result of writing the JSON document and flush the CSV stream before checking it. Don't commit the QSaveFile when something went wrong, because that replaced an existing file with the incomplete one. Add writeAll() and flushStream() for this and test them with a device that behaves like a full disk. Fixes sqlitebrowser#3243
This branch has not been deployed
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.
Three independent commits.
Fixes #3608, #3243; related to #3307