db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r628151 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Date Fri, 15 Feb 2008 19:36:22 GMT
Author: kmarsden
Date: Fri Feb 15 11:36:22 2008
New Revision: 628151

URL: http://svn.apache.org/viewvc?rev=628151&view=rev
Log:
DERBY-3400 testgetTypeInfo Fails with ibm16 while running the UpgradeTests

Workaround for IBM JVM issue. Make new arrays for ODBC nullability instead of doing arrayCopy.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java?rev=628151&r1=628150&r2=628151&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Fri Feb 15 11:36:22 2008
@@ -2213,13 +2213,20 @@
         ODBC_COLUMN_TYPES[16] = Types.SMALLINT; // SQL_DATETIME_SUB
         ODBC_COLUMN_TYPES[18] = Types.SMALLINT; // INTERVAL_PRECISION
         
-        boolean[] ODBC_COLUMN_NULLABILITY = new boolean[ODBC_COLUMN_NAMES.length];
-        System.arraycopy(JDBC_COLUMN_NULLABILITY, 0, ODBC_COLUMN_NULLABILITY, 0,
-                JDBC_COLUMN_NULLABILITY.length);
-        //SQL_DATA_TYPE is NULL in JDBC but a valid non-null value in ODBC
-        ODBC_COLUMN_NULLABILITY[16 - 1] = false; 
-        ODBC_COLUMN_NULLABILITY[19 - 1] = true; // INTERVAL_PRECISION (extra column comapred
to JDBC)
-                
+        // ODBC_COLUMN_NULLABILTY is the same as JDBC except for:
+        // column 16 - SQL_DATA_TYPE is NULL in JDBC but a valid non-null value in ODBC
+        // column 19 -  INTERVAL_PRECISION (extra column comapred to JDBC)
+        boolean[] ODBC_COLUMN_NULLABILITY = {
+                true, false, true, true,
+                true, true, false, false,
+                false, true, false,
+                true, true,
+                true, true,
+                false, true,
+                true,
+                true 
+        };
+
         CallableStatement cs = prepareCall(
                 "CALL SYSIBM.SQLGETTYPEINFO (0, 'DATATYPE=''ODBC''')");
         
@@ -4469,9 +4476,13 @@
         System.arraycopy(columnTypes, 0, odbcColumnTypes, 0, 19);
         System.arraycopy(columnTypes, 21 - 1, odbcColumnTypes, 20 - 1, 2);
         
-        boolean[] odbcNullability = new boolean[nullability.length - 1];
-        System.arraycopy(nullability, 0, odbcNullability, 0, 19);
-        System.arraycopy(nullability, 21 - 1, odbcNullability, 20 - 1, 2);
+        //      SQL_DATA_TYPE NULL in JDBC, valid type in ODBC.
+        // otherwise the same as JDBC
+        boolean[] odbcNullability = new boolean[] {
+                true, false, false, false, false, false, false, false, false, true,
+                true, false, true, true, false, true, true, false, false, false
+                , false};
+
         
         // And change some column names.
         odbcColumnNames[8 - 1] = "COLUMN_SIZE";
@@ -4483,8 +4494,6 @@
         odbcColumnTypes[6 - 1] = Types.SMALLINT;
         odbcColumnTypes[15 - 1] = Types.SMALLINT;
         odbcColumnTypes[16 - 1] = Types.SMALLINT;
-        
-        odbcNullability[15 - 1] = false; // SQL_DATA_TYPE NULL in JDBC, valid type in ODBC
              
         // odbc result set
         assertMetaDataResultSet(



Mime
View raw message