Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dump TRIGGER definitions _after_ data#100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mpdude merged 1 commit intomasterfromtriggers-after-data
Dec 21, 2022
Merged

Conversation

@mpdude
Copy link
Member

@mpdudempdude commentedDec 21, 2022
edited
Loading

When the new CSV output mode with the concept of "output drivers" was added in#92, dumpingTRIGGER definitions was made an implementation detail of the MySQL output driver. This causedTRIGGER definitions to be dumped right after theCREATE TABLE ... commands, before the actual dataINSERT statements.

This potentially breaks the generated SQL files, since a newly created trigger may be relevant for the subsequentINSERT statements; however, MySQL requires that tables used in the trigger are also included in theLOCK TABLES statements.

The aim of this PR is to revert that change, i. e. to dump trigger definitions for a tableafter the data insert statements for it.

I think it is not necessary to move all trigger definitions to the very end of the output – that is, afterall tables have been created and filled with data: A trigger depends on insert/update/deletes for a particular table and is executed only on these events. So, it is not a problem if a trigger refers to a table that has not been created/loaded yet as long as the trigger is not run (and avoiding to run it is the aim of this PR).

@mpdudempdude merged commit481b94a intomasterDec 21, 2022
@mpdudempdude deleted the triggers-after-data branchDecember 21, 2022 10:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mpdude

[8]ページ先頭

©2009-2025 Movatter.jp