Bug 261666 - ReportQueryAndExistsSubQuery: ReportQuery and exists subQuery failed on Sybase
Summary: ReportQueryAndExistsSubQuery: ReportQuery and exists subQuery failed on Sybase
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
: 240014 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-20 11:24 EST by Edwin Tang CLA
Modified: 2022-06-09 10:22 EDT (History)
3 users (show)

See Also:


Attachments
test case fix (1010 bytes, patch)
2010-08-09 15:38 EDT, Chris Delahunt 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-01-20 11:24:56 EST
ReportQueryAndExistsSubQuery: ReportQuery and exists subQuery failed on Sybase

Exception:
==========
Internal Exception: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near ','. Error Code: 102 Call: SELECT t0.EMP_ID, t1.EMP_ID, t0.F_NAME, t0.L_NAME, t1.SALARY, t0.GENDER, t0.START_TIME, t0.END_TIME, t0.END_DATE, t0.START_DATE, t0.ADDR_ID, t0.MANAGER_ID, t0.VERSION FROM EMPLOYEE t0, SALARY t1 WHERE (EXISTS (SELECT DISTINCT t2.TYPE, t2.AREA_CODE, t2.P_NUMBER, t2.EMP_ID FROM SALARY t4, EMPLOYEE t3, PHONE t2 WHERE ((t4.EMP_ID = t3.EMP_ID) AND (t2.EMP_ID = t3.EMP_ID))) AND (t1.EMP_ID = t0.EMP_ID)) Query: ReportQuery(referenceClass=Employee sql="SELECT t0.EMP_ID, t1.EMP_ID, t0.F_NAME, t0.L_NAME, t1.SALARY, t0.GENDER, t0.START_TIME, t0.END_TIME, t0.END_DATE, t0.START_DATE, t0.ADDR_ID, t0.MANAGER_ID, t0.VERSION FROM EMPLOYEE t0, SALARY t1 WHERE (EXISTS (SELECT DISTINCT t2.TYPE, t2.AREA_CODE, t2.P_NUMBER, t2.EMP_ID FROM SALARY t4, EMPLOYEE t3, PHONE t2 WHERE ((t4.EMP_ID = t3.EMP_ID) AND (t2.EMP_ID = t3.EMP_ID))) AND (t1.EMP_ID = t0.EMP_ID))")

Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.1.0.20090115-SNAPSHOT): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near ','.

Error Code: 102
Call: SELECT t0.EMP_ID, t1.EMP_ID, t0.F_NAME, t0.L_NAME, t1.SALARY, t0.GENDER, t0.START_TIME, t0.END_TIME, t0.END_DATE, t0.START_DATE, t0.ADDR_ID, t0.MANAGER_ID, t0.VERSION FROM EMPLOYEE t0, SALARY t1 WHERE (EXISTS (SELECT DISTINCT t2.TYPE, t2.AREA_CODE, t2.P_NUMBER, t2.EMP_ID FROM SALARY t4, EMPLOYEE t3, PHONE t2 WHERE ((t4.EMP_ID = t3.EMP_ID) AND (t2.EMP_ID = t3.EMP_ID))) AND (t1.EMP_ID = t0.EMP_ID))
Query: ReportQuery(referenceClass=Employee sql="SELECT t0.EMP_ID, t1.EMP_ID, t0.F_NAME, t0.L_NAME, t1.SALARY, t0.GENDER, t0.START_TIME, t0.END_TIME, t0.END_DATE, t0.START_DATE, t0.ADDR_ID, t0.MANAGER_ID, t0.VERSION FROM EMPLOYEE t0, SALARY t1 WHERE (EXISTS (SELECT DISTINCT t2.TYPE, t2.AREA_CODE, t2.P_NUMBER, t2.EMP_ID FROM SALARY t4, EMPLOYEE t3, PHONE t2 WHERE ((t4.EMP_ID = t3.EMP_ID) AND (t2.EMP_ID = t3.EMP_ID))) AND (t1.EMP_ID = t0.EMP_ID))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:322)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:656)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:501)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:872)
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:599)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2512)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2457)
at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:835)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:664)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:891)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:457)
at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2243)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1165)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1125)
at org.eclipse.persistence.testing.tests.queries.report.ReportQueryTestCase.test(ReportQueryTestCase.java:93)
at org.eclipse.persistence.testing.framework.TestCase.executeTest(TestCase.java:543)
at org.eclipse.persistence.testing.framework.TestCase.execute(TestCase.java:154)
at org.eclipse.persistence.testing.framework.TestCase.runBare(TestCase.java:263)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestSuite.execute(TestSuite.java:75)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near ','.

at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:856)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:573)
Comment 1 Peter Krogh CLA 2009-11-27 13:42:12 EST
This bug fix did not make the cut off for 2.0.0. We are deferring the bugs to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases.
Comment 2 Peter Krogh CLA 2009-11-30 11:38:37 EST
Changing the priority of the bugs that have been recently triaged to future.  Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
Comment 3 Peter Krogh CLA 2010-06-04 14:39:16 EDT
2.1 Bug scrubbing, deferring to 2.1.1.
Comment 4 Chris Delahunt CLA 2010-07-29 16:15:12 EDT
investigating
Comment 5 Chris Delahunt CLA 2010-08-09 15:38:26 EDT
Created attachment 176182 [details]
test case fix

test cannot be run on Sybase as it does not support using a subquery to return multiple values within Exists.  Fix is to add a warning when run on the Sybase platform adding, much like it does when run against Derby.
Comment 6 Chris Delahunt CLA 2010-08-09 15:46:01 EDT
Test case change checked into main and 2.1.1
Comment 7 Chris Delahunt CLA 2010-08-17 14:16:44 EDT
*** Bug 240014 has been marked as a duplicate of this bug. ***
Comment 8 Eclipse Webmaster CLA 2022-06-09 10:22:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink