db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r406075 - in /db/ddlutils/trunk/src: java/org/apache/ddlutils/ java/org/apache/ddlutils/platform/ java/org/apache/ddlutils/platform/mckoi/ test/org/apache/ddlutils/ test/org/apache/ddlutils/dynabean/ test/org/apache/ddlutils/io/ test/org/ap...
Date Sat, 13 May 2006 10:50:01 GMT
Author: tomdz
Date: Sat May 13 03:49:59 2006
New Revision: 406075

URL: http://svn.apache.org/viewcvs?rev=406075&view=rev
Log:
Fixed tests
Enhanced alteration for McKoi

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/RunAllTests.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/TestPlatformBase.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestDerbyPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestInterbasePlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMaxDbPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMcKoiPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSapDbPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSybasePlatform.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java Sat May 13 03:49:59 2006
@@ -55,7 +55,7 @@
     private boolean _embeddedForeignKeysNamed = false;
 
     /** Whether non-unique indices are supported. */
-    private boolean _nonUniqueIndicesSupported = true;
+    private boolean _indicesSupported = true;
 
     /** Whether indices are embedded inside the create table statement. */
     private boolean _indicesEmbedded = false;
@@ -262,24 +262,23 @@
     }
 
     /**
-     * Determines whether non-unique indices are supported.
+     * Determines whether indices are supported.
      *
-     * @return <code>true</code> if non-unique indices are supported
+     * @return <code>true</code> if indices are supported
      */
-    public boolean isNonUniqueIndicesSupported()
+    public boolean isIndicesSupported()
     {
-        return _nonUniqueIndicesSupported;
+        return _indicesSupported;
     }
 
     /**
-     * Specifies whether non-unique indices are supported.
+     * Specifies whether indices are supported.
      *
-     * @param supportingNonUniqueIndices <code>true</code> if non-unique indices
-     *                                   are supported
+     * @param supportingIndices <code>true</code> if indices are supported
      */
-    public void setNonUniqueIndicesSupported(boolean supportingNonUniqueIndices)
+    public void setIndicesSupported(boolean supportingIndices)
     {
-        _nonUniqueIndicesSupported = supportingNonUniqueIndices;
+        _indicesSupported = supportingIndices;
     }
 
     /**

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java Sat May 13 03:49:59
2006
@@ -2399,7 +2399,7 @@
         {
             Index index = table.getIndex(idx);
 
-            if (!index.isUnique() && !getPlatformInfo().isNonUniqueIndicesSupported())
+            if (!index.isUnique() && !getPlatformInfo().isIndicesSupported())
             {
                 throw new DynaSqlException("Platform does not support non-unique indices");
             }
@@ -2414,16 +2414,13 @@
      */
     protected void writeEmbeddedIndicesStmt(Table table) throws IOException 
     {
-        for (int idx = 0; idx < table.getIndexCount(); idx++)
+        if (getPlatformInfo().isIndicesSupported())
         {
-            Index index = table.getIndex(idx);
-
-            if (!index.isUnique() && !getPlatformInfo().isNonUniqueIndicesSupported())
+            for (int idx = 0; idx < table.getIndexCount(); idx++)
             {
-                throw new DynaSqlException("Platform does not support non-unique indices");
+                printStartOfEmbeddedStatement();
+                writeEmbeddedIndexCreateStmt(table, table.getIndex(idx));
             }
-            printStartOfEmbeddedStatement();
-            writeEmbeddedIndexCreateStmt(table, index);
         }
     }
 
