generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 133
Add remote procedure execution via TDS protocol with RPC out validation for linked servers #4292
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
Open
fizzlr
wants to merge
23
commits into
babelfish-for-postgresql:BABEL_5_X_DEV
Choose a base branch
from
amazon-aurora:remote-proc-exec-wip
base: BABEL_5_X_DEV
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c93393d
Add remote procedure execution via TDS protocol with RPC out validati…
e5c200b
Address critical security and correctness issues in remote procedure …
2ce4ece
Enhanced remote procedure execution with ANTLR SELECT-only validation…
1963aa5
Fixed test failures and procedures.c and set GUC on for github actions
d67147b
Address code review comments:
bea0871
Add nested stored procedure support with improved error handling and …
8df5612
added upgrade tests and fixed tests
14385e2
updated tests output
58dc7ce
set github action create extension permission to catalog and fixed diff
398f07b
fixed whitespaces
cf8d2f7
Address all blocking reviewer comments and improve code quality for the
17b2f9e
Map PG error 22P02 to SQL Server error 245 and add RPC error tests. F…
bd1f891
Fix CI failures: revert 22P02 error mapping, fix upgrade schedule nam…
ced2eee
Fix CI failures: remove sybdb.h macro pollution from ANTLR parser and…
ebe442d
fix failing checks
a70cc73
fix
745cf43
fix single_db tests
4d5ec2c
Fix single-db CI failure and add transaction behavior tests
8136178
Block transaction control statements in remote procedure validation
359f235
Implement T-SQL compatible RPC error handling for linked server RPC
a078042
Fix CI failures: update expected outputs for RPC error handling changes
c92b6c7
Fix version upgrade CI: update expected output for new error codes 72…
d992bf8
Re-trigger CI
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,8 +330,8 @@ initTsqlSyscache() | |
| bool | ||
| IsPLtsqlExtendedCatalog(Oid relationId) | ||
| { | ||
| /* Skip during Babelfish restore */ | ||
| if (!babelfish_dump_restore && (relationId == sysdatabases_oid || | ||
| /* Skip during Babelfish restore or extension creation/upgrade */ | ||
| if (!babelfish_dump_restore && !creating_extension && (relationId == sysdatabases_oid || | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we need this change ? |
||
| relationId == bbf_function_ext_oid || relationId == namespace_ext_oid || | ||
| relationId == bbf_authid_login_ext_oid || relationId == bbf_authid_user_ext_oid || | ||
| relationId == bbf_view_def_oid || relationId == bbf_servers_def_oid || | ||
|
|
@@ -1423,6 +1423,42 @@ get_timeout_from_server_name(char *servername, int attnum) | |
| return timeout; | ||
| } | ||
|
|
||
| bool | ||
| get_rpc_out_option(char *servername) | ||
| { | ||
| Relation bbf_servers_def_rel; | ||
| HeapTuple tuple; | ||
| ScanKeyData key; | ||
| TableScanDesc scan; | ||
| bool rpc_out_enabled = false; /* Default to disabled */ | ||
|
|
||
| bbf_servers_def_rel = table_open(get_bbf_servers_def_oid(), | ||
| AccessShareLock); | ||
|
|
||
| ScanKeyInit(&key, | ||
| Anum_bbf_servers_def_servername, | ||
| BTEqualStrategyNumber, F_TEXTEQ, | ||
| CStringGetTextDatum(servername)); | ||
|
|
||
| scan = table_beginscan_catalog(bbf_servers_def_rel, 1, &key); | ||
|
|
||
| tuple = heap_getnext(scan, ForwardScanDirection); | ||
| if (HeapTupleIsValid(tuple)) | ||
| { | ||
| bool isNull; | ||
| rpc_out_enabled = DatumGetBool(heap_getattr(tuple, | ||
| Anum_bbf_servers_def_rpc_out, | ||
| RelationGetDescr(bbf_servers_def_rel), | ||
| &isNull)); | ||
| if (isNull) | ||
| rpc_out_enabled = false; /* Default if NULL */ | ||
| } | ||
|
|
||
| table_endscan(scan); | ||
| table_close(bbf_servers_def_rel, AccessShareLock); | ||
| return rpc_out_enabled; | ||
| } | ||
|
|
||
| void | ||
| clean_up_bbf_server_def() | ||
| { | ||
|
|
@@ -6490,4 +6526,4 @@ bbf_check_member_has_direct_priv_to_grant_role(Oid member, Oid role) | |
|
|
||
| ReleaseSysCacheList(memlist); | ||
| return false; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
We can modify this. This will only be run on a fresh provisioning of Babelfish database. This is not the upgrade script. The ALTER statement should be part of the upgrade script.