Skip to content

HHH-19698 Fix parsing of in list predicate with null literal #10712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public static boolean isTemporal(JavaType<?> javaType) {
}

public static boolean isUnknown(JavaType<?> javaType) {
return javaType.getClass() == UnknownBasicJavaType.class;
return javaType == null || javaType.getClass() == UnknownBasicJavaType.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.orm.test.query.hql;

import org.hibernate.dialect.DerbyDialect;
import org.hibernate.testing.orm.domain.StandardDomainModel;
import org.hibernate.testing.orm.junit.*;
import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;

@DomainModel(standardModels = StandardDomainModel.GAMBIT)
@SessionFactory
public class InTests {

@Test
@Jira("https://hibernate.atlassian.net/browse/HHH-19698")
@SkipForDialect(dialectClass = DerbyDialect.class, reason = "Derby doesn't like null literals in the in predicate")
public void testInWithNullLiteral(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
assertEquals(0, session.createQuery("select 1 where 1 in (null)", Integer.class).list().size());
}
);
}

}