Skip to content

Fix NULL inequality in QueryString expressions - #1455

Open
SammyRyuga wants to merge 1 commit into
piccolo-orm:masterfrom
SammyRyuga:fix/querystring-null-inequality
Open

SammyRyuga wants to merge 1 commit into
piccolo-orm:masterfrom
SammyRyuga:fix/querystring-null-inequality

Conversation

@SammyRyuga

Copy link
Copy Markdown

Fixes #1454.

QueryString.ne(None) emitted a stray parameter after IS NOT NULL. Remove the None argument from that branch so the compiler binds only parameters from the left-hand expression.

Add a SQLite execution regression using NULLIF and compilation tests for .ne(None), != None, .eq(None), and .ne("a") across SQLite, PostgreSQL, and CockroachDB. Both NULL-inequality forms produced an extra placeholder on upstream and now preserve only the expression's bound argument.

The SQLite query, M2M, and table suites reported 363 passed, 54 skipped, and 14 subtests passed. Local PostgreSQL and CockroachDB validation was SQL compilation only.

Thanks to @ritojoao for independently reproducing the defect and testing the four comparison cases. Codex assisted with the patch, regression tests, and validation.

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.

QueryString.ne(None) generates invalid IS NOT NULL SQL

1 participant