Bug #29856 | Very long prepared statement in SP can cause crash with certain options | ||
---|---|---|---|
Submitted: | 17 Jul 2007 20:57 | Modified: | 3 Aug 2007 16:43 |
Reporter: | Harrison Fisk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S2 (Serious) |
Version: | 5.0.44,5.0.48BK | OS: | Linux (Ubuntu 6.06) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
Tags: | binary log, crash, prepared statement, query cache |
[17 Jul 2007 20:57]
Harrison Fisk
[17 Jul 2007 20:58]
Harrison Fisk
File to make mysqld crash
Attachment: testcase_29856.txt (text/plain), 16.34 KiB.
[23 Jul 2007 19:06]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/31415 ChangeSet@1.2535, 2007-07-23 18:10:12+04:00, evgen@moonbone.local +3 -0 Bug#29856: Insufficient buffer space led to a server crash. The subst_spvars function is used to create query string with SP variables substituted with their values. This string is used later for the binary log and for the query cache. The problem is that the query_cache_send_result_to_client function requires some additional space after the query to store database name and query cache flags. This space wasn't reserved by the subst_spvars function which led to a memory corruption and crash. Now the subst_spvars function reserves additional space for the query cache.
[24 Jul 2007 19:58]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/31510 ChangeSet@1.2534, 2007-07-24 23:54:08+04:00, evgen@moonbone.local +3 -0 Bug#29856: Insufficient buffer space led to a server crash. The subst_spvars function is used to create query string with SP variables substituted with their values. This string is used later for the binary log and for the query cache. The problem is that the query_cache_send_result_to_client function requires some additional space after the query to store database name and query cache flags. This space wasn't reserved by the subst_spvars function which led to a memory corruption and crash. Now the subst_spvars function reserves additional space for the query cache.
[25 Jul 2007 8:12]
Sergey Petrunya
Review feedback provided on IRC
[28 Jul 2007 11:06]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/31762 ChangeSet@1.2534, 2007-07-28 15:01:29+04:00, evgen@moonbone.local +3 -0 Bug#29856: Insufficient buffer space led to a server crash. The subst_spvars function is used to create query string with SP variables substituted with their values. This string is used later for the binary log and for the query cache. The problem is that the query_cache_send_result_to_client function requires some additional space after the query to store database name and query cache flags. This space wasn't reserved by the subst_spvars function which led to a memory corruption and crash. Now the subst_spvars function reserves additional space for the query cache.
[2 Aug 2007 19:13]
Bugs System
Pushed into 5.1.21-beta
[2 Aug 2007 19:15]
Bugs System
Pushed into 5.0.48
[3 Aug 2007 16:43]
Paul DuBois
Noted in 5.0.48, 5.1.21 changelogs. Very long prepared statements in stored procedures could cause a server crash.