[MDEV-10731] Wrong NULL match results in "Subquery returns more than 1 row" (error code 1242) Created: 2016-09-02 Updated: 2017-02-12 Resolved: 2017-02-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Subquery, Storage Engine - InnoDB |
| Affects Version/s: | 10.1.17, 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1.22 |
| Type: | Bug | Priority: | Major |
| Reporter: | Lars Teuber | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
|
||
| Sprint: | 10.1.21 |
| Description |
|
Wrong NULL match results in "Subquery returns more than 1 row" (error code 1242) Reproduce:
Expected result
Actual result
|
| Comments |
| Comment by Elena Stepanova [ 2016-09-03 ] | |||||
|
Thanks for the report. Reproducible with current 5.5-10.2. | |||||
| Comment by Varun Gupta (Inactive) [ 2017-01-11 ] | |||||
|
Breakpoint 6, evaluate_join_record (join=0x10ca35af0, join_tab=0x10ca37278, error=0) at /Users/varun/MariaDB/10.1/10.1/sql/sql_select.cc:18375 p join_tab->select_cond join_tab->select_cond should not be NULL for the above query. | |||||
| Comment by Varun Gupta (Inactive) [ 2017-01-11 ] | |||||
|
| |||||
| Comment by Sergei Petrunia [ 2017-01-11 ] | |||||
|
Discussion results: It does make an index lookup:
and the index lookup searches for NULL values (which it should not do because If one changes the UPDATE to be a SELECT, then the error disappears: the Still need to figure out why does SELECT makes the NULL check while UPDATE Need to look at why JOIN::outer_ref_cond is NULL for UPDATE, but not NULL for |