Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: handle_query is deleted #122

Open
andyli029 opened this issue Sep 14, 2022 · 2 comments
Open

TODO: handle_query is deleted #122

andyli029 opened this issue Sep 14, 2022 · 2 comments
Labels
TODO TODO
Milestone

Comments

@andyli029
Copy link
Owner

No description provided.

@andyli029 andyli029 added this to the Basic Run milestone Sep 14, 2022
@andyli029 andyli029 added the TODO TODO label Sep 14, 2022
@RingsC
Copy link

RingsC commented Sep 22, 2022

commit 59504c14c2cc5d2472d043c2487460db5b82a547
Author: Roy Lyseng [email protected]
Date: Sat Nov 21 18:02:45 2020 +0100

Bug#32079103: Assertion failure: trx->lock.table_locks.empty()

The symptom for this problem is that we may have an inconsistent
InnoDB transaction after creating a non-InnoDB table from a
query expression that operates on InnoDB tables.
The cause of this is the refactoring that moved creating the
new table into Query_result_create::start_execution().
Before that, the new table was created in
Query_result_create::prepare(), however with single preparation,
it could not be created as part of query preparation.

The problem with the new strategy was that table creation would
occur after locking the tables of the query expression, and thus
the implicit commit of the table creation would clear the locks.
As a result, evaluating the query expression would access unlocked
InnoDB tables, leading to an inconsistent InnoDB state.
When the session was immediately terminated, the InnoDB transaction
state checker would report a problem.

The solution to the problem is to remove the table creation from
Query_result_create::start_execution() and place it in a new function
Query_result_create::create_table_for_select(). We also implement a
**simplified version of handle_query() called populate_table()**, since
the former is not really designed for DDL statements that perform
intermediate commits.

**handle_query() itself is removed because it is no longer in use.**

Reviewed by: Gopal Shankar <[email protected]>
Reviewed by: Chaithra Gopalareddy <[email protected]>

@RingsC
Copy link

RingsC commented Sep 22, 2022

simplified version of handle_query() called populate_table()
and handle_query() itself is removed because it is no longer in use. @andyli029 @DandreChen @lujiashun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO TODO
Projects
None yet
Development

No branches or pull requests

2 participants