Fix crash in SQL query results when stale editor positions are used#4115
Open
rachavz wants to merge 13 commits intosqlitebrowser:masterfrom
Open
Fix crash in SQL query results when stale editor positions are used#4115rachavz wants to merge 13 commits intosqlitebrowser:masterfrom
rachavz wants to merge 13 commits intosqlitebrowser:masterfrom
Conversation
By default word wrap for QTableView is enabled. If cell's text include quated string or colon or dash (like date: 2025-09-01 00:00:01) then text truncated too much. For example instead of "2005-09-01 00:00:..." truncate to "2005-09-01..."
Fix virtual table sql file export typo
- switch option to positive logic - invoke unconditional setWordWrap()
Fix elide mode behaviour
docs(metainfo): add more URLs
Given that sqlite3 does not allow case-differing identifiers, and in some situations the stored name in `schemata` may differ only in case from the name used in the stored SQL create statement, the search of DB objects must be done case-insensitively. See issue sqlitebrowser#4110.
This adds a new setting in "Preferences > Database" (defaulting to false) to watch the database file when opened in read-only mode and refresh the browser on updated file. See issues sqlitebrowser#1767 and sqlitebrowser#2508.
Added option to replace non-alphanumeric characters in column name with underscore. SQL editor does not complete correctly column names containing space, column and etc.
Replace non-alphanumeric with underscore
The query_logger lambda is called via Qt::QueuedConnection, so editor content may have changed by the time it executes. This caused Scintilla assertion failures when from_position/to_position exceeded document length, or when line numbers were out of bounds after conversion. - Clamp from_position/to_position with qBound before use - Clamp line indices against actual line lengths before setErrorIndicator - Call finishExecution on early return when editor is empty - Guard line iteration loops with lines boundary check Fixes sqlitebrowser#4109.
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.
Fixes #4109
Summary
Random crash when a cell with ordinary text is selected in the SQL query results table.
Root cause: The query_logger lambda in MainWindow.cpp captures the SQL editor state and is invoked via Qt::QueuedConnection. By the time it executes asynchronously, the editor content may have changed, making from_position/to_position stale. This triggers a Scintilla assertion failure in SCI_GETTEXTRANGE when positions are out of bounds.
Fix:
Testing