@@ -2435,42 +2432,45 @@
      */
     protected void writeExternalIndexCreateStmt(Table table, Index index) throws IOException
     {
-        if (index.getName() == null)
-        {
-            _log.warn("Cannot write unnamed index " + index);
-        }
-        else
+        if (getPlatformInfo().isIndicesSupported())
         {
-            print("CREATE");
-            if (index.isUnique())
+            if (index.getName() == null)
             {
-                print(" UNIQUE");
+                _log.warn("Cannot write unnamed index " + index);
             }
-            print(" INDEX ");
-            printIdentifier(getIndexName(index));
-            print(" ON ");
-            printIdentifier(getTableName(table));
-            print(" (");
-
-            for (int idx = 0; idx < index.getColumnCount(); idx++)
+            else
             {
-                IndexColumn idxColumn = index.getColumn(idx);
-                Column      col       = table.findColumn(idxColumn.getName());
-
-                if (col == null)
+                print("CREATE");
+                if (index.isUnique())
                 {
-                    //would get null pointer on next line anyway, so throw exception
-                    throw new DynaSqlException("Invalid column '" + idxColumn.getName() +
"' on index " + index.getName() + " for table " + table.getName());
+                    print(" UNIQUE");
                 }
-                if (idx > 0)
+                print(" INDEX ");
+                printIdentifier(getIndexName(index));
+                print(" ON ");
+                printIdentifier(getTableName(table));
+                print(" (");
+    
+                for (int idx = 0; idx < index.getColumnCount(); idx++)
                 {
-                    print(", ");
+                    IndexColumn idxColumn = index.getColumn(idx);
+                    Column      col       = table.findColumn(idxColumn.getName());
+    
+                    if (col == null)
+                    {
+                        // would get null pointer on next line anyway, so throw exception
+                        throw new DynaSqlException("Invalid column '" + idxColumn.getName()
+ "' on index " + index.getName() + " for table " + table.getName());
+                    }
+                    if (idx > 0)
+                    {
+                        print(", ");
+                    }
+                    printIdentifier(getColumnName(col));
                 }
-                printIdentifier(getColumnName(col));
+    
+                print(")");
+                printEndOfStatement();
             }
-
-            print(")");
-            printEndOfStatement();
         }
     }
 

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java Sat May
13 03:49:59 2006
@@ -17,9 +17,12 @@
  */
 
 import java.io.IOException;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.ddlutils.Platform;
 import org.apache.ddlutils.model.Column;
+import org.apache.ddlutils.model.Database;
 import org.apache.ddlutils.model.Table;
 import org.apache.ddlutils.platform.SqlBuilder;
 
@@ -66,11 +69,27 @@
             // we start at value 1 to avoid issues with jdbc
             print("UNIQUEKEY('");
             print(getTableName(table));
-            print("') + 1");
+            print("')");
         }
         else
         {
             super.writeColumnDefaultValue(table, column);
         }
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void processTableStructureChanges(Database currentModel,
+                                                Database desiredModel,
+                                                Table    sourceTable,
+                                                Table    targetTable,
+                                                Map      parameters,
+                                                List     changes) throws IOException
+    {
+        // McKoi has this nice ALTER CREATE TABLE statement which saves us a lot of work
+        print("ALTER ");
+        createTable(desiredModel, targetTable, parameters);
+    }
+
 }

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiPlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiPlatform.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mckoi/MckoiPlatform.java Sat May
13 03:49:59 2006
@@ -52,7 +52,7 @@
         info.setNullAsDefaultValueRequired(false);
         info.setPrimaryKeyEmbedded(true);
         info.setForeignKeysEmbedded(false);
-        info.setNonUniqueIndicesSupported(false);
+        info.setIndicesSupported(false);
         info.setIndicesEmbedded(true);
         info.setDefaultValueUsedForIdentitySpec(true);
 

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/RunAllTests.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/RunAllTests.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/RunAllTests.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/RunAllTests.java Sat May 13 03:49:59 2006
@@ -16,6 +16,15 @@
  * limitations under the License.
  */
 
+import org.apache.ddlutils.alteration.TestAlterationAlgorithm;
+import org.apache.ddlutils.alteration.TestModelComparator;
+import org.apache.ddlutils.dynabean.TestDynaSqlQueries;
+import org.apache.ddlutils.io.TestAlteration;
+import org.apache.ddlutils.io.TestConstraints;
+import org.apache.ddlutils.io.TestDataReader;
+import org.apache.ddlutils.io.TestDatabaseIO;
+import org.apache.ddlutils.io.TestDatatypes;
+import org.apache.ddlutils.model.TestArrayAccessAtTable;
 import org.apache.ddlutils.platform.TestAxionPlatform;
 import org.apache.ddlutils.platform.TestCloudscapePlatform;
 import org.apache.ddlutils.platform.TestDB2Platform;
