[MDEV-12860] Out-of-range error on CREATE..SELECT with a view using MAX and EXTRACT(MINUTE_MICROSECOND..) Created: 2017-05-22 Updated: 2017-05-22 Resolved: 2017-05-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1, 10.2, 10.3 |
| Fix Version/s: | 10.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | datatype | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
I run this script:
It correctly reports that the data type for EXTRACT(MINUTE_MICROSECOND) is BIGINT:
and returns the correct value which is outside of the signed 32-bit range:
Now I want to create a table as follows:
It unexpectedly returns an error:
Adding LIMIT 0 shows that it erroneously creates an INT rather than BIGINT column:
The problem is in Item_sum::create_tmp_field:
It creates BIGINT only if max_char_length() is greater than MY_INT32_NUM_DECIMAL_DIGITS, i.e. starting from 12. |
| Comments |
| Comment by Alexander Barkov [ 2017-05-22 ] |
|
Pushed to bb-10.2-ext |