Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 911280

Summary: [HHH-8007] PagingAndLockingTest fails on all mssql databases due to SQLServerException from Incorrect query syntax
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Madhumita Sadhukhan <msadhukh>
Component: HibernateAssignee: Brett Meyer <brmeyer>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: msimka, pslavice, rsvoboda, theute, zroubali
Target Milestone: ER3   
Target Release: EAP 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-23 18:34:55 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:

Description Madhumita Sadhukhan 2013-02-14 16:12:25 UTC
Description of problem:
PagingAndLockingTest fails on all mssql databases due to SQLServerException from Incorrect query syntax

failing query:
11:50:23,955 DEBUG SQL:104 - WITH query AS (SELECT inner_query.*, ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __hibernate_row_nr__ FROM ( select * as page0_ from door ) inner_query ) SELECT page0_ FROM query WHERE __hibernate_row_nr__ >= ? AND __hibernate_row_nr__ < ?
11:50:23,956  WARN SqlExceptionHelper:143 - SQL Error: 156, SQLState: S0001
11:50:23,956 ERROR SqlExceptionHelper:144 - Incorrect syntax near the keyword 'as'.

Stacktrace:
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122)
............................................................................
............................................................................
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'as'.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)



Version-Release number of selected component (if applicable):

EAP 6.1.0.DR4

Comment 1 Brett Meyer 2013-02-14 20:33:21 UTC
https://hibernate.onjira.com/browse/HHH-8007

Comment 2 Brett Meyer 2013-02-15 15:32:00 UTC
Completed upstream and in prod eap61-cp branch

Comment 4 Martin Simka 2013-03-28 16:49:23 UTC
verified 6.1.0.ER3