generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 984
fix(redshift-mcp-server): Ensure transaction cleanup when protecting statement #1512
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
Merged
+158
−17
Conversation
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
…statement Fixes issue where failed user SQL left transactions open by preventing END statement execution. - Make sure to always execute END statement - Log and raise both user SQL and cleanup errors, including the combined error - Add unit tests for transaction error handling scenarios
src/redshift-mcp-server/awslabs/redshift_mcp_server/redshift.py
Dismissed
Show dismissed
Hide dismissed
E2E test of the fixq chat --model claude-4-sonnet --no-interactive \
--trust-tools awslabsredshift_mcp_server___list_clusters,awslabsredshift_mcp_server___list_databases,awslabsredshift_mcp_server___list_schemas,awslabsredshift_mcp_server___list_tables,awslabsredshift_mcp_server___list_columns,awslabsredshift_mcp_server___execute_query,execute_bash,fs_read \
"Please test the transaction error handling fix by: 1) List available Redshift clusters, 2) Execute an intentionally failing SQL query (syntax error like 'SELECT invalid_syntax_test'), 3) Then immediately execute a valid SQL query (like 'SELECT 1') to verify the transaction state was properly cleaned up and subsequent queries work correctly."
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1512 +/- ##
=======================================
Coverage 89.48% 89.48%
=======================================
Files 729 729
Lines 50584 50599 +15
Branches 7990 7992 +2
=======================================
+ Hits 45264 45280 +16
Misses 3453 3453
+ Partials 1867 1866 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
General E2E testsq chat --model claude-4-sonnet --no-interactive \
--trust-tools awslabsredshift_mcp_server___list_clusters,awslabsredshift_mcp_server___list_databases,awslabsredshift_mcp_server___list_schemas,awslabsredshift_mcp_server___list_tables,awslabsredshift_mcp_server___list_columns,awslabsredshift_mcp_server___execute_query,execute_bash,fs_read \
"Test if all the available to you Redshift Mcp Server tools are working. Check both provisioned and serverless clusters, including the database schema exploration in both. Check the SQL read-only protection, transaction breaker protection, failed user SQL behavior. Get the test scenatio ideas from the unit tests under the project directory. Provide a short testing summary, one line per tool."
# After the summary, show the Redshift MCP Server's definition from the mcp.json masking the secret key values."
|
This was referenced Oct 13, 2025
scottschreckengaust
approved these changes
Oct 14, 2025
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
MichaelWalker-git
approved these changes
Oct 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1489
Summary
Fixes issue where failed user SQL left transactions open by preventing END statement execution.
Changes
User experience
Users won't face the "transaction aborted" error for the queries following a failed query.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? (N)
RFC issue number: #1489
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.