-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix alter table drop column drops trigger on the table #3225
Fix alter table drop column drops trigger on the table #3225
Conversation
f16fcbb
to
3a32470
Compare
Signed-off-by: Tanzeel Khan <[email protected]>
3a32470
to
d053d16
Compare
Pull Request Test Coverage Report for Build 12282200736Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Signed-off-by: Tanzeel Khan <[email protected]>
@@ -130,7 +130,7 @@ lookup_and_drop_triggers(ObjectAccessType access, Oid classId, | |||
return; | |||
|
|||
/* We only want to execute this function for the DROP TABLE case */ | |||
if (classId != RelationRelationId || access != OAT_DROP) | |||
if (classId != RelationRelationId || access != OAT_DROP || subId != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add a comment for the subId != 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f756df1
into
babelfish-for-postgresql:BABEL_5_X_DEV
…-postgresql#3225) In postgres trigger and functions are two different objects. You first define a function and then use it in your trigger definition. In babelfish we handle this internally so that for users it feels like a single object. As part of this internal handing we also drop the function created for this trigger as part of post object access hook. Currently the condition for DROP TABLE was incomplete and even for DROP COLUMN we would drop the triggers associated with the table. As a fix add another condition to only execute this internal drop of triggers for DROP TABLE. Issues Resolved: BABEL-5417 Signed-off-by: Tanzeel Khan <[email protected]>
…-postgresql#3225) In postgres trigger and functions are two different objects. You first define a function and then use it in your trigger definition. In babelfish we handle this internally so that for users it feels like a single object. As part of this internal handing we also drop the function created for this trigger as part of post object access hook. Currently the condition for DROP TABLE was incomplete and even for DROP COLUMN we would drop the triggers associated with the table. As a fix add another condition to only execute this internal drop of triggers for DROP TABLE. Issues Resolved: BABEL-5417 Signed-off-by: Tanzeel Khan <[email protected]>
In postgres trigger and functions are two different objects. You first define a function and then use it in your trigger definition. In babelfish we handle this internally so that for users it feels like a single object. As part of this internal handing we also drop the function created for this trigger as part of post object access hook. Currently the condition for DROP TABLE was incomplete and even for DROP COLUMN we would drop the triggers associated with the table. As a fix add another condition to only execute this internal drop of triggers for DROP TABLE. Issues Resolved: BABEL-5417 Signed-off-by: Tanzeel Khan <[email protected]>
In postgres trigger and functions are two different objects. You first define a function and then use it in your trigger definition. In babelfish we handle this internally so that for users it feels like a single object. As part of this internal handing we also drop the function created for this trigger as part of post object access hook. Currently the condition for DROP TABLE was incomplete and even for DROP COLUMN we would drop the triggers associated with the table. As a fix add another condition to only execute this internal drop of triggers for DROP TABLE. Issues Resolved: BABEL-5417 Signed-off-by: Tanzeel Khan <[email protected]>
Description
In postgres trigger and functions are two different objects. You first define a function and then use it in your trigger definition. In babelfish we handle this internally so that for users it feels like a single object. As part of this internal handing we also drop the function created for this trigger as part of post object access hook. Currently the condition for DROP TABLE was incomplete and even for DROP COLUMN we would drop the triggers associated with the table.
As a fix add another condition to only execute this internal drop of triggers for DROP TABLE.
Issues Resolved
[BABEL-5417]
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.