Skip to content

Conversation

@FooBarrior
Copy link
Owner

Problem:
When nested queries are used inside as of statement, needed tables
are locked before execution, but whole thread tables are unlocked after
it. So, we unlock tables that shouldn't be unlocked. This affects select
and show create table queries.

Solution:
Nested locking is forbidden. Instead, all tables are to be opened at
once. So we add all vtmd tables to lexer's table list and then open
them in a row with other tables used in query.

Problem:
When nested queries are used inside `as of` statement, needed tables
are locked before execution, but whole thread tables are unlocked after
it. So, we unlock tables that shouldn't be unlocked. This affects `select`
and `show create table` queries.

Solution:
Nested locking is forbidden. Instead, all tables are to be opened at
once. So we add all vtmd tables to lexer's table list and then open
them in a row with other tables used in query.
rename prepare_for_read -> add_to_prelocking_list
remove junk comment
@midenok
Copy link

midenok commented May 16, 2018

The code is fine. Additionally you can make sure that versioning.vtmd test succeeds (see mysql-test-run). Also you can add your test case there and update vtmd.result file (see options --record, --force for mysql-test-run).

Prelocking is only enabled when stored routines or nested queries are used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants