You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2008/01/29 19:40:02 UTC

svn commit: r616473 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/

Author: djd
Date: Tue Jan 29 10:39:59 2008
New Revision: 616473

URL: http://svn.apache.org/viewvc?rev=616473&view=rev
Log:
DERBY-3350 Ensure that CAST inherits the nullability of its value expression since a cast of a non-null value is always not null. Changes the nullability of a number of JDBC DatabaseMetaData columns since many are derived from CAST expression in the SQL query that forms the result set.
Updated canons where the nullability changed, since if the column display size was less than four but nullable, ij would increase the display size to four to allow for NULL. Once such columns become not nullable their display size drops to less than four.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derby94.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java Tue Jan 29 10:39:59 2008
@@ -417,7 +417,11 @@
 						sourceCTI.getSQLTypeName(),
                         getTypeId().getSQLTypeName());
 			}
-		}		
+		}	
+		
+		// Preserve the nullability of the operand since a CAST
+		// of a non-NULL value is also non-NULL.
+		setNullability(castOperand.getTypeServices().isNullable());
 	}
 
 	/**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out Tue Jan 29 10:39:59 2008
@@ -30,18 +30,18 @@
 
 -- shrink
 values (cast ('hell' as char(2)));
-1   
-----
-he  
+1 
+--
+he
 ij> values (cast ('hell' as varchar(2)));
-1   
-----
-he  
+1 
+--
+he
 ij> -- shrink, whitespace only
 values (cast ('he  ' as char(2)));
-1   
-----
-he  
+1 
+--
+he
 ij> -- expand, check lengths
 values (cast ('hell' as char(20)));
 1                   
@@ -64,14 +64,14 @@
 ----------------
 -- shrink
 values (cast (X'1111' as char(1) for bit data));
-1   
-----
-11  
+1 
+--
+11
 ij> -- shrink, zero only
 values (cast (X'1100' as char(1) for bit data));
-1   
-----
-11  
+1 
+--
+11
 ij> -- expand
 values (cast (X'1111' as char(2) for bit data));
 1   
@@ -84,149 +84,149 @@
 ERROR 42846: Cannot convert types 'CHAR' to 'CHAR () FOR BIT DATA'.
 ij> -- extra tests for shrinking parts of bits
 values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00011111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00011111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00001111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00011111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00001111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00011111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00001111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000011' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'11111111' as char(1) for bit data);
-1   
-----
-11  
+1 
+--
+11
 ij> values cast (X'01111111' as char(1) for bit data);
-1   
-----
-01  
+1 
+--
+01
 ij> values cast (X'00111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00011111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00001111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000011' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'00000001' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'0011111111111111' as char(1) for bit data);
-1   
-----
-00  
+1 
+--
+00
 ij> values cast (X'1111111100111111' as char(2) for bit data);
 1   
 ----
@@ -259,13 +259,13 @@
 ----
 1.1 
 ij> values (cast (1.1 as numeric(2,0)));
-1   
-----
-1   
+1  
+---
+1  
 ij> values (cast (1.1 as decimal(2,0)));
-1   
-----
-1   
+1  
+---
+1  
 ij> values (cast (1.1 as float));
 1                     
 ----------------------
@@ -299,13 +299,13 @@
 ----
 1.9 
 ij> values (cast (1.9 as numeric(2,0)));
-1   
-----
-1   
+1  
+---
+1  
 ij> values (cast (1.9 as decimal(2,0)));
-1   
-----
-1   
+1  
+---
+1  
 ij> values (cast (1.9 as float));
 1                     
 ----------------------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derby94.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derby94.out?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derby94.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derby94.out Tue Jan 29 10:39:59 2008
@@ -54,41 +54,41 @@
 -----------
 0          
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname ;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
-TABLE   |2   |IX  |DERBY94_T1  |Tablelock |GRANT
-ROW     |1   |U   |DERBY94_T1  |(1,8)     |GRANT
-ROW     |1   |X   |DERBY94_T1  |(1,7)     |GRANT
-TABLE   |1   |IX  |DERBY94_T2  |Tablelock |GRANT
-ROW     |1   |U   |DERBY94_T2  |(1,7)     |GRANT
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
+TABLE   |2  |IX  |DERBY94_T1  |Tablelock |GRANT
+ROW     |1  |U   |DERBY94_T1  |(1,8)     |GRANT
+ROW     |1  |X   |DERBY94_T1  |(1,7)     |GRANT
+TABLE   |1  |IX  |DERBY94_T2  |Tablelock |GRANT
+ROW     |1  |U   |DERBY94_T2  |(1,7)     |GRANT
 ij> --following insert should get X lock on derby94_t2 because of escalation , but should leave U lock on derby94_t1 as it is
 insert into derby94_t2 select c1 from derby94_t1 ;
 160 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname ;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
-TABLE   |3   |IX  |DERBY94_T1  |Tablelock |GRANT
-ROW     |1   |U   |DERBY94_T1  |(1,8)     |GRANT
-ROW     |1   |X   |DERBY94_T1  |(1,7)     |GRANT
-TABLE   |4   |IX  |DERBY94_T2  |Tablelock |GRANT
-TABLE   |1   |X   |DERBY94_T2  |Tablelock |GRANT
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
+TABLE   |3  |IX  |DERBY94_T1  |Tablelock |GRANT
+ROW     |1  |U   |DERBY94_T1  |(1,8)     |GRANT
+ROW     |1  |X   |DERBY94_T1  |(1,7)     |GRANT
+TABLE   |4  |IX  |DERBY94_T2  |Tablelock |GRANT
+TABLE   |1  |X   |DERBY94_T2  |Tablelock |GRANT
 ij> --following update statement should escalate the locks on derby94_t1 to table level X lock
 update derby94_t1 set c1=c1+999 ;
 160 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname ;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
-TABLE   |8   |IX  |DERBY94_T1  |Tablelock |GRANT
-TABLE   |1   |X   |DERBY94_T1  |Tablelock |GRANT
-TABLE   |4   |IX  |DERBY94_T2  |Tablelock |GRANT
-TABLE   |1   |X   |DERBY94_T2  |Tablelock |GRANT
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
+TABLE   |8  |IX  |DERBY94_T1  |Tablelock |GRANT
+TABLE   |1  |X   |DERBY94_T1  |Tablelock |GRANT
+TABLE   |4  |IX  |DERBY94_T2  |Tablelock |GRANT
+TABLE   |1  |X   |DERBY94_T2  |Tablelock |GRANT
 ij> close c1 ;
 ij> close c2 ;
 ij> commit ;
 ij> --following lock table dump should not show any  locks, above commit should have release them
 select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
 ij> drop table derby94_t1;
 0 rows inserted/updated/deleted
 ij> drop table derby94_t2;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out Tue Jan 29 10:39:59 2008
@@ -1778,9 +1778,9 @@
 ij> values{ fn concat( 45, '67' )};
 ERROR 42846: Cannot convert types 'INTEGER' to 'VARCHAR'.
 ij> values{ fn concat( CHAR('C'), CHAR('#') ) };
-1   
-----
-C#  
+1 
+--
+C#
 ij> values{ fn concat( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ`1234567890-=\    [];,./ \'' |',
                    'abcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+|<>?:"{}     ''''''      ' ) };
 1                                                                                                                   

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out Tue Jan 29 10:39:59 2008
@@ -1158,12 +1158,12 @@
 get cursor update_cursor3 as
     'select b from test_11 where a=8 for update of b';
 ij(T11SCANNER)> select type, cnt, mode, tabname, lockname, state from lock_table2 order by tabname, type desc, mode, cnt, lockname;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
-TABLE   |1   |IX  |TEST_11     |Tablelock |GRANT
-TABLE   |1   |IX  |TEST_11     |Tablelock |GRANT
-ROW     |1   |S   |TEST_11     |(1,1)     |GRANT
-ROW     |1   |U   |TEST_11     |(1,7)     |GRANT
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
+TABLE   |1  |IX  |TEST_11     |Tablelock |GRANT
+TABLE   |1  |IX  |TEST_11     |Tablelock |GRANT
+ROW     |1  |S   |TEST_11     |(1,1)     |GRANT
+ROW     |1  |U   |TEST_11     |(1,7)     |GRANT
 ij(T11SCANNER)> next update_cursor3;
 B          
 -----------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out?rev=616473&r1=616472&r2=616473&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out Tue Jan 29 10:39:59 2008
@@ -592,13 +592,13 @@
 get cursor update_cursor3 as
     'select b from test_6 where a=8 for update of b';
 ij(T6SCANNER)> select type, cnt, mode, tabname, lockname, state from lock_table2 order by tabname, type desc, mode, cnt, lockname;
-TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE
-------------------------------------------------
-TABLE   |1   |IX  |TEST_6      |Tablelock |GRANT
-TABLE   |1   |IX  |TEST_6      |Tablelock |GRANT
-ROW     |1   |S   |TEST_6      |(1,1)     |GRANT
-ROW     |1   |U   |TEST_6      |(1,3)     |GRANT
-ROW     |1   |U   |TEST_6      |(1,7)     |GRANT
+TYPE    |CNT|MODE|TABNAME     |LOCKNAME  |STATE
+-----------------------------------------------
+TABLE   |1  |IX  |TEST_6      |Tablelock |GRANT
+TABLE   |1  |IX  |TEST_6      |Tablelock |GRANT
+ROW     |1  |S   |TEST_6      |(1,1)     |GRANT
+ROW     |1  |U   |TEST_6      |(1,3)     |GRANT
+ROW     |1  |U   |TEST_6      |(1,7)     |GRANT
 ij(T6SCANNER)> next update_cursor3;
 B          
 -----------

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=616473&r1=616472&r2=616473&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 Tue Jan 29 10:39:59 2008
@@ -193,7 +193,7 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("DatabaseMetaDataTest");
         suite.addTest(
-            TestConfiguration.defaultSuite(DatabaseMetaDataTest.class));
+            TestConfiguration.embeddedSuite(DatabaseMetaDataTest.class));
         // Test for DERBY-2584 needs a fresh database to ensure that the
         // meta-data queries haven't already been compiled. No need to run the
         // test in client/server mode since it only tests the compilation of
@@ -737,7 +737,7 @@
         if (usingDerbyNetClient())
             nullval = false;
         boolean [] nullability = {
-                true, true, true, true, nullval, true, nullval,
+                true, true, false, true, nullval, true, nullval,
                 nullval, nullval, nullval, true, true, nullval, nullval,
                 nullval, nullval, true, true, true, true, true
         };
@@ -755,7 +755,7 @@
         columnTypes = new int[] {
                 Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR};
         nullability = new boolean[] {
-                true, true, true, true};
+                true, true, false, false};
         assertMetaDataResultSet(rs, columnNames, columnTypes, nullability);
         JDBC.assertEmpty(rs);
 
@@ -767,7 +767,7 @@
                 Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
                 Types.VARCHAR, Types.VARCHAR};
         nullability = new boolean[] {
-                true, true, true, true, true, true};
+                true, true, false, true, true, false};
         assertMetaDataResultSet(rs, columnNames, columnTypes, nullability);
         JDBC.assertEmpty(rs);
 
@@ -1903,15 +1903,15 @@
                 true 
         };
         
-        // DERBY-2307 Nullablity is wrong for columns 1,7,9 (1-based)
+        // DERBY-2307 Nullablity is wrong for column 1 (1-based)
         // Make a modified copy of JDBC_COLUMN_NULLABILITY
         // here to allow the test to pass. Left JDBC_COLUMN_NULLABILITY
         // as the expected versions as it is also used for the ODBC
         // checks below and has the correct values.
         boolean[] JDBC_COLUMN_NULLABILITY_DERBY_2307 = {
                 true, false, true, true,
-                true, true, true, false,
-                true, true, false,
+                true, true, false, false,
+                false, true, false,
                 true, true,
                 true, true,
                 true, true,
@@ -2282,6 +2282,10 @@
 
     /**
      * Check the shape of the ResultSet from any getTables call.
+     * Note nullability of TABLE_CAT is not nullable for Derby
+     * even though it doesn't support catalogs because the
+     * SQL query returns a constant (empty string) for
+     * a table's catalog.
      */
     private void checkTablesShape(ResultSet rs) throws SQLException
     {
@@ -2297,8 +2301,8 @@
           Types.VARCHAR, Types.VARCHAR
          }
         , new boolean[] {
-          true, false, false, true, // TABLE_SCHEM cannot be NULL in Derby
-          true, true, true, true,
+          false, false, false, true, // TABLE_SCHEM cannot be NULL in Derby
+          false, true, true, true,
           true, true
         }
         );        
