| Bug #32374 | crash with filesort when selecting from federated table and view | ||
|---|---|---|---|
| Submitted: | 14 Nov 2007 14:58 | Modified: | 14 Jan 20:32 |
| Reporter: | Shane Bester | ||
| Status: | Closed | ||
| Category: | Server: General | Severity: | S1 (Critical) |
| Version: | 5.0.50, 5.1.23, 6.0.3 | OS: | Any |
| Assigned to: | Alexey Botchkov | Target Version: | |
| Tags: | bfsm_2007_12_06 | ||
| Triage: | D1 (Critical) | ||
[14 Nov 2007 14:58]
Shane Bester
[30 Nov 2007 12:21]
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/38946 ChangeSet@1.2576, 2007-11-30 15:15:49+04:00, holyfoot@mysql.com +4 -0 Bug #32374 crash with filesort when selecting from federated table and view. filesort() uses file->estimate_rows_upper_bound() call to allocate internal buffers. If this function returns a value smaller than a number of row that will be returned later in find_all_keys(), that can cause server crash. Fixed by implementing ha_federated::estimate_rows_upper_bound() to return maximum possible number of rows. Technically we can estimate the number of FEDERATED rows more precisely, but this number can change in the remote table after that before we retrive all the records.
[30 Nov 2007 14:14]
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/38958 ChangeSet@1.2576, 2007-11-30 17:08:00+04:00, holyfoot@mysql.com +4 -0 Bug #32374 crash with filesort when selecting from federated table and view. filesort() uses file->estimate_rows_upper_bound() call to allocate internal buffers. If this function returns a value smaller than a number of row that will be returned later in find_all_keys(), that can cause server crash. Fixed by implementing ha_federated::estimate_rows_upper_bound() to return maximum possible number of rows. Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
[14 Dec 2007 9:15]
Bugs System
Pushed into 5.0.54
[14 Dec 2007 9:19]
Bugs System
Pushed into 5.1.23-rc
[14 Dec 2007 9:22]
Bugs System
Pushed into 6.0.5-alpha
[14 Jan 20:32]
Jon Stephens
Documented in the 5.0.54, 5.1.23, and 6.0.5 changelogs as follows:
An ORDER BY query on a view created using a FEDERATED table as a
base table caused the server to crash.
