-
Notifications
You must be signed in to change notification settings - Fork 64
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
Clean up temp table naming, introduce new functions for readability #451
Clean up temp table naming, introduce new functions for readability #451
Conversation
f7796cd
to
37ee7df
Compare
Signed-off-by: Tim Chang <[email protected]>
Signed-off-by: Tim Chang <[email protected]>
Signed-off-by: Tim Chang <[email protected]>
05c4f1d
to
178459a
Compare
@@ -67,6 +67,15 @@ struct QueryEnvironment topLevelQueryEnvData; | |||
struct QueryEnvironment *topLevelQueryEnv = &topLevelQueryEnvData; | |||
struct QueryEnvironment *currentQueryEnv = NULL; | |||
|
|||
static void tsql_setup_queryEnv(QueryEnvironment *queryEnv); |
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.
will it make sense to put BBF changes in a separate file? if not possible due to static functions etc we can use wrappers.
Another possibility is to move most of the code to BBF extension
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.
the main issue with moving BBF changes to a separate file is that the QueryEnvironment struct is meant to be private to the queryenvironment.c
file. Moving everything to the extension would be possible if we move the QueryEnvironment struct into queryenvironment.h
, making it publicly visible, but it has its own risks if community decides to refactor that code in some way.
queryEnv->namedRelList = NIL; | ||
queryEnv->dropped_namedRelList = NIL; | ||
queryEnv->savedCatcacheMessages = NIL; | ||
tsql_setup_queryEnv(queryEnv); |
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.
Hooks can help us reduce regression chances. We should never call a TSQL function in APG instance. I think it is worth having hooks so that we never execute these code path outside BBF env.
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.
agreed to Surendra here btw.
I dont have anymore comments. approving. |
* Add tuple to an ENR. It assumes that an ENR entry has been created with | ||
* the relation name and relation oid. | ||
*/ | ||
bool ENRAddTuple(Relation rel, HeapTuple tup) |
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.
I have the same thought with Surendra, can we add more hook impl for functions like this one ?
d01df35
into
babelfish-for-postgresql:BABEL_4_X_DEV__PG_16_X
…abelfish-for-postgresql#451) Signed-off-by: Tim Chang <[email protected]>
Description
BABEL-5128
queryenvironment.c
to have better separation of different families of functions (ENR catalog search/insertion, cleanup, invalidation messages, rollback handling).Note:
tsql_setup_queryEnv
andtsql_cleanup_queryEnv
cannot be moved to hooks, since the internals of the QueryEnvironment struct are not visible outside ofqueryenvironment.c
.Check List
By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, 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.