HHH-17428 ParameterMarkerStrategy markers are 1 based

The position argument in `ParameterMarkerStrategy#createMarker` is
1-based, but `StandardTemporaryTableExporter#getSqlTruncateCommand` calls
it passing a 0.

Hibernate Reactive is affected by this when running queries on
CockroachDB. Hibernate ORM generates queries using `?` as marker
and it's not affected by it unless somebody implements the service.
This commit is contained in:
Davide D'Alto 2023-11-15 11:15:35 +01:00 committed by Davide D'Alto
parent ab861e99fb
commit 755ed17bd4
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ public class StandardTemporaryTableExporter implements TemporaryTableExporter {
.getFastSessionServices().parameterMarkerStrategy; .getFastSessionServices().parameterMarkerStrategy;
return getTruncateTableCommand() + " " + idTable.getQualifiedTableName() return getTruncateTableCommand() + " " + idTable.getQualifiedTableName()
+ " where " + idTable.getSessionUidColumn().getColumnName() + " = " + " where " + idTable.getSessionUidColumn().getColumnName() + " = "
+ parameterMarkerStrategy.createMarker( 0, null ); + parameterMarkerStrategy.createMarker( 1, null );
} }
else { else {
return getTruncateTableCommand() + " " + idTable.getQualifiedTableName(); return getTruncateTableCommand() + " " + idTable.getQualifiedTableName();