[MDEV-12134] Condition is evaluated on an empty table Created: 2017-02-27 Updated: 2021-03-19 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.2.7-1 |
| Description |
|
Notice, the IN predicate is evaluated on an empty table. Looks wrong. The record buffer is not initialized to any valid data in case of an empty table, so calling Item_field::val_xxx() is not correct. Note, if I change ENGINE from MYISAM to InnoDB, the warning goes away. |
| Comments |
| Comment by Varun Gupta (Inactive) [ 2017-03-08 ] | |||||||||||
|
Explain while using MyISAM table
Explain while using InnoDB
| |||||||||||
| Comment by Sergei Petrunia [ 2017-03-09 ] | |||||||||||
|
Results of mine and varun' discussion: Confirm, it is evaluating Item_func_in although there's no current row or value of t1.a to evaluate it for: (Q: can this cause a wrong query result?)
Happens on MyISAM const-empty tables only, so this is not a very important bug. | |||||||||||
| Comment by Varun Gupta (Inactive) [ 2017-03-10 ] | |||||||||||
|
I see same stack trace in 10.1 that is the where clause is evaluated for an empty table. The only difference is we dont get the warning in 10.1
|