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.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
