Databases 3 min read

When VIP Expiration Hits 2038: The MySQL INT Overflow Bug

A hidden bug occurs when a user's VIP subscription is repeatedly extended, causing the stored expiration timestamp to exceed MySQL's signed INT maximum of 2147483647 (January 19, 2038), which prevents the date from being saved correctly.

FunTester
FunTester
FunTester
When VIP Expiration Hits 2038: The MySQL INT Overflow Bug

A testing scenario repeatedly purchased VIP subscriptions to verify transaction risk control and overall process stability. Each purchase extended the VIP expiration by 30 days; if the user was not already VIP, the current timestamp was also extended by 30 days.

The system stored the VIP expiration time in a MySQL table using a signed INT column. Because a signed 32‑bit integer can only represent values up to 2,147,483,647, the timestamp overflowed on January 19, 2038 11:14:07 (Beijing time). When the loop reached a purchase that would set the expiration beyond this limit, MySQL could not store the correct value, causing the bug.

Although the issue was discovered unintentionally during stress testing, the developers chose to "ignore it" as a temporary workaround, acknowledging that it does not affect current users but could surface in the far future.

software testingMySQL2038 problemINT overflowtimestamp bug
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.