Bug 196955 - displayName not supported in CHARACTER and CHRACTER_VARYING
Summary: displayName not supported in CHARACTER and CHRACTER_VARYING
Status: CLOSED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: DDL Generation (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6M6   Edit
Assignee: Brian Fitzpatrick CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-07-18 09:17 EDT by Adrian Goerler CLA
Modified: 2008-07-01 17:39 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (3.45 KB, patch)
2007-07-18 09:20 EDT, Adrian Goerler CLA
no flags Details | Diff
Additional fix for CHARACTER type (2.03 KB, patch)
2008-02-20 12:04 EST, Brian Fitzpatrick CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Goerler CLA 2007-07-18 09:17:01 EDT
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.
Comment 1 Adrian Goerler CLA 2007-07-18 09:20:28 EDT
Created attachment 74045 [details]
proposed patch

This patch fixes the issue for CHARACTER and CHARACTER_VARYING and solves the issue for MaxDB.
Comment 2 Brian Fitzpatrick CLA 2007-08-07 15:10:08 EDT
Delivered fix to 1.5.1 and head streams.
Comment 3 Wolfgang Auer CLA 2008-02-15 03:42:59 EST
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
 )
Comment 4 Brian Fitzpatrick CLA 2008-02-19 12:02:29 EST
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?
Comment 5 Wolfgang Auer CLA 2008-02-20 04:12:58 EST
As the intial MaxDB contribution is done for DTP 1.6 I think it is sufficient to focus on DTP 1.6.
Comment 6 Brian Fitzpatrick CLA 2008-02-20 12:04:35 EST
Created attachment 90204 [details]
Additional fix for CHARACTER type

Hey Wolfgang, can you try this patch to see if it fixes the issue?
Comment 7 Brian Fitzpatrick CLA 2008-02-21 11:26:10 EST
Updating the target milestone to 1.6 M6 
Comment 8 Brian Fitzpatrick CLA 2008-02-22 10:27:30 EST
Wolfgang was nice enough to verify the fix for me. Delivered today to the 1.6 stream. 
Comment 9 Brian Fitzpatrick CLA 2008-07-01 17:39:37 EDT
Closing bugs