I am doing a table update in mysql including 2 left join on other tables. This is all MyIsam tabl开发者_运维百科es.
UPDATE
DB
.tutorial_code
LEFT JOINtutorial
ONtutorial
.id_tutorial
=tutorial_code
.ref_tutorial
LEFT JOINtutorial_code_language
ONtutorial_code_language
.id_tutorial_code_language
='1' SETtutorial_code
= 'code to be added',ref_tutorial_code_language
= '2' WHEREtutorial_code
.id_tutorial_code
='3' ANDtutorial
.ref_tutorial_main
='1' ANDtutorial_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
They will all lock.
精彩评论