@@ -2899,8 +2903,8 @@
 
             // incorrect
             new boolean[] {
-                true, false, false, false,
-                true, false, false, false,
+                false, false, false, false,
+                false, false, false, false,
                 true, true, true, false,
                 false, true
             }
@@ -3218,7 +3222,7 @@
         		scope != DatabaseMetaData.bestRowSession)
         {
         	nullability = new boolean [] {
-                    false, true, false, true, false, false, false, false};
+                    false, false, false, false, false, false, false, false};
         	
         	odbcColumnTypes = columnTypes;
         }
@@ -3322,7 +3326,7 @@
         int [] columnTypes = {
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR};
-        boolean [] nullability = {true,false,false,false,true,true,true,true};
+        boolean [] nullability = {false,false,false,false,false,false,true,true};
 
         assertMetaDataResultSet(rss[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(rss[1], columnNames, columnTypes, nullability);
@@ -3391,7 +3395,7 @@
         int [] columnTypes = {
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR};
-        boolean [] nullability = {true,false,false,true,true,true,true};
+        boolean [] nullability = {false,false,false,false,false,false,false};
         
         assertMetaDataResultSet(rss[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(rss[1], columnNames, columnTypes, nullability);
@@ -3556,8 +3560,8 @@
                 // ASC_OR_DESC is Types.CHAR rather than VARCHAR...
                 Types.SMALLINT,Types.VARCHAR,Types.CHAR,Types.INTEGER,
                 Types.INTEGER,Types.VARCHAR};
-        boolean [] nullability = {true,false,false,
-            true,true,true,true,true,false,true,true,true,true};
+        boolean [] nullability = {false,false,false,
+            true,false,true,true,true,false,true,true,true,true};
         
         assertMetaDataResultSet(rss[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(rss[1], columnNames, odbcColumnTypes, nullability);
@@ -3728,7 +3732,7 @@
         int [] columnTypes = {
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
                 Types.VARCHAR,Types.SMALLINT,Types.VARCHAR};
-        boolean [] nullability = {true,false,false,false,true,false};
+        boolean [] nullability = {false,false,false,false,true,false};
         assertMetaDataResultSet(rss[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(rss[1], columnNames, columnTypes, nullability);
            
@@ -3997,8 +4001,8 @@
                 Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
                 Types.SMALLINT,Types.SMALLINT,Types.SMALLINT,
                 Types.VARCHAR,Types.VARCHAR,Types.SMALLINT};
-            boolean [] nullability = {true,false,false,false,
-                true,false,false,false,true,true,true,false,false,true};
+            boolean [] nullability = {false,false,false,false,
+                false,false,false,false,true,true,true,false,false,true};
             
          assertMetaDataResultSet(rss[0], columnNames, columnTypes, nullability);
          assertMetaDataResultSet(rss[1], columnNames, columnTypes, nullability);   
@@ -4256,9 +4260,9 @@
                 Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER,
                 Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.SMALLINT};
         boolean[] nullability = new boolean[] {
-                true, false, false, true, true, true, true, true, false};
+                false, false, false, true, true, true, true, true, false};
         boolean[] odbcNullability = new boolean[] {
-                true, false, false, true, true, true, true, true};
+                false, false, false, true, true, true, true, true};
         assertMetaDataResultSet(rs[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(
                 rs[1], odbcColumnNames, odbcColumnTypes, odbcNullability);
@@ -4323,11 +4327,11 @@
                 , Types.SMALLINT, Types.SMALLINT};
         nullability = new boolean[] {
                 true, false, false, false, false, false, false, false, true, true,
-                true, false, true, true, true, true, true, true, true, false//};
+                true, false, true, true, true, true, true, false, true, false//};
                 , false, false};
         odbcNullability = new boolean[] {
-                true, false, false, false, false, true, false, false, true, true,
-                true, false, true, true, true, true, true, true, true//};
+                true, false, false, false, false, false, false, false, true, true,
+                true, false, true, true, true, true, true, false, true//};
                 , false, false};
         assertMetaDataResultSet(rs[0], columnNames, columnTypes, nullability);
         assertMetaDataResultSet(