[MCOL-80] EXTRACT() function returned assertion error Created: 2016-05-24 Updated: 2016-09-09 Resolved: 2016-09-07 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.3 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Daniel Lee (Inactive) | Assignee: | David Hall (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 1.0.2-1, 1.0.2-2, 1.0.3 | ||||||||||||
| Description |
|
Build tested: InfiniDB> getcalpontsoft Name : infinidb-platform Relocations: (not relocatable) ColumnStore returns: MariaDB [mytest]> select cidx, CDATE, EXTRACT(HOUR_MICROSECOND FROM CDATE) from datatypetestm order by cidx; MariaDB [mytest]> select cidx, CDATE, EXTRACT(MINUTE_MICROSECOND FROM CDATE) from datatypetestm order by cidx; err.log May 23 19:42:23 columnStore Calpont[33411]: 23.815677 |0|0|0| E 00 CAL0000: batchprimitiveprocessor-jl.cpp@660: assertion 'in.length() > offset' failed crit.log May 23 19:42:23 columnStore PrimProc[33351]: 23.813868 |0|0|0| C 28 CAL0000: supported: #012
|
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2016-05-31 ] | |||||||||||||||||||||||
|
Daniel Lee Is this still happening ? Your autopilot results that you shared on May 24th was showing that EXTRACT function is working. | |||||||||||||||||||||||
| Comment by Dipti Joshi (Inactive) [ 2016-06-18 ] | |||||||||||||||||||||||
| Comment by David Hall (Inactive) [ 2016-06-28 ] | |||||||||||||||||||||||
|
Added code for all interval types. This exposed an issue of interval_minute_microsecond intervals returning the wrong values. The reason is that in item_timefunc.cc, fix_length_and_dec() sets max length to 11: case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break; later on, it sets the field type to int32_t, which has a max value of 2,147,483,647 (10 digits). When EXTRACT puts a minute+second+microsecond together, we also get 10 digits. For 59 minutes, 56 seconds, and 0 microseconds, EXTRACT creates 5956000000 (10 digits). When mysqld creates the field to hold the result in item_func.cc line 526, it creates an int32_t because it checks max_length against the constant MY_INT32_NUM_DECIMAL_DIGITS, which is defined as 11: switch (result_type()) { Now when we try to put 5956000000 into the field, it notices that 5956000000 > max(int) and saturates, returning the wrong value. | |||||||||||||||||||||||
| Comment by David Hall (Inactive) [ 2016-06-29 ] | |||||||||||||||||||||||
|
The problem with INTERVAL_MINUTE_MICROSECOND is caused by the bug reported in | |||||||||||||||||||||||
| Comment by Alexander Barkov [ 2016-07-01 ] | |||||||||||||||||||||||
|
A script demonstrating the problem with EXTRACT:
SELECT EXTRACT() correctly returns 5959999999
The value stored in the table is erroneously truncated to 2147483647
And the created column data type is wrong:
The expected data type is bigint. | |||||||||||||||||||||||
| Comment by David Hall (Inactive) [ 2016-09-07 ] | |||||||||||||||||||||||
|
Fixed by |