Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327435

Summary: MaxDB trims trailing spaces of VARCHAR fields
Product: z_Archived Reporter: Sabine Heider <sabine.heider>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: adrian.goerler, andreas.fischbach
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: maxdb
Bug Depends on:    
Bug Blocks: 284657    
Attachments:
Description Flags
skip check for trailling on MaxDB none

Description Sabine Heider CLA 2010-10-11 07:17:45 EDT
When reading VARCHAR fields from the database, MaxDB automatically trims all trailing spaces. This is a limitation of the database that can't be changed.

The bug is opened for documentation purposes only.
Comment 1 Sabine Heider CLA 2010-10-11 07:26:13 EDT
The test

org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships.ExpressionJUnitTestSuite.testRightTrimWithoutTrimChar

fails due to this peculiarity.
Comment 2 Adrian Goerler CLA 2010-10-11 12:39:21 EDT
Created attachment 180610 [details]
skip check for trailling on MaxDB

The test checks that if data with trailing spaces is inserted the trailing spaces can be read again from the database. On MaxDB, this is not possible, as CHAR and VARCHAR data is always implicitly trimmed to the right. 

The proposed patch skips the validation of the trailing spaces on MaxDB.
Comment 3 Adrian Goerler CLA 2010-10-12 16:15:17 EDT
Reviewed by Tom.
Tested on MaxDB.
Checked in at #8352.
Comment 4 Adrian Goerler CLA 2010-10-14 10:19:49 EDT
Noteworthy: 

VARCHAR (n) BYTE columns, whihc correpsonds to the JDBC type VARBINARY, do not preserve trailing 0x00 bytes.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:33:29 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink