[MDEV-8087] Server crashed in Time_and_counter_tracker::incr_loops Created: 2015-05-01 Updated: 2015-10-12 Resolved: 2015-10-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.1.7-1, 10.1.8-1, 10.1.8-3, 10.1.8-4 |
| Description |
|
Note: unfortunately, I only have a concurrent test case. Run it with --repeat=N.
|
| Comments |
| Comment by Elena Stepanova [ 2015-06-30 ] | |||||||||||||||||
|
Please re-assign if needed. | |||||||||||||||||
| Comment by Sergei Petrunia [ 2015-08-07 ] | |||||||||||||||||
|
Ok I was able to repeat. It crashes when "CALL proc()" executes SELECT * FROM v2 which calls handle_derived() for v2 We reach JOIN::exec_inner() which has
but | |||||||||||||||||
| Comment by Sergei Petrunia [ 2015-08-07 ] | |||||||||||||||||
|
There is no crash when the queries are run serially. derived subqueries have degenerate joins but the code handles that situation. | |||||||||||||||||
| Comment by Sergei Petrunia [ 2015-08-07 ] | |||||||||||||||||
|
It's interesting that Explain data structure actually exists:
but it didn't get saved in join->explain. | |||||||||||||||||
| Comment by Sergei Petrunia [ 2015-08-07 ] | |||||||||||||||||
|
Added Explain_select::my_join to check how is it possible that Explain_select exists but join->explain==NULL.
So, there is a different JOIN object!
it has a different select_lex.
both select_lex objects have id=2! | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-07 ] | |||||||||||||||||
|
1) I just lost moment when select number in the statement became ID. Different statement and the same number are possible | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-07 ] | |||||||||||||||||
|
Probably SELECT should be identified by LEX and its number in the request... | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-08 ] | |||||||||||||||||
|
As result with talking with Sergey Petrunia we've found that mysql_make_view renumbers SELECTs... Ways: | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-08 ] | |||||||||||||||||
|
OK. Renumbering work as it should during parsing in mysql_make_view(). So problem probably in caching statement by SP and re-parsing views... | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-22 ] | |||||||||||||||||
|
Problem is that in case VIEW is already processed it do not advance select_number counter in THD. Also the counter is not stored properly in the statement. So we get two selects #2 in case if ALTER is in time to fix the view. | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-22 ] | |||||||||||||||||
|
Sequential execution works because it makes full re-prepare of the procedure including views re-parsing, when in parallel execution one view is used as it was stored and other is parsed (and counter set wrongly). | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-22 ] | |||||||||||||||||
|
revision-id: a3c33026bc1f3a8efe3a165661786e7bc08bea34 (mariadb-10.1.6-108-ga3c3302)
Problem: The fix is in keeping the thd->select_number correct even if we use cached views. — | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-09-22 ] | |||||||||||||||||
|
Also the question is should we allow the situation when view changes and the procedure which uses it is not invalidated. Situation is possible if we had problem with the view before and only when creating/altering view made in the same time with the procedure call but still can possibly bring some other problems. | |||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-10-06 ] | |||||||||||||||||
|
fix with test suite: revision-id: ccb6b0dd1fb603673dbcfe7d1763bd3fe5d3bcaf (mariadb-10.1.6-108-gccb6b0d)
Problem: The fix is in keeping the thd->select_number correct even if we use cached views. — | |||||||||||||||||
| Comment by Sergei Petrunia [ 2015-10-11 ] | |||||||||||||||||
|
Ok to push |