A value is compared with NULL using = or <>, which is never true
What it finds
x = NULL is never true: comparing with NULL gives unknown, whatever x holds, and so does x <> NULL. IS NULL and IS NOT NULL ask what was meant.
SQL Server's SET ANSI_NULLS OFF makes = NULL work as IS NULL; a file that turns it off is left alone. The fix writes IS NULL or IS NOT NULL for a NULL on the right; it is unsafe, since the result changes for the rows where the column is NULL, which is the point of the fix.
From the rule's source, null_comparison.rs.
Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/sql:null-comparison" = "off"To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.
tx0 explain tx0/sql:null-comparison shows the same in the terminal. Found a false positive? Report it.