Description of problem: https://hibernate.atlassian.net/browse/HHH-10757 https://issues.jboss.org/browse/JBEAP-4614 Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Gail Badner <gbadner> updated the status of jira JBEAP-4614 to Coding In Progress
I've created a pull request upstream and am waiting for it to be reviewed: https://github.com/hibernate/hibernate-orm/pull/1388
Pushed upstream to 4.2 branch: https://github.com/hibernate/hibernate-orm/commit/5e8124bf8f8c5d73dbabe2fd1f94ede6a50050e7
HHH-10757 fixes null projections using HQL only. It does not fix null projections using JPA queries. HHH-9021 fixes null literal projections using JPA queries; integer literals are also fixed for JPA CriteriaQuery In 5.0 HHH-9021 also fixes HHH-10729 and HHH-10861. That is not the case for 4.2 branch. null literals (HHH-10861) and boolean literals (HHH-10729) remain broken using JPA CriteriaQuery.
There are 2 commits for this fix: https://github.com/hibernate/hibernate-orm/commit/5e8124bf8f8c5d73dbabe2fd1f94ede6a50050e7 (HHH-10757) https://github.com/hibernate/hibernate-orm/commit/0d1ebd28d70c190155682d606e0293261f438a32 (HHH-9021)
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-4614 to Resolved
Verified with EAP 6.4.10.CP.CR1
Fix for HHH-10757 works well, but fix for HHH-9021 works only for mysql, postgresql and postgreplus. Issue still founded with db2, oracle11, oracle12c, mssql and sybase.
Reopening since the fix is only partial (see comment 10). Partial fix can go into 6.4.10, no need to respin. Full fix should go into next CP.
Resetting acks, moving to 6.4.11 target release and payload.
I've been digging into this. Regarding HHH-9021, there are two failing tests: CriteriaLiteralInSelectExpressionTest.testStringLiteral2 - fails on db2, oracle, mssql and sybase - I think these databases don't support queries like [select 1=2 from ....] and the test should be skipped on these databases. The generated query looks correct to me, it's just not supported by all DBs. QueryWithLiteralsInSelectExpressionTest.testSelectNullLiterals - this fails on MySQL and MariaDB - HQL snippet "SELECT cast(null as char)" is transformed to SQL snippet "select cast(null as bit)", which is not accepted by MySQL and MariaDB - if it were transformed to "select cast(null as CHAR)" it would work So I would say that in the first case it's only a problem of the test, the second case looks like a bit of a bug to me. Gail, can you please confirm my theory?
I've created a jira issue to skip CriteriaLiteralInSelectExpressionTest.testStringLiteral2 for Oracle, DB2, SQL Server, and Sybase dialects: https://hibernate.atlassian.net/browse/HHH-11072 Regarding QueryWithLiteralsInSelectExpressionTest.testSelectNullLiterals, the query that fails on MySQL starts with "SELECT cast(null as boolean)", which gets transformed to ""select cast(null as bit)"; "SELECT cast(null as char)" actually works. I created a jira for this issue as well: https://hibernate.atlassian.net/browse/HHH-11073 Both issues have been fixed in Hibernate ORM master, 5.1, 5.0 and 4.2 branches. @jmartisk, please create JBEAP and BZ issues for HHH-11072 and HHH-11073.
Jan is OOO today. I created EAP 7.1 issues: https://issues.jboss.org/browse/JBEAP-5813 https://issues.jboss.org/browse/JBEAP-5815 EAP 7.0.z issues: https://issues.jboss.org/browse/JBEAP-5816 https://issues.jboss.org/browse/JBEAP-5817 EAP 6.4.z issues: https://bugzilla.redhat.com/show_bug.cgi?id=1371863 https://bugzilla.redhat.com/show_bug.cgi?id=1371864 Can someone please check created issues whether they have all attributes required for CP stream (fix version, acks, ... ) ? Also I think this BZ can be switched to VERIFIED, fixes have own BZs.
Verified with EAP 6.4.10.CP.CR2
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.