[MDEV-7613] MariaDB 5.5.40 server crash on update table left join with a view Created: 2015-02-20 Updated: 2015-05-05 Resolved: 2015-04-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Views |
| Affects Version/s: | 5.5, 10.0 |
| Fix Version/s: | 5.5.43, 10.0.18 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Stoykov (Inactive) | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | join, optimizer, update, verified, view | ||
| Environment: |
SUSE Linux Enterprise Server 11 (x86_64) |
||
| Issue Links: |
|
||||||||||||
| Description |
|
Several crashes reported on update table left join with a view |
| Comments |
| Comment by Stoykov (Inactive) [ 2015-02-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-02-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Looks like duplicate of https://mariadb.atlassian.net/browse/MDEV-6892 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-02-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
it is not a duplicate | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-02-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Let it stay here: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-02-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
difference from "short" variant: join_tab ls not initialized at all: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Problem is in join->best_positions last element | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Only 2 elements assigned in best positions instead of 3. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Difference with Sergey observation is that after mysql_derived_merge() call 'merged' flag is set and merge really is done (gdb) p derived->merged | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like tables with the same map are not temporary tables: DBUG_PRINT("XXX", ("table '%s' 0x%lx join_tab: 0x%lx map: 0x%lx", in make_join_statistics() output: T@4 : | | | | | | | | | | | XXX: table './kzmdb/tb_user' 0x7fff841859d0 join_tab: 0x7fff841e5f78 map: 0x1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
setup_tables() set it correctly: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Above was not the last setup tables, the last one process only 2 tables | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
last setup_tables process only 2 leaf tables | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
table map of the 'third' table reset during mergeing it... | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
The problem with UPDATE (in difference with SELECT) is that in st_select_lex::remap_tables() it appeared that derived table temporary table which we are going to merge has no table map but underlying table already has (and it was included as leaf table (not temporary one)). | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
The difference between SELECT & UPDATE is that full_table_list is set to true for so underlying table get in to the leaf table list. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Review feedback provided over email. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2015-March/007529.html | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Sent for additional testing | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-03-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Regarding the patch: Regarding the test case: Otherwise, I've run a bunch of tests, didn't get any regressions. Please push. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-04-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
for merging: https://github.com/MariaDB/server/pull/40 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-04-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
It is good, but if engine is not important it is better do not mention it at all (my fault) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-04-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Daniel, thank you a lot, but I think more changes should be done so I've made changes from my tree and push after test run. |