stack
stack

Reputation: 1

is update with left join will lock all MyIsam tables mysql?

I am doing a table update in mysql including 2 left join on other tables. This is all MyIsam tables.

UPDATE DB.tutorial_code LEFT JOIN tutorial ON tutorial.id_tutorial=tutorial_code.ref_tutorial LEFT JOIN tutorial_code_language ON tutorial_code_language.id_tutorial_code_language='1' SET tutorial_code = 'code to be added',ref_tutorial_code_language = '2' WHERE tutorial_code.id_tutorial_code ='3' AND tutorial.ref_tutorial_main='1' AND tutorial_code_language.id_tutorial_code_language='1'

I am wondering if only the table updated will be locked during the process or if the total of the 3 tables (the update one and the two joined ones) will be locked during the process. Indeed I don't want the joined tables to be modified during the process as the update depends on them.

If the 2 joined tables are not locked, I guess that I will have to use lock and lock write every tables used

Upvotes: 0

Views: 694

Answers (1)

Parris Varney
Parris Varney

Reputation: 11488

They will all lock.

Upvotes: 1

Related Questions