Author: bandaram Date: Thu Jun 2 20:02:47 2005 New Revision: 179708 URL: http://svn.apache.org/viewcvs?rev=179708&view=rev Log: Address dblook change missed by previous checkins and update master files. Dblook shouldn't be generating DEFAULT GENERATED_BY_IDENTITY string for identity columns. Also updated master files correctly. Submitted by Satheesh Bandaram(satheesh@sourcery.org) Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dblook_test_net.out incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dblook_test_net.out incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Table.java Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dblook_test_net.out URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dblook_test_net.out?rev=179708&r1=179707&r2=179708&view=diff ============================================================================== --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dblook_test_net.out (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dblook_test_net.out Thu Jun 2 20:02:47 2005 @@ -309,6 +309,36 @@ null null ----- +T3_2 +B +2 +BLOB(20) +null +null + +null +null +----- +T3_2 +ID +3 +INTEGER NOT NULL +GENERATED_BY_DEFAULT + + +2 +4 +----- +T3_2 +P1 +1 +VARCHAR(10) +'okie' + + +null +null +----- T4 I 1 @@ -339,6 +369,36 @@ 1 1 ----- +T4_2 +I +1 +INTEGER +2 + + +null +null +----- +T4_2 +J +2 +INTEGER NOT NULL +null +null + +null +null +----- +T4_2 +K +3 +INTEGER NOT NULL +GENERATED_BY_DEFAULT + + +1 +1 +----- T5 COST 1 @@ -840,6 +900,15 @@ ----- BAR +T3_2 + +T3_2 +false +null +false + +----- +BAR T4 IX4 @@ -858,6 +927,15 @@ ----- BAR +T4_2 + +T4_2 +false +null +false + +----- +BAR T8 @@ -1549,8 +1627,20 @@ BAR R ----- +T3_2 +T3_2 +T +BAR +R +----- T4 T4 +T +BAR +R +----- +T4_2 +T4_2 T BAR R Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dblook_test_net.out URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dblook_test_net.out?rev=179708&r1=179707&r2=179708&view=diff ============================================================================== --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dblook_test_net.out (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dblook_test_net.out Thu Jun 2 20:02:47 2005 @@ -309,6 +309,36 @@ null null ----- +T3_2 +B +2 +BLOB(20) +null +null + +null +null +----- +T3_2 +ID +3 +INTEGER NOT NULL +GENERATED_BY_DEFAULT + + +2 +4 +----- +T3_2 +P1 +1 +VARCHAR(10) +'okie' + + +null +null +----- T4 I 1 @@ -339,6 +369,36 @@ 1 1 ----- +T4_2 +I +1 +INTEGER +2 + + +null +null +----- +T4_2 +J +2 +INTEGER NOT NULL +null +null + +null +null +----- +T4_2 +K +3 +INTEGER NOT NULL +GENERATED_BY_DEFAULT + + +1 +1 +----- T5 COST 1 @@ -840,6 +900,15 @@ ----- BAR +T3_2 + +T3_2 +false +null +false + +----- +BAR T4 IX4 @@ -858,6 +927,15 @@ ----- BAR +T4_2 + +T4_2 +false +null +false + +----- +BAR T8 @@ -1549,8 +1627,20 @@ BAR R ----- +T3_2 +T3_2 +T +BAR +R +----- T4 T4 +T +BAR +R +----- +T4_2 +T4_2 T BAR R Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out?rev=179708&r1=179707&r2=179708&view=diff ============================================================================== --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out Thu Jun 2 20:02:47 2005 @@ -316,7 +316,7 @@ ID 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 2 @@ -386,7 +386,7 @@ K 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 1 @@ -2192,7 +2192,7 @@ ID 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 2 @@ -2262,7 +2262,7 @@ K 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 1 @@ -3853,7 +3853,7 @@ ID 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 2 @@ -3923,7 +3923,7 @@ K 3 INTEGER NOT NULL -null +GENERATED_BY_DEFAULT 1 Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Table.java URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Table.java?rev=179708&r1=179707&r2=179708&view=diff ============================================================================== --- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Table.java (original) +++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Table.java Thu Jun 2 20:02:47 2005 @@ -146,11 +146,11 @@ dblook.stripQuotes(colName)))); colDef.append(" "); colDef.append(rs.getString(1)); - if (rs.getString(2) != null) { + if (!reinstateAutoIncrement(colName, tableId, colDef) && + rs.getString(2) != null) { colDef.append(" DEFAULT "); colDef.append(rs.getString(2)); } - reinstateAutoIncrement(colName, tableId, colDef); } rs.close(); @@ -159,15 +159,15 @@ } /* ************************************************ - * Generate autoincrement DDL for a given column. + * Generate autoincrement DDL for a given column and write it to + * received StringBuffer * @param colName: Name of column that is autoincrement. * @param tableId: Id of table in which column exists. * @param colDef: StringBuffer to which DDL will be added. - * @return The DDL for all autoincrement columns - * has been written to the received string buffer. + * @return True if autoincrement DDL has been generated. ****/ - public static void reinstateAutoIncrement(String colName, + public static boolean reinstateAutoIncrement(String colName, String tableId, StringBuffer colDef) throws SQLException { @@ -186,10 +186,11 @@ colDef.append(", INCREMENT BY "); colDef.append(autoIncCols.getLong(2)); colDef.append(")"); + return true; } } - return; + return false; }