@@ -26,6 +35,7 @@
 import org.apache.ddlutils.platform.TestMSSqlPlatform;
 import org.apache.ddlutils.platform.TestMaxDbPlatform;
 import org.apache.ddlutils.platform.TestMcKoiPlatform;
+import org.apache.ddlutils.platform.TestMySql50Platform;
 import org.apache.ddlutils.platform.TestMySqlPlatform;
 import org.apache.ddlutils.platform.TestOracle8Platform;
 import org.apache.ddlutils.platform.TestOracle9Platform;
@@ -75,7 +85,12 @@
     {
         TestSuite suite = new TestSuite("Ddlutils tests");
 
+        // tests that don't need a live database
+        suite.addTestSuite(TestArrayAccessAtTable.class);
+        suite.addTestSuite(SqlBuilderTest.class);
         suite.addTestSuite(TestPlatformUtils.class);
+        suite.addTestSuite(TestDatabaseIO.class);
+        suite.addTestSuite(TestDataReader.class);
         suite.addTestSuite(TestAxionPlatform.class);
         suite.addTestSuite(TestCloudscapePlatform.class);
         suite.addTestSuite(TestDB2Platform.class);
@@ -87,12 +102,24 @@
         suite.addTestSuite(TestMcKoiPlatform.class);
         suite.addTestSuite(TestMSSqlPlatform.class);
         suite.addTestSuite(TestMySqlPlatform.class);
+        suite.addTestSuite(TestMySql50Platform.class);
         suite.addTestSuite(TestOracle8Platform.class);
         suite.addTestSuite(TestOracle9Platform.class);
         suite.addTestSuite(TestPostgresqlPlatform.class);
         suite.addTestSuite(TestSapDbPlatform.class);
         suite.addTestSuite(TestSybasePlatform.class);
-        
+        suite.addTestSuite(TestModelComparator.class);
+        suite.addTestSuite(TestAlterationAlgorithm.class);
+
+        // tests that need a live database
+        if (System.getProperty(TestDatabaseWriterBase.JDBC_PROPERTIES_PROPERTY) != null)
+        {
+            suite.addTestSuite(TestDynaSqlQueries.class);
+            suite.addTestSuite(TestDatatypes.class);
+            suite.addTestSuite(TestConstraints.class);
+            suite.addTestSuite(TestAlteration.class);
+        }
+
         return suite;
     }
 }

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/TestPlatformBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/TestPlatformBase.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/TestPlatformBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/TestPlatformBase.java Sat May 13 03:49:59
2006
@@ -133,6 +133,10 @@
         _writer   = new StringWriter();
         _platform = PlatformFactory.createNewPlatformInstance(getDatabaseName());
         _platform.getSqlBuilder().setWriter(_writer);
