使用 left join 更新是否会锁定所有 MyIsam 表 mysql?

发布于 2024-10-07 05:13:04 字数 851 浏览 0 评论 0原文

我正在 mysql 中进行表更新,包括其他表上的 2 个左连接。这是所有 MyIsam 表。

更新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 = '要添加的代码',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'

我想知道是否只有更新的表才会在此过程中被锁定,或者是否在该过程中总共 3 个表(更新的表和两个连接的表)将被锁定。事实上,我不希望在此过程中修改连接表,因为更新取决于它们。

如果 2 个连接表没有锁定,我想我将不得不使用 lock 和 lock write 每个使用的表

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第几種人 2024-10-14 05:13:04

他们都会锁定。

They will all lock.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文