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

Bug 344232

Summary: [DB] CDODBSchema uses "size" as an column name which is a keyword
Product: [Modeling] EMF Reporter: Erdal Karaca <erdal.karaca.de>
Component: cdo.dbAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: ales_d, robert.blust, sraul.martins, stepper
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: Lighter, Faster and Better
Bug Depends on: 306356    
Bug Blocks:    

Description Erdal Karaca CLA 2011-04-29 01:24:58 EDT
The Oracle DB complains about "size" being an improper identifier.
Maybe, we could add a suffix to it such as "size0" as is done for other auto generated tables?
Comment 1 Eike Stepper CLA 2011-06-23 03:58:45 EDT
Moving all open enhancement requests to 4.1
Comment 2 Eike Stepper CLA 2012-08-14 22:57:22 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 3 Eike Stepper CLA 2012-11-02 01:02:43 EDT
SQL is horrible. The standard says: ALTER TABLE table RENAME COLUMN c1 TO c2

But H2 needs this: ALTER TABLE table ALTER COLUMN c1 RENAME TO c2

They call it a standard :P
Comment 4 Eike Stepper CLA 2012-11-02 01:05:02 EDT
Not only I have renamed the pathological column now, I also made use of the new schema migration mechanism to automatically migrate existing schemas at startup time.

commit 6829e30820fc03fa7cc612fc86a69a7c92b9b1f3
Comment 5 Eike Stepper CLA 2012-11-02 01:06:19 EDT
*** Bug 369610 has been marked as a duplicate of this bug. ***
Comment 6 Eike Stepper CLA 2012-11-02 02:56:26 EDT
Fixed missing @since tag:

commit 2431bdb88273418bca0fcff4f7e4a8600e901213
Comment 7 Eike Stepper CLA 2012-11-02 04:39:44 EDT
Schema version 0 is not migrated:

commit 625c2b6e8de8af0d6781a1085e430ae99bd3039a
Comment 8 Eike Stepper CLA 2012-11-03 14:08:43 EDT
Issues with Mysql...
Comment 9 Eike Stepper CLA 2012-11-05 11:10:34 EST
How odd! Mysql requires the entire column definition to be repeat just to rename the column:

  @Override
  public String sqlRenameField(IDBField field, String oldName)
  {
    return "ALTER TABLE " + field.getTable() + " CHANGE COLUMN " + oldName + " TO " + field + " "
        + createFieldDefinition(field);
  }

I had to change the rename column signature in IDBAdapter:
commit 6640fdff6f3acb45be63ce5749d23a76c42079a7
Comment 10 Eike Stepper CLA 2012-11-05 11:10:57 EST
Please, can someone with Mysql test and report?
Comment 11 Eike Stepper CLA 2013-06-27 03:32:46 EDT
Available in R20130613-1157 (4.2)