[MDEV-23778] Derived table handler loses data on conversion from HEAP to Aria Created: 2020-09-21 Updated: 2022-05-06 Resolved: 2020-09-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Federated |
| Affects Version/s: | 10.4, 10.5 |
| Fix Version/s: | 10.4.16, 10.5.7 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Alexander Barkov | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | derived | ||
| Issue Links: |
|
||||||||
| Description |
|
Derived table handler returns wrong results when a temporary HEAP table gets full and converts to an Aria table. After conversion, the Aria table have DEFAULT values for all fields rather than real values from the derived table query. This test demonstrates the problems:
The problem happens because create_internal_tmp_table_from_heap() is called with "start_recinfo" and "recinfo" pointing to some non-initialized memory (instead of the real table structure), so create_internal_tmp_table_from_heap() thinks the table has no data columns. Thus, instead of copying from HEAP Fields to Aria Fields, it puts records consisting of default values to Aria.
The wrong table structure information seems to come from here:
tmp_table_param gets assigned to &select->join->tmp_table_param, which is not properly initialized, it seems. |
| Comments |
| Comment by Igor Babaev [ 2020-09-29 ] |
|
A fix for this bug was pushed into 10.4. |