[MDEV-16196] GREATEST incorrectly checks a fields' datatype during calculations Created: 2018-05-16 Updated: 2018-06-20 Resolved: 2018-06-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.2.14 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jacques Amar | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux CentOS 7 64 bit |
||
| Issue Links: |
|
||||||||
| Description |
|
If a field is created with : Then using GREATEST(0, fieldname-1) in SELECT or UPDATE Actual example for SELECT: select greatest(1,loc_count-1) from Custom_Lists; same for UPDATE The error should only be triggered in a direct field,not using GREATEST() |
| Comments |
| Comment by Alexander Barkov [ 2018-06-15 ] | |||
|
This script demonstrates the problem:
| |||
| Comment by Alexander Barkov [ 2018-06-15 ] | |||
|
Also repeatable with COALESCE:
| |||
| Comment by Alexander Barkov [ 2018-06-15 ] | |||
|
Also repeatable with just subtraction:
| |||
| Comment by Alexander Barkov [ 2018-06-15 ] | |||
|
This is expected behavior. Please use:
to get a signed result. https://mariadb.com/kb/en/library/sql-mode/ |