A value is divided by the constant zero

tx0/sql:division-by-zerodefaulterrorreliability/arithmeticdepth fastbug

What it finds

x / 0 fails with a division by zero, or gives NULL in MySQL and SQLite; either way the result is not what was meant. A division inside EXISTS (SELECT 1/0 ...) is left alone, because that select list is never computed.

From the rule's source, division_by_zero.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:

tx0.toml
[rules]
"tx0/sql:division-by-zero" = "off"

To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.

tx0 explain tx0/sql:division-by-zero shows the same in the terminal. Found a false positive? Report it.