[MDEV-16454] Bad results for IN with ROW Created: 2018-06-10 Updated: 2018-06-27 Resolved: 2018-06-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.4.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
This scalar query respects unsigned_flag difference for 18446744073709551615 and -1, goes through val_decimal() and correctly returns 0:
A similar query with ROW() erroneously returns 1:
It ignores unsigned_flag, goes through val_int() and treats 18446744073709551615 and -1 as same values. This scalar query correctly returns an error:
A similar ROW query erroneously returns a result with a warning:
It's wrong, the expected behavior is to return an error, like a similar scalar query does. If I put POINT(1,1) to a deeper level, it also erroneously returns a result with the same warning:
The expected behavior is to return an error. |
| Comments |
| Comment by Alexander Barkov [ 2018-06-27 ] | |||||||||||||||||||||||||
|
A similar problem is repeatable when mixing a string and a number: According to MariaDB comparison rules, a string and a number are compared as DOUBLE. This script correctly follows this rule:
Notice:
This script produced exactly the same output:
So does this script, using IN with one value:
So does this script, using IN with two values:
So does this script, using IN with ROW with one value:
Now if use IN with ROW with more than one values:
it returns FALSE with no warnings. |