Community
Participate
Working Groups
Hi, we plan to contribute a database definition for MySQL/SAP MaxDB. This database requires a predefined datatype definitions with the length infixed, like VARCHAR(<length>) UNICODE In DDL-Generation, we would like to use the display-name mechanism to get the length parameter into the type name: <predefinedDataTypeDefinitions xmi:id="CHARACTER_VARYING_1" lengthSupported="true" keyConstraintSupported="true" multipleColumnsSupported="true" maximumLength="4000" primitiveType="CHARACTER_VARYING" jdbcEnumType="12" javaClassName="java.lang.String" defaultLength="1" displayName="VARCHAR({0}) UNICODE" displayNameSupported="true"> <defaultValueTypes>NULL</defaultValueTypes> <defaultValueTypes>LITERAL</defaultValueTypes> <name>VARCHAR() UNICODE</name> <name>VARCHAR</name> </predefinedDataTypeDefinitions> The method org.eclipse.datatools.connectivity.sqm.internal.core.definition.DatabaseDefinitionImpl.getPredefinedDataTypeFormattedName(PredefinedDataType) ignores the displayName for the predifined types CHARACTER and CHRACTER_VARYING.
Created attachment 74045 [details] proposed patch This patch fixes the issue for CHARACTER and CHARACTER_VARYING and solves the issue for MaxDB.
Delivered fix to 1.5.1 and head streams.
In the code of DatabaseDefinitionImpl the bug fix was applied in the function getPredefinedDataTypeFormattedName for PrimitiveType.CHARACTER_VARYING but not for PrimitiveType.CHARACTER. The SQL for column with type char is still generated with the wrong syntax. CREATE TABLE CITY ( ZIP CHAR() ASCII(5) NOT NULL, NAME CHAR() ASCII(30) NOT NULL, STATE VARCHAR(2) ASCII NOT NULL )
Wolfgang, does this need to be fixed in the 1.5 stream as well as 1.6 or can we just focus on 1.6?
As the intial MaxDB contribution is done for DTP 1.6 I think it is sufficient to focus on DTP 1.6.
Created attachment 90204 [details] Additional fix for CHARACTER type Hey Wolfgang, can you try this patch to see if it fixes the issue?
Updating the target milestone to 1.6 M6
Wolfgang was nice enough to verify the fix for me. Delivered today to the 1.6 stream.
Closing bugs