Skip to content

fix: report BigAutoField as UnsignedBigIntAutoField's internal type - #500

Merged
vgulati-apphelix merged 1 commit into
release-ulmofrom
robrap/lp1149-unsigned-bigint-internal-type-2
Oct 6, 2026
Merged

vgulati-apphelix merged 1 commit into
release-ulmofrom
robrap/lp1149-unsigned-bigint-internal-type-2

Conversation

@robrap

@robrap robrap commented Oct 5, 2026

Copy link
Copy Markdown

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

…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
vgulati-apphelix merged commit 0cfc283 into release-ulmo Oct 6, 2026
64 checks passed
@vgulati-apphelix
vgulati-apphelix deleted the robrap/lp1149-unsigned-bigint-internal-type-2 branch October 6, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants