Bug 296279 - jpql.JUnitJPQLComplexTestSuite.complexConstructorCaseTest failed with Derby
Summary: jpql.JUnitJPQLComplexTestSuite.complexConstructorCaseTest failed with Derby
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2009-11-26 14:18 EST by Edwin Tang CLA
Modified: 2022-06-09 10:24 EDT (History)
1 user (show)

See Also:


Attachments
patch file (1.04 KB, patch)
2010-03-22 13:51 EDT, Edwin Tang CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin Tang CLA 2009-11-26 14:18:37 EST
org.eclipse.persistence.testing.tests.jpa.jpql.JUnitJPQLComplexTestSuite.complexConstructorCaseTest failed with Derby version 10.5.3.0.

Stack Trace:
============
Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "t0" at line 1, column 13. Error Code: 30000 Call: SELECT CASE t0.F_NAME WHEN 'Bob' THEN 'Robert' ELSE '' END, 'Ott' FROM CMP3_EMPLOYEE t0, CMP3_SALARY t1 WHERE ((t0.EMP_ID = 841) AND (t1.EMP_ID = t0.EMP_ID)) Query: ReportQuery(referenceClass=Employee sql="SELECT CASE t0.F_NAME WHEN ? THEN ? ELSE ? END, ? FROM CMP3_EMPLOYEE t0, CMP3_SALARY t1 WHERE ((t0.EMP_ID = ?) AND (t1.EMP_ID = t0.EMP_ID))")

Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "t0" at line 1, column 13.
Error Code: 30000
Call: SELECT CASE t0.F_NAME WHEN 'Bob' THEN 'Robert' ELSE '' END, 'Ott' FROM CMP3_EMPLOYEE t0, CMP3_SALARY t1 WHERE ((t0.EMP_ID = 841) AND (t1.EMP_ID = t0.EMP_ID))
Query: ReportQuery(referenceClass=Employee sql="SELECT CASE t0.F_NAME WHEN ? THEN ? ELSE ? END, ? FROM CMP3_EMPLOYEE t0, CMP3_SALARY t1 WHERE ((t0.EMP_ID = ?) AND (t1.EMP_ID = t0.EMP_ID))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:686)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:529)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:529)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:262)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:618)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2537)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2480)
at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:838)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:958)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:432)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1021)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:453)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:702)
at org.eclipse.persistence.testing.tests.jpa.jpql.JUnitJPQLComplexTestSuite.complexConstructorCaseTest(JUnitJPQLComplexTestSuite.java:1245)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:428)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:248)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
Caused by: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "t0" at line 1, column 13.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:889)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:601)
Caused by: java.sql.SQLException: Syntax error: Encountered "t0" at line 1, column 13.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
Caused by: ERROR 42X01: Syntax error: Encountered "t0" at line 1, column 13.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
Comment 1 Edwin Tang CLA 2009-11-26 14:22:08 EST
It is a limitation of Derby on supporting "SELECT CASE ..."
Comment 2 Edwin Tang CLA 2010-03-22 13:51:20 EDT
Created attachment 162701 [details]
patch file
Comment 3 Edwin Tang CLA 2010-03-22 13:56:48 EDT
The patch checked in 2.0.2 and 2.1.0

Code reviewed by: Yiping Zhao
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:24:40 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink