Fix Oracle 11 issues with aliases and disable FollowOnLockingTest on that version

This commit is contained in:
Christian Beikov 2023-10-12 11:41:55 +02:00
parent fb608bddb8
commit 749c6f0e15
2 changed files with 12 additions and 0 deletions

View File

@ -4477,6 +4477,16 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
&& !( getCurrentQueryPart() instanceof QueryGroup ) ) {
appendSql( '*' );
}
else if ( columnAliases != null ) {
String separator = "";
for ( String columnAlias : columnAliases ) {
appendSql( separator );
appendSql( alias );
appendSql( '.' );
appendSql( columnAlias );
separator = COMMA_SEPARATOR;
}
}
else {
int size = 0;
for ( SqlSelection sqlSelection : queryPart.getFirstQuerySpec().getSelectClause().getSqlSelections() ) {

View File

@ -12,6 +12,7 @@ import java.util.concurrent.TimeUnit;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.testing.jdbc.SQLStatementInspector;
@ -39,6 +40,7 @@ import static org.hibernate.jpa.SpecHints.HINT_SPEC_QUERY_TIMEOUT;
@SessionFactory(useCollectingStatementInspector = true)
@SkipForDialect(dialectClass = HSQLDialect.class, reason = "Seems HSQLDB doesn't cancel the query if it waits for a lock?!")
@SkipForDialect(dialectClass = CockroachDialect.class, reason = "Cockroach allows the concurrent access but cancels one or both transactions at the end")
@SkipForDialect(dialectClass = OracleDialect.class, majorVersion = 11, reason = "Timeouts don't work on Oracle 11 when using a driver other than ojdbc6, but we can't test with that driver")
public class FollowOnLockingTest {
@Test