[MDEV-21639] DEFAULT(col) evaluates to a bad value in WHERE clause Created: 2020-02-03 Updated: 2021-12-29 Resolved: 2021-12-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server, Virtual Columns |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.42 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
I run this script:
It returns the following correct result:
Looks good so far. The value of the CASE expression (result column c) is correctly evaluates to 10, and the comparison expression (result column ce) correctly evaluates to true. Now I put the comparison expression into the WHERE clause:
Looks wrong. Now I put a breakpoint in Field_longlong::val_int() and rerun the last SQL query with the WHERE condition.
Notice:
|
| Comments |
| Comment by Aleksey Midenkov [ 2021-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Not reproducible in 10.2 (also tried some old version until 2020-02-03), 10.3. 10.3 debugging shows that val_int() returns 10. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2021-12-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Still repeatable in the current 10.2 as of fad1d15326651a92895c799829ff66edc37fc20f Also repeatable with the following scripts testing other data types - they all return empty sets.
|