Skip to content

fix(mysql): allow sql.arg to be replace when preceeded with NOT or !#4499

Open
theoriginalstove wants to merge 1 commit into
sqlc-dev:mainfrom
theoriginalstove:3933-fix-not-sqlarg-replacement
Open

fix(mysql): allow sql.arg to be replace when preceeded with NOT or !#4499
theoriginalstove wants to merge 1 commit into
sqlc-dev:mainfrom
theoriginalstove:3933-fix-not-sqlarg-replacement

Conversation

@theoriginalstove

Copy link
Copy Markdown

The MySQL engine converted every unary operator to an opaque TODO node, so a negated argument like WHERE NOT sqlc.arg('foo') was never traversed by the rewrite pass and sqlc.arg() leaked into the generated SQL. This converts logical negation to a BoolExpr, which then walk and rewrite passes already handle.

Fixes #3933

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.

'NOT' and '!' prevents sqlc.arg from being replaced as a query argument

1 participant