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

Added single quote escaping to general_query #7237

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FifthPotato
Copy link
Contributor

@FifthPotato FifthPotato commented Aug 1, 2023

Potentially scary PR that allows for embedded single quote stuff to be used in genQuery1.

Pros:

  • Fixes the embedded single quote issue (embedded quotes parsed by general_query should now be in doubles, so the where clause WHERE DATA_NAME = 'test''in' -> WHERE DATA_NAME = 'test'in' in the SQL query)

Cons:

  • Any client code using existing genQuery1 queries has potential points of failure and need to be rewritten (includes stuff like ils, iput, etc...)

e.g. of an issue with iput if no fixes are implemented and this change is merged in: any file with double embedded quotes will be treated as if they only had a single quote, and passing it with -f could clobber a file unexpectedly.

With genQuery2 on the horizon, this potentially breaking change is questionably worth merging. However, I will leave it here as a point of discussion or for posterity.

EDIT: Relevant issues appear to be #7169 #7164 (Verified this fix works for the latter, haven't checked the former)

@alanking
Copy link
Contributor

alanking commented Aug 3, 2023

Is there an issue number for this? If so, please mention here in a comment so we have some additional context. Thanks!

@FifthPotato
Copy link
Contributor Author

Added it to the original post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants