Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 26532 invoked from network); 14 Apr 2010 18:03:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Apr 2010 18:03:12 -0000 Received: (qmail 93004 invoked by uid 500); 14 Apr 2010 18:03:12 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 92981 invoked by uid 500); 14 Apr 2010 18:03:12 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 92973 invoked by uid 99); 14 Apr 2010 18:03:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 18:03:12 +0000 X-ASF-Spam-Status: No, hits=-1287.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 18:03:11 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3EI2oXb008474 for ; Wed, 14 Apr 2010 14:02:51 -0400 (EDT) Message-ID: <20854589.120551271268170805.JavaMail.jira@thor> Date: Wed, 14 Apr 2010 14:02:50 -0400 (EDT) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1615) CriteriaQuery test failures on MSSQL In-Reply-To: <1491196321.50101270668153562.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856997#action_12856997 ] Pinaki Poddar commented on OPENJPA-1615: ---------------------------------------- TestTypesafeCriteria.testFunctionWithTwoArgument() is invalid for SQLServer because CriteriaQuery function() method should refer to a valid database function and MOD() is not a valid function for SQLServer. > CriteriaQuery test failures on MSSQL > ------------------------------------ > > Key: OPENJPA-1615 > URL: https://issues.apache.org/jira/browse/OPENJPA-1615 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Affects Versions: 2.0.0-beta3 > Reporter: Donald Woods > Fix For: 2.0.1, 2.1.0 > > Attachments: OPENJPA-1615-trunk-skiptests.patch > > > Seeing 2 different testcase failures in TestTypesafeCriteria for MSSQL: > 1) MSSQL doesn't support the MOD() function syntax but expects "%" instead, which is set in the SQLServerDictionary as "supportsModOperator = true", but CriteriaBuilderImpl and Expressions is ignoring this option when generating the JPQL, so the testFunctionWithTwoArgument() and testFunctionWithFunctionArgumentInOrderBy() tests fail - > junit.framework.AssertionFailedError: CriteriaQuery corresponding to SELECT MOD(c.balanceOwed,10) FROM Customer c failed to execute > java.lang.RuntimeException: SELECT MOD(t0.balanceOwed, ?) FROM CR_CUST t0 > at org.apache.openjpa.persistence.criteria.AbstractCriteriaTestCase.executeQueryAndCollectSQL(AbstractCriteriaTestCase.java:314) > at org.apache.openjpa.persistence.criteria.AbstractCriteriaTestCase.executeAndCompareSQL(AbstractCriteriaTestCase.java:164) > at org.apache.openjpa.persistence.criteria.AbstractCriteriaTestCase.assertEquivalence(AbstractCriteriaTestCase.java:141) > at org.apache.openjpa.persistence.criteria.AbstractCriteriaTestCase.assertEquivalence(AbstractCriteriaTestCase.java:108) > at org.apache.openjpa.persistence.criteria.TestTypesafeCriteria.testFunctionWithTwoArgument(TestTypesafeCriteria.java:908) > . . . > Caused by: org.apache.openjpa.persistence.PersistenceException: 'MOD' is not a recognized built-in function name. {prepstmnt 3164468 SELECT MOD(t0.balanceOwed, ?) FROM CR_CUST t0 [params=(int) 10]} [code=195, state=S00010] > . . . > Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: 'MOD' is not a recognized built-in function name. {prepstmnt 3164468 SELECT MOD(t0.balanceOwed, ?) FROM CR_CUST t0 [params=(int) 10]} [code=195, state=S00010] > 2) There is a NVARCHAR to BigDecimal conversion failure in testBigDecimalConversion()- > org.apache.openjpa.persistence.PersistenceException: Error converting data type nvarchar to decimal. {prepstmnt 17141330 SELECT (t0.accountNum * ?) FROM CR_CUST t0 WHERE (t0.id = ?) [params=(BigDecimal) 10.3259699999999998709654391859658062458038330078125, (long) 301]} [code=8114, state=S0005] > . . . > Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Error converting data type nvarchar to decimal. {prepstmnt 17141330 SELECT (t0.accountNum * ?) FROM CR_CUST t0 WHERE (t0.id = ?) [params=(BigDecimal) 10.3259699999999998709654391859658062458038330078125, (long) 301]} [code=8114, state=S0005] > . . . > NestedThrowables: > com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type nvarchar to decimal. > at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira