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

Crash in Table Variable lookup after TVP execution via TDS RPC SPExecuteSQL #1963

Conversation

KushaalShroff
Copy link
Contributor

@KushaalShroff KushaalShroff commented Oct 27, 2023

Description

Earlier we were not reseting the tvp_lookup_list to NIL in SPExecuteSQL after usage and freeing it because of which any subsequent Table Variable lookup would try to lookup in this list which was freed and lead to a crash.
To fix this we set tvp_lookup_list as NIL at the start and at the end of SPExecuteSQL TDS RPC function.

Issues Resolved

BABEL-4463

--signed-off-by: Kushaal Shroff [email protected]

Test Scenarios Covered

  • Use case based -
    X

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

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.

@KushaalShroff KushaalShroff force-pushed the fix_tvp_babel_jira_4463 branch from 3c29d1f to 139ac2a Compare October 31, 2023 07:17
@KushaalShroff KushaalShroff force-pushed the fix_tvp_babel_jira_4463 branch from 139ac2a to cc27288 Compare November 2, 2023 07:14
@KushaalShroff KushaalShroff changed the title tvp Crash in Table Variable lookup after TVP execution via TDS RPC SPExecuteSQL Nov 2, 2023
@KushaalShroff KushaalShroff merged commit a3ce1e4 into babelfish-for-postgresql:BABEL_3_X_DEV Nov 3, 2023
27 checks passed
@KushaalShroff KushaalShroff deleted the fix_tvp_babel_jira_4463 branch November 3, 2023 06:04
KushaalShroff added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 3, 2023
…uteSQL (babelfish-for-postgresql#1963)

Earlier we were not reseting the tvp_lookup_list to NIL in SPExecuteSQL after usage and freeing it because of which any subsequent Table Variable lookup would try to lookup in this list which was freed and lead to a crash.
To fix this we set tvp_lookup_list as NIL at the start and at the end of SPExecuteSQL TDS RPC function.

Issues Resolved
BABEL-4463

--signed-off-by: Kushaal Shroff <[email protected]>
staticlibs pushed a commit to wiltondb/babelfish_extensions that referenced this pull request Dec 24, 2024
…uteSQL (babelfish-for-postgresql#1963)

Earlier we were not reseting the tvp_lookup_list to NIL in SPExecuteSQL after usage and freeing it because of which any subsequent Table Variable lookup would try to lookup in this list which was freed and lead to a crash.
To fix this we set tvp_lookup_list as NIL at the start and at the end of SPExecuteSQL TDS RPC function.

Issues Resolved
BABEL-4463

--signed-off-by: Kushaal Shroff <[email protected]>
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.

2 participants