Commit ca39e66
committed
MDEV-38620: Server crashes in setup_returning_fields upon 2nd execution
of multi-table-styled DELETE from a view
Analysis:
The item_list of builtin_select stores the fields that are there in the
RETURNING clause.
During the "EXECUTE" command, a "dummy item" is added into the item_list
of the select_lex(builtin_select) representing DELETE during
Sql_cmd_delete::precheck(). This snippet that adds a dummy item is added
because columnstore needs for temporary table. Results are put into a
temporary table and to create a temporary table we need to know what
columns are there which we get from the select_lex->item_list.
As a result, the item_list now has an item even when there is not really
RETURNING clause, resulting in execution of the setup_returning_fields()
when it should have exited already.
Fix:
Instead of checking whether builint_select's item_list is empty to
determine whether there is RETURNING clause, use a flag.1 parent 2c2a418 commit ca39e66
File tree
5 files changed
+32
-1
lines changed- mysql-test/main
- sql
5 files changed
+32
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6138 | 6138 | | |
6139 | 6139 | | |
6140 | 6140 | | |
| 6141 | + | |
| 6142 | + | |
| 6143 | + | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
6141 | 6152 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5592 | 5592 | | |
5593 | 5593 | | |
5594 | 5594 | | |
| 5595 | + | |
| 5596 | + | |
| 5597 | + | |
| 5598 | + | |
| 5599 | + | |
| 5600 | + | |
| 5601 | + | |
| 5602 | + | |
| 5603 | + | |
| 5604 | + | |
| 5605 | + | |
| 5606 | + | |
| 5607 | + | |
| 5608 | + | |
5595 | 5609 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1337 | 1337 | | |
1338 | 1338 | | |
1339 | 1339 | | |
| 1340 | + | |
| 1341 | + | |
1340 | 1342 | | |
1341 | 1343 | | |
1342 | 1344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3667 | 3667 | | |
3668 | 3668 | | |
3669 | 3669 | | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
3670 | 3673 | | |
3671 | 3674 | | |
3672 | 3675 | | |
| |||
4946 | 4949 | | |
4947 | 4950 | | |
4948 | 4951 | | |
4949 | | - | |
| 4952 | + | |
4950 | 4953 | | |
4951 | 4954 | | |
4952 | 4955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13730 | 13730 | | |
13731 | 13731 | | |
13732 | 13732 | | |
| 13733 | + | |
13733 | 13734 | | |
13734 | 13735 | | |
13735 | 13736 | | |
| |||
0 commit comments