GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix hang on broken project files, empty settings files, row count wrap-around and plot button style by deepsidhu1313 · Pull Request #4248 · sqlitebrowser/sqlitebrowser

Conversation

@deepsidhu1313

@deepsidhu1313 deepsidhu1313 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Three independent commits.

  1. Do not let the row count wrap around for tables with more than INT_MAX rows (related to Magical limit of failure between 70 million and 100 million rows in one table #2592). RowLoader::countRows read the count with sqlite3_column_int, which truncates to 32 bits, so such a table either never reported a count or reported a wrong small one. It is read as int64 and clamped to INT_MAX now. (The reported hang at 70-100 million rows is the QTableView pixel overflow, which the rows_limit setting already works around.) New test-row-count (9 cases; counts around and beyond INT_MAX failed before).
  2. Do not hang on broken project files and accept empty settings files (refs [Portable Install] Error reading settings.ini & project files. #2791). MainWindow::loadProject and its helpers and GlobalFilter::load looped on readNext() != EndElement, which never ends once QXmlStreamReader has failed, so a truncated or malformed .sqbpro hung the application at 100% CPU before the window showed. The loops stop at the end of the document now and loadProject shows a warning with the XML error, line and column. Also, Settings::isVaildSettingsFile rejected an existing but empty settings file (for example one created in advance for a portable install) with the "not a normal settings file" message; an empty file is treated like a missing one now. Tests: rows in test-global-filter running GlobalFilter::load on a watchdog thread (6 of 8 broken documents hung before) and the new test-settings.
  3. Make the "Load all data" button of the plot turn red with any style (refs Linux: "Load all data and redraw plot" button does not turn red #2001). The stylesheet only set colours, so styles and platform themes that ignore the palette did not paint the button red. A border, radius and padding are set so that the stylesheet paints the whole button. New test-plot-dock (grabs the button under several styles). Not verified on a real qt5ct or GTK2 desktop.

Refs #2592, #2791, #2001

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
claude added 3 commits October 31, 2026 18:17
@claude
Do not let the row count wrap around for tables with more than INT_MA…
bc4f1ec
…X rows

RowLoader::countRows() read the result of the COUNT query with
sqlite3_column_int(), which truncates to 32 bits. For a result above
INT_MAX this either produced a negative number, which was silently
dropped so that the row count never completed, or a small or otherwise
wrong number that was then taken as the real number of rows.

Read it as a 64-bit value and clamp it to INT_MAX, the largest number
that the rowCountComplete signal and the table model can represent.
The model's rows limit then applies as usual, which keeps such tables
away from the QTableView pixel overflow that the limit works around.

Add a RowLoader test which feeds counts around and beyond INT_MAX
through an explicit count query.

Related: sqlitebrowser#2592
@claude
Do not hang on broken project files and accept empty settings files
9e1ea6b
Project files:

The loops which read the elements of a project file used the condition
"readNext() != EndElement && name != <element>". Once the XML reader hits
an error, e.g. because the file is cut off or contains invalid XML, it
only returns Invalid tokens from then on, so these loops never ended. The
application then spun at 100% CPU while opening such a project file,
before even showing its window.

Stop the loops when the reader has reached the end of the document or
failed, which cannot happen for well-formed input before the element was
closed. The elements which have been read up to there are still restored
and the user is now told that the project file could not be read
completely.

Extend the global filter test with broken documents: it runs
GlobalFilter::load() on a worker thread with a time limit, so that a loop
which does not end fails the test instead of hanging it.

Settings files:

The -S/--settings option and the import of settings only accepted a file
if its first line is "[%General]". A file which already exists but is
still empty, e.g. one which has been created in advance for a portable
installation, has no first line at all and was rejected as "not a normal
settings file", so the option was ignored and the settings ended up in the
registry or the user's configuration instead. Treat an empty file like
one which doesn't exist yet. Files with other content are still rejected.

Add a test for the settings file handling.

Related: sqlitebrowser#2791
@claude
Make the "Load all data" button of the plot turn red with any style
12b176a
The button is meant to turn red when not all data has been fetched yet,
to hint that the plot is incomplete. Its style sheet only set the colours
but no border, so the button was still drawn by the style of the
application, which then has to take the background colour from the
palette. Some platform themes and styles don't do that (QT_QPA_PLATFORMTHEME
set to qt5ct or gtk2 for example), and the button stayed in the normal
colours.

Also set a border in the style sheet. This makes Qt draw the complete
button from the style sheet, whatever the style of the application is.

Add a test which shows the plot of a partially fetched table and checks
that the button is red with the Fusion and Windows styles as well as with
a style that ignores the palette (a stand-in for the platform themes),
and that it is not red when all data has been fetched.

Related: sqlitebrowser#2001

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@deepsidhu1313 @claude
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.