+        if (_platform.getPlatformInfo().isDelimitedIdentifiersSupported())
+        {
+            _platform.setDelimitedIdentifierModeOn(true);
+        }
     }
 
     /**

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java Sat May
13 03:49:59 2006
@@ -150,8 +150,8 @@
             "    <column name='Id2' type='INTEGER'/>\n"+
             "  </table>\n"+
             "  <table name='TestTable2'>\n"+
-            "    <column name='Id'   type='INTEGER' primaryKey='true'/>\n"+
-            "    <column name='Text' type='VARCHAR' size='15'/>\n"+
+            "    <column name='Id' type='INTEGER' primaryKey='true'/>\n"+
+            "    <column name='Avalue' type='VARCHAR' size='15'/>\n"+
             "  </table>\n"+
             "</database>");
 
@@ -160,12 +160,12 @@
             "<data>\n"+
             "  <TestTable1 Id1='1'/>\n"+
             "  <TestTable1 Id1='2' Id2='3'/>\n"+
-            "  <TestTable2 Id='1' Text='Text 1'/>\n"+
-            "  <TestTable2 Id='2' Text='Text 2'/>\n"+
-            "  <TestTable2 Id='3' Text='Text 3'/>"+
+            "  <TestTable2 Id='1' Avalue='Text 1'/>\n"+
+            "  <TestTable2 Id='2' Avalue='Text 2'/>\n"+
+            "  <TestTable2 Id='3' Avalue='Text 3'/>"+
             "</data>");
 
-        ModelBasedResultSetIterator it   = (ModelBasedResultSetIterator)getPlatform().query(getModel(),
"SELECT Id1, Text FROM TestTable1, TestTable2 WHERE Id2 = Id");
+        ModelBasedResultSetIterator it   = (ModelBasedResultSetIterator)getPlatform().query(getModel(),
"SELECT Id1, Avalue FROM TestTable1, TestTable2 WHERE Id2 = Id");
         DynaBean        bean = null;
 
         assertTrue(it.hasNext());
@@ -175,7 +175,7 @@
         assertEquals(new Integer(2),
                      getPropertyValue(bean, "Id1"));
         assertEquals("Text 3",
-                     getPropertyValue(bean, "Text"));
+                     getPropertyValue(bean, "Avalue"));
 
         assertFalse(it.hasNext());
         assertFalse(it.isConnectionOpen());

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java Sat May 13 03:49:59
2006
@@ -809,6 +809,11 @@
      */
     public void testAddIndex()
     {
+        if (!getPlatformInfo().isIndicesSupported())
+        {
+            return;
+        }
+
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
@@ -852,6 +857,11 @@
      */
     public void testAddUniqueIndex()
     {
+        if (!getPlatformInfo().isIndicesSupported())
+        {
+            return;
+        }
+
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
@@ -934,6 +944,11 @@
      */
     public void testAddColumnToIndex()
     {
+        if (!getPlatformInfo().isIndicesSupported())
+        {
+            return;
+        }
+
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
@@ -980,6 +995,11 @@
      */
     public void testRemoveColumnFromUniqueIndex()
     {
+        if (!getPlatformInfo().isIndicesSupported())
+        {
+            return;
+        }
+
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java Sat May 13 03:49:59
2006
@@ -256,7 +256,7 @@
      */
     public void testIndex()
     {
-        if (getPlatformInfo().isNonUniqueIndicesSupported())
+        if (getPlatformInfo().isIndicesSupported())
         {
             performConstraintsTest(TEST_INDEX_MODEL, true);
         }
@@ -267,7 +267,10 @@
      */
     public void testUniqueIndex()
     {
-        performConstraintsTest(TEST_UNIQUE_INDEX_MODEL, true);
+        if (getPlatformInfo().isIndicesSupported())
+        {
+            performConstraintsTest(TEST_UNIQUE_INDEX_MODEL, true);
+        }
     }
 
     /**
@@ -275,7 +278,7 @@
      */
     public void testPrimaryKeyIndex()
     {
-        if (getPlatformInfo().isNonUniqueIndicesSupported())
+        if (getPlatformInfo().isIndicesSupported())
         {
             performConstraintsTest(TEST_PRIMARY_KEY_INDEX_MODEL, true);
         }

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestDerbyPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestDerbyPlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestDerbyPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestDerbyPlatform.java Sat May
13 03:49:59 2006
@@ -67,8 +67,8 @@
             "    \"COL_DECIMAL\"         DECIMAL(15,3),\n"+
             "    \"COL_DECIMAL_NOSCALE\" DECIMAL(15,0),\n"+
             "    \"COL_DISTINCT\"        BLOB,\n"+
-            "    \"COL_DOUBLE\"          DOUBLE PRECISION,\n"+
-            "    \"COL_FLOAT\"           DOUBLE PRECISION,\n"+
+            "    \"COL_DOUBLE\"          DOUBLE,\n"+
+            "    \"COL_FLOAT\"           DOUBLE,\n"+
             "    \"COL_INTEGER\"         INTEGER,\n"+
             "    \"COL_JAVA_OBJECT\"     BLOB,\n"+
             "    \"COL_LONGVARBINARY\"   LONG VARCHAR FOR BIT DATA,\n"+
@@ -101,7 +101,7 @@
             "    \"COL_PK\"               VARCHAR(32),\n"+
             "    \"COL_PK_AUTO_INCR\"     INTEGER GENERATED BY DEFAULT AS IDENTITY,\n"+
             "    \"COL_NOT_NULL\"         CHAR(100) FOR BIT DATA NOT NULL,\n"+
-            "    \"COL_NOT_NULL_DEFAULT\" DOUBLE PRECISION DEFAULT -2.0 NOT NULL,\n"+
+            "    \"COL_NOT_NULL_DEFAULT\" DOUBLE DEFAULT -2.0 NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
             "    \"COL_AUTO_INCR\"        BIGINT GENERATED BY DEFAULT AS IDENTITY,\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
@@ -125,7 +125,7 @@
             "    \"COL_PK_1\"    VARCHAR(32) NOT NULL,\n"+
             "    \"COL_PK_2\"    INTEGER,\n"+
             "    \"COL_INDEX_1\" CHAR(100) FOR BIT DATA NOT NULL,\n"+
-            "    \"COL_INDEX_2\" DOUBLE PRECISION NOT NULL,\n"+
+            "    \"COL_INDEX_2\" DOUBLE NOT NULL,\n"+
             "    \"COL_INDEX_3\" CHAR(4),\n"+
             "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+
             ");\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestInterbasePlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestInterbasePlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestInterbasePlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestInterbasePlatform.java Sat
May 13 03:49:59 2006
@@ -56,11 +56,11 @@
             "CREATE TABLE \"coltype\"\n"+
             "(\n"+
             "    \"COL_ARRAY\"           BLOB ,\n"+
-            "    \"COL_BIGINT\"          DECIMAL(38,0),\n"+
+            "    \"COL_BIGINT\"          NUMERIC(18,0),\n"+
             "    \"COL_BINARY\"          CHAR CHARACTER SET OCTETS,\n"+
-            "    \"COL_BIT\"             DECIMAL(1,0),\n"+
+            "    \"COL_BIT\"             SMALLINT,\n"+
             "    \"COL_BLOB\"            BLOB ,\n"+
-            "    \"COL_BOOLEAN\"         DECIMAL(1,0),\n"+
+            "    \"COL_BOOLEAN\"         SMALLINT,\n"+
             "    \"COL_CHAR\"            CHAR(15),\n"+
             "    \"COL_CLOB\"            BLOB SUB_TYPE TEXT,\n"+
             "    \"COL_DATALINK\"        BLOB,\n"+
@@ -110,7 +110,7 @@
             "    \"COL_NOT_NULL\"         CHAR(100) CHARACTER SET OCTETS NOT NULL,\n"+
             "    \"COL_NOT_NULL_DEFAULT\" DOUBLE PRECISION DEFAULT -2.0 NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
-            "    \"COL_AUTO_INCR\"        DECIMAL(38,0),\n"+
+            "    \"COL_AUTO_INCR\"        NUMERIC(18,0),\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
             ");\n"+
             "COMMIT;\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMaxDbPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMaxDbPlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMaxDbPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMaxDbPlatform.java Sat May
13 03:49:59 2006
@@ -46,7 +46,7 @@
             "(\n"+
             "    \"COL_ARRAY\"           LONG BYTE,\n"+
             "    \"COL_BIGINT\"          FIXED(38,0),\n"+
-            "    \"COL_BINARY\"          LONG BYTE,\n"+
+            "    \"COL_BINARY\"          CHAR(254) BYTE,\n"+
             "    \"COL_BIT\"             BOOLEAN,\n"+
             "    \"COL_BLOB\"            LONG BYTE,\n"+
             "    \"COL_BOOLEAN\"         BOOLEAN,\n"+
@@ -54,26 +54,26 @@
             "    \"COL_CLOB\"            LONG,\n"+
             "    \"COL_DATALINK\"        LONG BYTE,\n"+
             "    \"COL_DATE\"            DATE,\n"+
-            "    \"COL_DECIMAL\"         DECIMAL(15,3),\n"+
-            "    \"COL_DECIMAL_NOSCALE\" DECIMAL(15,0),\n"+
+            "    \"COL_DECIMAL\"         FIXED(15,3),\n"+
+            "    \"COL_DECIMAL_NOSCALE\" FIXED(15,0),\n"+
             "    \"COL_DISTINCT\"        LONG BYTE,\n"+
-            "    \"COL_DOUBLE\"          DOUBLE PRECISION,\n"+
-            "    \"COL_FLOAT\"           DOUBLE PRECISION,\n"+
+            "    \"COL_DOUBLE\"          FLOAT(38),\n"+
+            "    \"COL_FLOAT\"           FLOAT(38),\n"+
             "    \"COL_INTEGER\"         INTEGER,\n"+
             "    \"COL_JAVA_OBJECT\"     LONG BYTE,\n"+
             "    \"COL_LONGVARBINARY\"   LONG BYTE,\n"+
-            "    \"COL_LONGVARCHAR\"     LONG VARCHAR,\n"+
+            "    \"COL_LONGVARCHAR\"     LONG,\n"+
             "    \"COL_NULL\"            LONG BYTE,\n"+
-            "    \"COL_NUMERIC\"         DECIMAL(15,0),\n"+
+            "    \"COL_NUMERIC\"         FIXED(15,0),\n"+
             "    \"COL_OTHER\"           LONG BYTE,\n"+
-            "    \"COL_REAL\"            REAL,\n"+
+            "    \"COL_REAL\"            FLOAT(16),\n"+
             "    \"COL_REF\"             LONG BYTE,\n"+
             "    \"COL_SMALLINT\"        SMALLINT,\n"+
             "    \"COL_STRUCT\"          LONG BYTE,\n"+
             "    \"COL_TIME\"            TIME,\n"+
             "    \"COL_TIMESTAMP\"       TIMESTAMP,\n"+
             "    \"COL_TINYINT\"         SMALLINT,\n"+
-            "    \"COL_VARBINARY\"       LONG BYTE,\n"+
+            "    \"COL_VARBINARY\"       VARCHAR(15) BYTE,\n"+
             "    \"COL_VARCHAR\"         VARCHAR(15)\n"+
             ");\n",
             createTestDatabase(COLUMN_TEST_SCHEMA));
@@ -90,8 +90,8 @@
             "(\n"+
             "    \"COL_PK\"               VARCHAR(32),\n"+
             "    \"COL_PK_AUTO_INCR\"     INTEGER DEFAULT SERIAL(1),\n"+
-            "    \"COL_NOT_NULL\"         LONG BYTE NOT NULL,\n"+
-            "    \"COL_NOT_NULL_DEFAULT\" DOUBLE PRECISION DEFAULT -2.0 NOT NULL,\n"+
+            "    \"COL_NOT_NULL\"         CHAR(100) BYTE NOT NULL,\n"+
+            "    \"COL_NOT_NULL_DEFAULT\" FLOAT(38) DEFAULT -2.0 NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
             "    \"COL_AUTO_INCR\"        FIXED(38,0) DEFAULT SERIAL(1),\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
@@ -114,8 +114,8 @@
             "(\n"+
             "    \"COL_PK_1\"    VARCHAR(32) NOT NULL,\n"+
             "    \"COL_PK_2\"    INTEGER,\n"+
-            "    \"COL_INDEX_1\" LONG BYTE NOT NULL,\n"+
-            "    \"COL_INDEX_2\" DOUBLE PRECISION NOT NULL,\n"+
+            "    \"COL_INDEX_1\" CHAR(100) BYTE NOT NULL,\n"+
+            "    \"COL_INDEX_2\" FLOAT(38) NOT NULL,\n"+
             "    \"COL_INDEX_3\" CHAR(4),\n"+
             "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+
             ");\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMcKoiPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMcKoiPlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMcKoiPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestMcKoiPlatform.java Sat May
13 03:49:59 2006
@@ -137,11 +137,11 @@
             "CREATE TABLE \"constraints\"\n"+
             "(\n"+
             "    \"COL_PK\"               VARCHAR(32),\n"+
-            "    \"COL_PK_AUTO_INCR\"     INTEGER DEFAULT UNIQUEKEY('constraints') + 1,\n"+
+            "    \"COL_PK_AUTO_INCR\"     INTEGER DEFAULT UNIQUEKEY('constraints'),\n"+
             "    \"COL_NOT_NULL\"         BINARY(100) NOT NULL,\n"+
             "    \"COL_NOT_NULL_DEFAULT\" DOUBLE DEFAULT -2.0 NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
-            "    \"COL_AUTO_INCR\"        BIGINT DEFAULT UNIQUEKEY('constraints') + 1,\n"+
+            "    \"COL_AUTO_INCR\"        BIGINT DEFAULT UNIQUEKEY('constraints'),\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
             ");\n",
             createTestDatabase(COLUMN_CONSTRAINT_TEST_SCHEMA));
@@ -165,9 +165,7 @@
             "    \"COL_INDEX_1\" BINARY(100) NOT NULL,\n"+
             "    \"COL_INDEX_2\" DOUBLE NOT NULL,\n"+
             "    \"COL_INDEX_3\" CHAR(4),\n"+
-            "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\"),\n"+
-            "    CONSTRAINT \"testindex1\" UNIQUE (\"COL_INDEX_2\"),\n"+
-            "    CONSTRAINT \"testindex2\" UNIQUE (\"COL_INDEX_3\", \"COL_INDEX_1\")\n"+
+            "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+
             ");\n"+
             "CREATE TABLE \"table2\"\n"+
             "(\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSapDbPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSapDbPlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSapDbPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSapDbPlatform.java Sat May
13 03:49:59 2006
@@ -56,7 +56,7 @@
             "(\n"+
             "    \"COL_ARRAY\"           LONG BYTE,\n"+
             "    \"COL_BIGINT\"          FIXED(38,0),\n"+
-            "    \"COL_BINARY\"          LONG BYTE,\n"+
+            "    \"COL_BINARY\"          CHAR(254) BYTE,\n"+
             "    \"COL_BIT\"             BOOLEAN,\n"+
             "    \"COL_BLOB\"            LONG BYTE,\n"+
             "    \"COL_BOOLEAN\"         BOOLEAN,\n"+
@@ -64,26 +64,26 @@
             "    \"COL_CLOB\"            LONG,\n"+
             "    \"COL_DATALINK\"        LONG BYTE,\n"+
             "    \"COL_DATE\"            DATE,\n"+
-            "    \"COL_DECIMAL\"         DECIMAL(15,3),\n"+
-            "    \"COL_DECIMAL_NOSCALE\" DECIMAL(15,0),\n"+
+            "    \"COL_DECIMAL\"         FIXED(15,3),\n"+
+            "    \"COL_DECIMAL_NOSCALE\" FIXED(15,0),\n"+
             "    \"COL_DISTINCT\"        LONG BYTE,\n"+
-            "    \"COL_DOUBLE\"          DOUBLE PRECISION,\n"+
-            "    \"COL_FLOAT\"           DOUBLE PRECISION,\n"+
+            "    \"COL_DOUBLE\"          FLOAT(38),\n"+
+            "    \"COL_FLOAT\"           FLOAT(38),\n"+
             "    \"COL_INTEGER\"         INTEGER,\n"+
             "    \"COL_JAVA_OBJECT\"     LONG BYTE,\n"+
             "    \"COL_LONGVARBINARY\"   LONG BYTE,\n"+
-            "    \"COL_LONGVARCHAR\"     LONG VARCHAR,\n"+
+            "    \"COL_LONGVARCHAR\"     LONG,\n"+
             "    \"COL_NULL\"            LONG BYTE,\n"+
-            "    \"COL_NUMERIC\"         DECIMAL(15,0),\n"+
+            "    \"COL_NUMERIC\"         FIXED(15,0),\n"+
             "    \"COL_OTHER\"           LONG BYTE,\n"+
-            "    \"COL_REAL\"            REAL,\n"+
+            "    \"COL_REAL\"            FLOAT(16),\n"+
             "    \"COL_REF\"             LONG BYTE,\n"+
             "    \"COL_SMALLINT\"        SMALLINT,\n"+
             "    \"COL_STRUCT\"          LONG BYTE,\n"+
             "    \"COL_TIME\"            TIME,\n"+
             "    \"COL_TIMESTAMP\"       TIMESTAMP,\n"+
             "    \"COL_TINYINT\"         SMALLINT,\n"+
-            "    \"COL_VARBINARY\"       LONG BYTE,\n"+
+            "    \"COL_VARBINARY\"       VARCHAR(15) BYTE,\n"+
             "    \"COL_VARCHAR\"         VARCHAR(15)\n"+
             ");\n",
             createTestDatabase(COLUMN_TEST_SCHEMA));
@@ -100,8 +100,8 @@
             "(\n"+
             "    \"COL_PK\"               VARCHAR(32),\n"+
             "    \"COL_PK_AUTO_INCR\"     INTEGER DEFAULT SERIAL(1),\n"+
-            "    \"COL_NOT_NULL\"         LONG BYTE NOT NULL,\n"+
-            "    \"COL_NOT_NULL_DEFAULT\" DOUBLE PRECISION DEFAULT -2.0 NOT NULL,\n"+
+            "    \"COL_NOT_NULL\"         CHAR(100) BYTE NOT NULL,\n"+
+            "    \"COL_NOT_NULL_DEFAULT\" FLOAT(38) DEFAULT -2.0 NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
             "    \"COL_AUTO_INCR\"        FIXED(38,0) DEFAULT SERIAL(1),\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
@@ -124,8 +124,8 @@
             "(\n"+
             "    \"COL_PK_1\"    VARCHAR(32) NOT NULL,\n"+
             "    \"COL_PK_2\"    INTEGER,\n"+
-            "    \"COL_INDEX_1\" LONG BYTE NOT NULL,\n"+
-            "    \"COL_INDEX_2\" DOUBLE PRECISION NOT NULL,\n"+
+            "    \"COL_INDEX_1\" CHAR(100) BYTE NOT NULL,\n"+
+            "    \"COL_INDEX_2\" FLOAT(38) NOT NULL,\n"+
             "    \"COL_INDEX_3\" CHAR(4),\n"+
             "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+
             ");\n"+

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSybasePlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSybasePlatform.java?rev=406075&r1=406074&r2=406075&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSybasePlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestSybasePlatform.java Sat May
13 03:49:59 2006
@@ -62,10 +62,10 @@
             "(\n"+
             "    \"COL_ARRAY\"           IMAGE,\n"+
             "    \"COL_BIGINT\"          DECIMAL(19,0),\n"+
-            "    \"COL_BINARY\"          BINARY,\n"+
-            "    \"COL_BIT\"             BIT,\n"+
+            "    \"COL_BINARY\"          BINARY(254),\n"+
+            "    \"COL_BIT\"             SMALLINT,\n"+
             "    \"COL_BLOB\"            IMAGE,\n"+
-            "    \"COL_BOOLEAN\"         BIT,\n"+
+            "    \"COL_BOOLEAN\"         SMALLINT,\n"+
             "    \"COL_CHAR\"            CHAR(15),\n"+
             "    \"COL_CLOB\"            TEXT,\n"+
             "    \"COL_DATALINK\"        IMAGE,\n"+
@@ -132,8 +132,8 @@
             "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'RI' AND name = 'testfk')\n"+
             "    ALTER TABLE \"table3\" DROP CONSTRAINT \"testfk\";\n"+
             "SET quoted_identifier on;\n"+
-            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'RI' AND name = 'table2_FK_COL_F_OL_FK_2_table1')\n"+
-            "    ALTER TABLE \"table2\" DROP CONSTRAINT \"table2_FK_COL_F_OL_FK_2_table1\";\n"+
+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'RI' AND name = 'table2_FK_COL_L_FK_2_table1')\n"+
+            "    ALTER TABLE \"table2\" DROP CONSTRAINT \"table2_FK_COL_L_FK_2_table1\";\n"+
             "SET quoted_identifier on;\n"+
             "SET quoted_identifier on;\n"+
             "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'table3')\n"+
@@ -177,7 +177,7 @@
             "    \"COL_FK\" INT NOT NULL,\n"+
             "    PRIMARY KEY (\"COL_PK\")\n"+
             ");\n"+
-            "ALTER TABLE \"table2\" ADD CONSTRAINT \"table2_FK_COL_F_OL_FK_2_table1\" FOREIGN
KEY (\"COL_FK_1\", \"COL_FK_2\") REFERENCES \"table1\" (\"COL_PK_2\", \"COL_PK_1\");\n"+
+            "ALTER TABLE \"table2\" ADD CONSTRAINT \"table2_FK_COL_L_FK_2_table1\" FOREIGN
KEY (\"COL_FK_1\", \"COL_FK_2\") REFERENCES \"table1\" (\"COL_PK_2\", \"COL_PK_1\");\n"+
             "ALTER TABLE \"table3\" ADD CONSTRAINT \"testfk\" FOREIGN KEY (\"COL_FK\") REFERENCES
\"table2\" (\"COL_PK\");\n",
             createTestDatabase(TABLE_CONSTRAINT_TEST_SCHEMA));
     }



Mime
View raw message