Inspectopedia Help

Constant condition

Reports conditions in WHERE or JOIN clauses that are always TRUE or always FALSE.

Example (MySQL):

CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN); SELECT a FROM t1 WHERE 'Cat' = 'Cat';

The 'Cat' = 'Cat' is always true and will be reported.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SqlConstantConditionInspection
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | SQL

Inspection Details

By default bundled with:

DataSpell 2024.1,

Can be installed with plugin:

Database Tools and SQL, 241.SNAPSHOT

Last modified: 27 August 2024