[GrandComicsDatabase/gcd-django] Fix reset stats mysql crash (PR #725)

1 view
Skip to first unread message

Josef Andersson

unread,
Jul 11, 2026, 3:07:23 AM (yesterday) Jul 11
to GrandComicsDatabase/gcd-django, Subscribed

reset_stats currently crashes on MySQL with error 1093 partway through: the statistics are rebuilt, but the Series.issue_count stage that came in with #717 never runs. Issue's default ordering ('series', 'sort_code') pulls a join on gcd_series into the update's own subquery, and MySQL refuses to update a table its subquery reads. The Django aggregation docs say to clear the ordering in grouped queries, so that is the fix: one order_by().
https://docs.djangoproject.com/en/5.2/topics/db/aggregation/#interaction-with-order-by


You can view, comment on, or merge this pull request online at:

  https://github.com/GrandComicsDatabase/gcd-django/pull/725

Commit Summary

  • 9f54b01 test: repair the suite after the brand emblem renames
  • 81dc17f fix(scripts): clear default ordering in the reset_stats subquery

File Changes

(11 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/725@github.com>

gemini-code-assist[bot]

unread,
Jul 11, 2026, 3:09:09 AM (yesterday) Jul 11
to GrandComicsDatabase/gcd-django, Subscribed

@gemini-code-assist[bot] commented on this pull request.

Code Review

This pull request updates and adds tests across several test suites to align with changes in query logic, field mappings, and mocking strategies. Notably, it introduces a new test file test_reset_stats.py to verify rebuilding cached statistics, and updates scripts/reset_stats.py by appending .order_by() to a subquery to prevent MySQL error 1093 caused by leaked joins from default ordering. I have no feedback to provide as there are no review comments.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/725/review/4676947725@github.com>

Josef Andersson

unread,
Jul 11, 2026, 3:18:57 AM (yesterday) Jul 11
to GrandComicsDatabase/gcd-django, Subscribed
janderssonse left a comment (GrandComicsDatabase/gcd-django#725)

Gemini is a bit wrong here " adds tests across several test suites to align with " the test script commit is part of the Repair test suite PR and is handled in #724 which Gemini also picks up here, the unique commit the fix scripts commit containing two files, the fix and a test


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/725/c4943504396@github.com>

Reply all
Reply to author
Forward
0 new messages