[MCOL-4222] Import from Table fails or writing empty values Created: 2020-07-30 Updated: 2022-05-06 Resolved: 2020-12-29 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.0.0, 1.5.2 |
| Fix Version/s: | 5.5.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Christian2 | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
CentOS 7 |
||
| Issue Links: |
|
||||||||||||
| Description |
|
Hello. With our latest upgrade from CS 1.2 to Server 1.5 a typical select and insert between 2 tables is not working anymore. – Test with derived sub: ERROR without limit in derived
Additional:
With smaller result set ,e.g. with limit, it works). It works also when both tables are innodb tables. Hover, the full table insert is just 50K rows and a couple of columns is finally not really outstanding. So far Errors coming up with default parameters from Upgrade. We've tried a lot of Parameter variations, like read_buffer_size, max_allowed_packet, etc., unfortunately with no success. Alternative proceeding w/o derived table works fine with all tested larger result sets:
If source and target tables are both columnstore, we've got the same result. The log entries:
This Test indicates that we don't have a problem with structure of the data or memory in general. Therefore it seems to be a bug with result streaming from columnstore or Parameter we didn't found. Your help would be really appreciated. Thanks a lot in advance. -----------------------
|
| Comments |
| Comment by David Hall (Inactive) [ 2020-07-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It's refreshing to be given the DDL and data insertion method to properly attempt to reproduce the issue. Thanks so much! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reproducible with the following script
Tables were populated as expected.
Looks good.
Looks good.
Looks wrong. C_ is not expected to be NULL in any records.
Looks OK. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Interesting observation: with a fairly small LIMIT copying from DERIVED t1cs to CS works fine:
However, when the LIMIT gets larger, it works badly again:
The exact threashold may vary. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also repeatable with this simplified INSERT..SELECT statement:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reproducible with the following script, with a table having only one column, but with more rows.
Looks wrong.
Looks good.
Looks wrong. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also reproducible with a NOT NULL column. Now the value in t2 gets assigned to the default value instead of NULL:
Looks wrong.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The problem happens when the HEAP temporary table gets full and the execution switches to an Aria table. A workaround is to disable derived table handlers:
After this SET command all scripts start to work as expected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The same problem is repeatable with the FederatedX storage engine using this MTR test:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Filed a server issue for this: Waiting for Igor to fix it. Then will add ColumnStore specific regression tests. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2020-11-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Despite the fact that bar found a legitimate bug in Derived Handler processing path the real issue happens earlier when Select Handler fails to find a table handler capable of Select Handler processing. Here is the Jira desribes why MDB skips Select Handler for the query. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2020-12-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The issue in MDB had been solved so one should test the case. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gregory Dorman (Inactive) [ 2020-12-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Test in what release? 10.5 latest GA is fine? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2020-12-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 5.5.1-1 The fixed version was not previously populated and the ticket was not tested prior to the 5.5.1-1 release. I just verified the test case worked in 5.5.1. |