UPDATE with prepared parameters and subquery causes error

Details

Detail name Value
Changelog Number 29169
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 causes an Internal Server Error.
Conditions:

  • The statement is an UPDATE statement.
  • The statement contains prepared parameters inside a subquery.
  • 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 test.T SET x = (SELECT a FROM (SELECT ? AS a) LEFT JOIN (SELECT ? AS b) on a = b)");
prepStmt.setInt(1, 1);
prepStmt.setInt(2, 1);
prepStmt.addBatch();
prepStmt.setInt(1, 2);
prepStmt.setInt(2, 2);
prepStmt.addBatch();

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

Workaround

Execute the query without prepared statement or with single values.

Fix

The UPDATE works as intended.