Bug 1337337
Summary: | [GSS] (6.4.z) HHH-10757, HHH-9021 - "select new ..." with NULL CAST fails with QuerySyntaxException: unexpected AST node: NULL | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Stephen Fikes <sfikes> | |
Component: | Hibernate | Assignee: | Gail Badner <gbadner> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Martin Simka <msimka> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 6.4.6 | CC: | bmaxwell, gbadner, jawilson, jbilek, jmartisk, jtruhlar, msimka, msochure, ppenicka, sfikes, smarlow, tross | |
Target Milestone: | CR1 | |||
Target Release: | EAP 6.4.11 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1351756 (view as bug list) | Environment: | ||
Last Closed: | 2017-01-17 12:55:26 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1351756, 1326118, 1339868 |
Description
Stephen Fikes
2016-05-18 21:38:05 UTC
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. |