[MDEV-8468] CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces Created: 2015-07-15 Updated: 2015-09-23 Resolved: 2015-09-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Sprint: | 10.1.8-1, 10.1.8-2 | ||||||||||||||||
| Description |
|
Implicit cast of a string with trailing spaces silently accepts the value in case of DECIMAL and INT:
A similar script with DOUBLE:
returns an error:
Comparing to the behavior exposed by CAST (see
Explicit CAST also works differently:
returns
Notice, DOUBLE and DECIMAL ignore the trailing spaces silently, while INT produces a warning. Sergei and Bar during a discussion on maria-developers agreed that all data types should produce a NOTE (not a warning) for all numeric data types, in all query parts (INSERT,CAST,dynamic columns). |
| Comments |
| Comment by Sergei Golubchik [ 2015-07-23 ] |
|
This fix changes lots of tests. Warning levels (Warning→Note), error numbers (1265→1366), some new warnings appear, some old warnings disappear. Let's do it in 10.1 |