-
Notifications
You must be signed in to change notification settings - Fork 712
Fix query parameter replacement replacing partial parameter names #1543
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 query parameter replacement replacing partial parameter names #1543
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Feature or Bugfix
Detail
The current parameter replacement might replace parameter names that are merely prefixes of another parameter name. For example, for a query like
replacing
col
with"Name"
would result in the following query:With the change I've implemented, the parameter substitution is making use of the Regex negative look ahead operator, which ensures that we are only replacing full tokens. Therefore,
col2
will not be picked up by a replacement ofcol
.I also added the unit test
test_read_sql_query_parameter_formatting_respects_prefixes
, which will ensure this issue is caught by testing in the future.Relates
#1542
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.