[MDEV-8807] Implicit CAST to INT works differently for a field vs a literal Created: 2015-09-16 Updated: 2015-10-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I use a string value in any context that assumes an integer input, for example LEFT(..., <string-value>), which causes implicit type cast. It works very differently when <string-value> is a literal vs a table column:
returns
Notice, LEFT() with a string literal in the second argument returned an empty string, while LEFT() with a string column with the same value returned 'test'. Also, only one warning was generated (the literal did not generate a warning, while the table column did). The expected behavior would be to return the same result and the same set of warnings for the two LEFT() calls. |