Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger view errors don't prevent writes on database with preexisting trigger views #2051

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

max-hoffman
Copy link
Contributor

@max-hoffman max-hoffman commented Oct 2, 2023

PR #2034 made it so that we can not DDL triggers on views. But past versions of Dolt permitted creating those triggers. After this change, databases with a trigger view will be have all writes blocked with the trigger view error. We should probably not try to parse and bind all triggers for every write, but as long as we do this adds a warning rather than an error for a non-DDL trigger parse.

@max-hoffman max-hoffman requested review from jycor and reltuk October 2, 2023 19:08
Copy link
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -565,8 +565,8 @@ var (
// ErrViewsNotSupported is returned when attempting to access a view on a database that doesn't support them.
ErrViewsNotSupported = errors.NewKind("database '%s' doesn't support views")

// ErrNotBaseTable is returned when attempting to rename a view using ALTER TABLE statement.
ErrNotBaseTable = errors.NewKind("'%s' is not BASE TABLE")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the error MySQL throws, but it isn't that descriptive.

Copy link
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@max-hoffman
Copy link
Contributor Author

thanks for the reviews, sending

@max-hoffman max-hoffman merged commit 46a98ba into main Oct 2, 2023
@Hydrocharged Hydrocharged deleted the max/backwards-compatible-trigger-view-err branch February 7, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants