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

Make parameter length based on underlying column length except for complex ops #2627

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

simonsabin
Copy link
Collaborator

@simonsabin simonsabin commented Mar 20, 2025

Why make this change?

Fixes issue #2626

What is this change?

Where a parameter is linked to an underlying column in the data model the length is stored
When the query is executed the length is used to ensure parameters have consistent lengths

For certain operations the value is padded with escape characters or %s, these need to be allowed for. In those cases the length is set to -1 (max) in order that the extra characters are allowed for AND consistent lengths are maintained

How was this tested?

  • Integration Tests

Checking the resultant query is using the right length was done using trace. Not sure with the architecture whether it would be possible to mock at that level.

Sample Request(s)

See new tests TestFilterParamForStringFilterWorkWithComplexOp and TestFilterParamForStringFilterWorkWithNotContains

Copy link
Contributor

@aaronburtle aaronburtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you for raising and then solving this issue. Just had a few nits, and a question.

@simonsabin
Copy link
Collaborator Author

simonsabin commented Mar 20, 2025 via email

@simonsabin
Copy link
Collaborator Author

applied suggested changes

@aaronburtle
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor

Pipeline failures are just whitespace format.

@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Aniruddh25
Aniruddh25 previously approved these changes Mar 28, 2025
Copy link
Contributor

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you again for finding this issue and fixing it as well!!

@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

aaronburtle
aaronburtle previously approved these changes Mar 28, 2025
Copy link
Contributor

@aaronburtle aaronburtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for making these changes, looks great.

@aaronburtle
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@simonsabin simonsabin dismissed stale reviews from aaronburtle and Aniruddh25 via c565a6c March 31, 2025 20:27
@Aniruddh25
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

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.

3 participants