Repository navigation
fix: report BigAutoField as UnsignedBigIntAutoField's internal type - #500
Merged
vgulati-apphelix merged 1 commit intoOct 6, 2026
Merged
Conversation
…penedx#39181) Django 5.2's IntegerFieldOverflow check uses get_internal_type() to look up the backend's integer range before building SQL for exact-match lookups, and silently raises EmptyResultSet for out-of-range values. UnsignedBigIntAutoField (StudentModule's primary key) renders a MySQL bigint UNSIGNED column but inherited 'AutoField' as its internal type, whose MySQL range is 32-bit signed. On any instance whose courseware_studentmodule ids exceed 2147483647, lookups and forced updates by id silently match no rows, so saving student state fails with "Forced update did not affect any rows." Report 'BigAutoField' instead. This changes no column DDL and generates no migration, and is safe on Django 4.2 as well. Co-Authored-By: Claude <noreply@anthropic.com> (cherry picked from commit 5a25327)
vgulati-apphelix
approved these changes
Oct 6, 2026
vgulati-apphelix
deleted the
robrap/lp1149-unsigned-bigint-internal-type-2
branch
October 6, 2026 20:51
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.
Summary
Cherry-pick of the merged upstream fix, openedx#39181 (5a25327). It replaces #495, which was closed before this reached `release-ulmo`.
`UnsignedBigIntAutoField` (the `StudentModule` primary key) renders a MySQL `bigint UNSIGNED` column but inherited `'AutoField'` as its internal type. On Django 5.0+, `IntegerFieldOverflow` uses `get_internal_type()` to range-check exact-match lookups. Once ids pass 2147483647, lookups and forced updates by id silently match no rows ("Forced update did not affect any rows"). The fix reports `'BigAutoField'`. It changes no DDL and generates no migration, and is safe on Django 4.2.
The cherry-pick applied cleanly and has no changes beyond upstream.
Related: #496, which removes the dead `BigAutoField` and mirrors openedx#39182.
🤖 Generated with Claude Code