Error 1436: Understanding MySQL's Thread Stack Overrun
When attempting to execute an update query, you encounter a puzzling error: "Thread stack overrun: 6136 bytes used of a 131072 byte stack, and 128000 bytes needed." Delving into the code, we discover that error 1436 (ER_STACK_OVERRUN_NEED_MORE) is triggered when insufficient stack memory is available for thread execution.
Default Thread Stack Size and Configuration
Ordinarily, MySQL sets the thread stack size to a default value of 192K (32-bit architectures) or 256K (64-bit platforms). However, this value can be overridden by modifying my.cnf settings or through custom builds.
Possible Causes
The issue can stem from various causes:
Verifying Default Values and Configuration
To determine the actual thread stack size, execute the following query:
SHOW VARIABLES LIKE 'thread_stack';
Check the my.cnf file for any explicit thread_stack settings.
Troubleshooting and Resolution
To resolve this error, focus on increasing the thread stack:
Additional Considerations
If you encounter this error after a server restart, check for any errors in the server log file. These errors may indicate issues in setting the thread stack size.
The above is the detailed content of Why am I getting MySQL Error 1436: Thread Stack Overrun?. For more information, please follow other related articles on the PHP Chinese website!