Does MYSQL roll back automatically when foreign key constraints or other errors occur?

Source: Internet
Author: User
Does MYSQL roll back automatically when foreign key constraints or other errors occur? Does MYSQL roll back automatically when foreign key constraints or other errors occur?
Do you need to manually determine the foreign key and then manually roll back?


Reply to discussion (solution)

What is automatic rollback? Where can I roll back?
Since an error occurs, the executing command does not do anything, so there is no rollback.

This is also true when foreign key constraints exist. MySQL verifies that a successful sub-table of the primary table fails or a successful self-table master table fails, the operation will be completed only when all operations are successful.

Transaction rollback is not a MySQL function, but a user requirement. Mysql only provides a container to help you implement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.