Inspectopedia Help

Unsafe 'join' clause in 'delete' statement

Reports missing conditional checks for statements that might modify the whole database.

For example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops contents of the entire table.

Example (MySQL):

CREATE TABLE foo (a INT,b INT,c INT); CREATE TABLE bar (a INT,b INT,c INT); DELETE table1 FROM foo table1 INNER JOIN bar table2;

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.

SqlJoinWithoutOn
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

Last modified: 11 September 2024