UPDATE with prepared parameter does not update rows

Details

Detail name Value
Changelog Number 29170
Type Bug
Status Resolved
Affected Versions Exasol 7.1.0, Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2025.2.0
Fix Versions Exasol 2026.1.0, Exasol 2025.2.1, Exasol 2025.1.10
Resolution Date 2026-02-18

Description

Under specific conditions, an UPDATE statement with prepared parameter may cause an Internal Server Error.
Conditions:

  • The statement is an UPDATE statement.
  • The statement contains a subquery in the WHERE condition.
  • The WHERE condition contains also another predicate with a prepared parameter.
  • The client executes the statement with more than one tuple.

Example:

stmt.execute("CREATE OR REPLACE TABLE T(x INT, y int)");
stmt.execute("INSERT INTO T VALUES (1,1), (2,2), (3,3)");

PreparedStatement prepStmt = conn.prepareStatement(
    "UPDATE T
   SET x = (SELECT COUNT(*)+1 FROM DUAL)
   WHERE x = (SELECT COUNT(*) FROM DUAL) AND x = ?;");
prepStmt.setInt(1, 1);
prepStmt.addBatch();
prepStmt.setInt(1, 2);
prepStmt.addBatch();

// Expected: Updated rows
// Observed: Internal Server Error
prepStmt.executeBatch();

Workaround

Execute the query with a single batch/tuple.

Fix

The UPDATE works as intended.