Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335707 - TRIM() no longer works on SQL Server
Summary: TRIM() no longer works on SQL Server
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 12:20 EST by Mitesh Meswani CLA
Modified: 2022-06-09 10:10 EDT (History)
3 users (show)

See Also:


Attachments
Suggested patch. (6.92 KB, patch)
2011-01-28 15:46 EST, Andrei Ilitchev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mitesh Meswani CLA 2011-01-28 12:20:03 EST
SQL Server does not offer TRIM. EclipseLink had a work around in place to use RTRIM(LTRIM() ) instead. A change in https://fisheye2.atlassian.com/changelog/eclipselink/?cs=6761 has removed the work around. This results in JPQL TRIM() not working against SQL Server
Comment 1 Andrei Ilitchev CLA 2011-01-28 15:46:14 EST
Created attachment 187877 [details]
Suggested patch.

Rolled back the code to use leftTrim(rightTrim, again.
Also fixes in JUnitJPQLComplexTestSuite:
  introduced supportsStoredFunction method so that setup passes on SQLServer (which doesn't support stored functions);
  updated variableReferencedOnlyInParameterTest so that it now passes on SQLServer. That's done by excluding the qpql strings known not been supported by the db platform. For SQLSerfver those are:
"SELECT TRIM(LEADING 'A' FROM e.firstName) FROM Employee e"
and
"SELECT TRIM(TRAILING 'A' FROM e.firstName) FROM Employee e"
Comment 2 Andrei Ilitchev CLA 2011-01-28 16:00:11 EST
Fixed in trunk rev.8902 and 2.2 revision: 8903
Comment 3 David Minsky CLA 2011-07-13 16:24:00 EDT
Checked into 2.1 trunk at revision: 9722
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:10:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink