db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1448002 [6/6] - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/iapi/types/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTest...
Date Wed, 20 Feb 2013 04:42:58 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/union.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/union.out?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/union.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/union.out Wed Feb 20 04:42:57 2013
@@ -77,44 +77,44 @@ ij> values (1, 2, 3, 4) union values (1,
 -----------------------------------------------
 1          |2          |3          |4          
 ij> select * from t1 union select * from t2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> select * from t1 union select * from t1;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> select * from t1 union select * from t2 union select * from dups;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> select * from t1 union select i, s, d, r, c10, c30, vc10, vc30 from t2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> select * from t1 union select i, s, d, r, c10, c30, vc10, vc30 from t2
 		union select * from dups;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> -- derived tables
 select * from (values (1, 2, 3, 4) union values (5, 6, 7, 8)) a;
 1          |2          |3          |4          
@@ -376,35 +376,35 @@ ij> -- simple tests
 insert into insert_test select * from t1 union select * from dups;
 5 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test;
 5 rows inserted/updated/deleted
 ij> insert into insert_test (s, i) values (2, 1) union values (4, 3);
 2 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |2     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |4     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |2     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |4     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test;
 2 rows inserted/updated/deleted
 ij> -- test type dominance/length/nullability
 insert into insert_test (vc30) select vc10 from t1 union select c30 from t2;
 5 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |11111                         
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |22222                         
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |33333     33                  
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |44444     44                  
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |11111                         
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |22222                         
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |33333     33                  
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |44444     44                  
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test;
 5 rows inserted/updated/deleted
 ij> insert into insert_test (c30)
@@ -415,24 +415,24 @@ ij> insert into insert_test (c30)
 	select c10 from t1;
 5 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |11111                         |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |22222                         |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |33333     33                  |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |44444     44                  |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |11111                         |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |22222                         |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |33333     33                  |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |44444     44                  |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test;
 5 rows inserted/updated/deleted
 ij> -- test NormalizeResultSet generation
 select i, d from t1 union select d, i from t2;
-1                     |2                     
----------------------------------------------
-1.0                   |10.0                  
-2.0                   |20.0                  
-30.0                  |3.0                   
-40.0                  |4.0                   
-NULL                  |NULL                  
+1                       |2                       
+-------------------------------------------------
+1.0                     |10.0                    
+2.0                     |20.0                    
+30.0                    |3.0                     
+40.0                    |4.0                     
+NULL                    |NULL                    
 ij> select vc10, c30 from t1 union select c30, vc10 from t2;
 1                             |2                             
 -------------------------------------------------------------
@@ -466,20 +466,20 @@ values (1) union values (1.1);
 1.0           
 1.1           
 ij> values (1) union values (1.1e1);
-1                     
-----------------------
-1.0                   
-11.0                  
+1                       
+------------------------
+1.0                     
+11.0                    
 ij> values (1.1) union values (1);
 1             
 --------------
 1.0           
 1.1           
 ij> values (1.1e1) union values (1);
-1                     
-----------------------
-1.0                   
-11.0                  
+1                       
+------------------------
+1.0                     
+11.0                    
 ij> -- negative cases
 values (x'aa') union values (1);
 ERROR 42X61: Types 'CHAR () FOR BIT DATA' and 'INTEGER' are not UNION compatible.
@@ -550,23 +550,23 @@ ij> values (1, 2, 3, 4) union all values
 5          |6          |7          |8          
 9          |10         |11         |12         
 ij> select * from t1 union all select * from t2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
 ij> select * from t1 union all select i, s, d, r, c10, c30, vc10, vc30 from t2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
 ij> -- derived tables
 select * from (values (1, 2, 3, 4) union all values (5, 6, 7, 8)) a;
 1          |2          |3          |4          
@@ -786,23 +786,23 @@ ij> -- simple tests
 insert into insert_test select * from t1 union all select * from t2;
 6 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-1          |1     |10.0                  |10.0         |11111     |11111     11                  |11111     |11111      11                 
-2          |2     |20.0                  |20.0         |22222     |22222     22                  |22222     |22222      22                 
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |3     |30.0                  |30.0         |33333     |33333     33                  |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444     44                  |44444     |44444      44                 
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+1          |1     |10.0                    |10.0           |11111     |11111     11                  |11111     |11111      11                 
+2          |2     |20.0                    |20.0           |22222     |22222     22                  |22222     |22222      22                 
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |3     |30.0                    |30.0           |33333     |33333     33                  |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444     44                  |44444     |44444      44                 
 ij> delete from insert_test;
 6 rows inserted/updated/deleted
 ij> insert into insert_test (s, i) values (2, 1) union all values (4, 3);
 2 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |2     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |4     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |2     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |4     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test;
 2 rows inserted/updated/deleted
 ij> -- type conversions between union all and target table
@@ -810,14 +810,14 @@ insert into insert_test select s, i, r, 
 						select s, i, r, d, vc10, vc30, c10, vc30 from t2;
 6 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-1          |1     |10.0                  |10.0         |11111     |11111      11                 |11111     |11111     11                  
-2          |2     |20.0                  |20.0         |22222     |22222      22                 |22222     |22222     22                  
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |3     |30.0                  |30.0         |33333     |33333      33                 |33333     |33333      33                 
-4          |4     |40.0                  |40.0         |44444     |44444      44                 |44444     |44444      44                 
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+1          |1     |10.0                    |10.0           |11111     |11111      11                 |11111     |11111     11                  
+2          |2     |20.0                    |20.0           |22222     |22222      22                 |22222     |22222     22                  
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |3     |30.0                    |30.0           |33333     |33333      33                 |33333     |33333      33                 
+4          |4     |40.0                    |40.0           |44444     |44444      44                 |44444     |44444      44                 
 ij> delete from insert_test;
 6 rows inserted/updated/deleted
 ij> -- test type dominance/length/nullability
@@ -833,14 +833,14 @@ NULL                          
 ij> insert into insert_test (vc30) select vc10 from t1 union all select c30 from t2;
 6 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |11111                         
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |22222                         
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |33333     33                  
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |44444     44                  
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |11111                         
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |22222                         
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |33333     33                  
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |44444     44                  
 ij> delete from insert_test;
 6 rows inserted/updated/deleted
 ij> insert into insert_test (c30)
@@ -851,29 +851,29 @@ ij> insert into insert_test (c30)
 	select c10 from t1;
 9 rows inserted/updated/deleted
 ij> select * from insert_test;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |11111                         |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |22222                         |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |33333     33                  |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |44444     44                  |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |11111                         |NULL      |NULL                          
-NULL       |NULL  |NULL                  |NULL         |NULL      |22222                         |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |11111                         |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |22222                         |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |33333     33                  |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |44444     44                  |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |11111                         |NULL      |NULL                          
+NULL       |NULL  |NULL                    |NULL           |NULL      |22222                         |NULL      |NULL                          
 ij> delete from insert_test;
 9 rows inserted/updated/deleted
 ij> -- test NormalizeResultSet generation
 select i, d from t1 union all select d, i from t2;
-1                     |2                     
----------------------------------------------
-NULL                  |NULL                  
-1.0                   |10.0                  
-2.0                   |20.0                  
-NULL                  |NULL                  
-30.0                  |3.0                   
-40.0                  |4.0                   
+1                       |2                       
+-------------------------------------------------
+NULL                    |NULL                    
+1.0                     |10.0                    
+2.0                     |20.0                    
+NULL                    |NULL                    
+30.0                    |3.0                     
+40.0                    |4.0                     
 ij> select vc10, c30 from t1 union all select c30,  vc10 from t2;
 1                             |2                             
 -------------------------------------------------------------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out Wed Feb 20 04:42:57 2013
@@ -170,18 +170,18 @@ ij> values (1, 2, 3), (4, 5, 6);
 ij> prepare v2 as 'values (1, 1, ?), (1e0, ?, ''abc''), (?, 0, ''def'')';
 ij> execute v2 using 'values (''ghi'', 1, 2)';
 IJ WARNING: Autocommit may close using result set
-1                     |2          |3   
----------------------------------------
-1.0                   |1          |ghi 
-1.0                   |1          |abc 
-2.0                   |0          |def 
+1                       |2          |3   
+-----------------------------------------
+1.0                     |1          |ghi 
+1.0                     |1          |abc 
+2.0                     |0          |def 
 ij> execute v2 using 'values (cast(null as char(3)), cast(null as smallint), cast(null as float))';
 IJ WARNING: Autocommit may close using result set
-1                     |2          |3   
----------------------------------------
-1.0                   |1          |NULL
-1.0                   |NULL       |abc 
-NULL                  |0          |def 
+1                       |2          |3   
+-----------------------------------------
+1.0                     |1          |NULL
+1.0                     |NULL       |abc 
+NULL                    |0          |def 
 ij> remove v2;
 ij> -- type precedence tests. tinyint not supported by DB2 Cloudscape
 values (1 = 1.2);
@@ -244,11 +244,11 @@ ij> insert into insert_test2 values (1, 
 								(3, 3, 3e3, 3e3, '333', '3333333333', '333', '333333333');
 3 rows inserted/updated/deleted
 ij> select * from insert_test2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |111       |1111111111                    |111       |111111111                     
-2          |2     |200.0                 |200.0        |222       |2222222222                    |222       |222222222                     
-3          |3     |3000.0                |3000.0       |333       |3333333333                    |333       |333333333                     
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |111       |1111111111                    |111       |111111111                     
+2          |2     |200.0                   |200.0          |222       |2222222222                    |222       |222222222                     
+3          |3     |3000.0                  |3000.0         |333       |3333333333                    |333       |333333333                     
 ij> delete from insert_test2;
 3 rows inserted/updated/deleted
 ij> insert into insert_test2 values (1, 1, null, null, null, null, null, null),
@@ -256,11 +256,11 @@ ij> insert into insert_test2 values (1, 
 								(3, 3, null, null, null, null, null, null);
 3 rows inserted/updated/deleted
 ij> select * from insert_test2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-2          |2     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |3     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+2          |2     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |3     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test2;
 3 rows inserted/updated/deleted
 ij> insert into insert_test2 values (1, null, null, null, null, null, null, null),
@@ -268,11 +268,11 @@ ij> insert into insert_test2 values (1, 
 								(3, null, null, null, null, null, null, null);
 3 rows inserted/updated/deleted
 ij> select * from insert_test2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-NULL       |2     |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-3          |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+NULL       |2     |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+3          |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test2;
 3 rows inserted/updated/deleted
 ij> insert into insert_test2 (r, d) values (1e2, 1e1),
@@ -280,11 +280,11 @@ ij> insert into insert_test2 (r, d) valu
 									   (3e2, 3e1);
 3 rows inserted/updated/deleted
 ij> select * from insert_test2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-NULL       |NULL  |10.0                  |100.0        |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |20.0                  |200.0        |NULL      |NULL                          |NULL      |NULL                          
-NULL       |NULL  |30.0                  |300.0        |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+NULL       |NULL  |10.0                    |100.0          |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |20.0                    |200.0          |NULL      |NULL                          |NULL      |NULL                          
+NULL       |NULL  |30.0                    |300.0          |NULL      |NULL                          |NULL      |NULL                          
 ij> delete from insert_test2;
 3 rows inserted/updated/deleted
 ij> prepare v3 as 'insert into insert_test2 values (1, 1, ?, 1e1, ''111'', ''1111111111'', ''111'', ''111111111''),
@@ -305,17 +305,17 @@ ij> execute v4 using 'values (10, 20, 30
 IJ WARNING: Autocommit may close using result set
 3 rows inserted/updated/deleted
 ij> select * from insert_test2;
-I          |S     |D                     |R            |C10       |C30                           |VC10      |VC30                          
--------------------------------------------------------------------------------------------------------------------------------------------
-1          |1     |10.0                  |10.0         |111       |1111111111                    |111       |111111111                     
-2          |2     |200.0                 |200.0        |222       |2222222222                    |222       |222222222                     
-3          |3     |3000.0                |3000.0       |333       |3333333333                    |333       |333333333                     
-1          |1     |NULL                  |10.0         |111       |1111111111                    |111       |111111111                     
-2          |2     |200.0                 |200.0        |222       |NULL                          |222       |222222222                     
-3          |3     |3000.0                |NULL         |333       |3333333333                    |333       |333333333                     
-10         |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-20         |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
-30         |NULL  |NULL                  |NULL         |NULL      |NULL                          |NULL      |NULL                          
+I          |S     |D                       |R              |C10       |C30                           |VC10      |VC30                          
+-----------------------------------------------------------------------------------------------------------------------------------------------
+1          |1     |10.0                    |10.0           |111       |1111111111                    |111       |111111111                     
+2          |2     |200.0                   |200.0          |222       |2222222222                    |222       |222222222                     
+3          |3     |3000.0                  |3000.0         |333       |3333333333                    |333       |333333333                     
+1          |1     |NULL                    |10.0           |111       |1111111111                    |111       |111111111                     
+2          |2     |200.0                   |200.0          |222       |NULL                          |222       |222222222                     
+3          |3     |3000.0                  |NULL           |333       |3333333333                    |333       |333333333                     
+10         |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+20         |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
+30         |NULL  |NULL                    |NULL           |NULL      |NULL                          |NULL      |NULL                          
 ij> remove v4;
 ij> delete from insert_test2;
 9 rows inserted/updated/deleted
@@ -677,4 +677,4 @@ select * from t3 group by i having (valu
 ERROR 42X07: Null is only allowed in a VALUES clause within an INSERT statement.
 ij> drop table t3;
 0 rows inserted/updated/deleted
-ij> 
+ij> 
\ No newline at end of file

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java Wed Feb 20 04:42:57 2013
@@ -4738,27 +4738,28 @@ public class ParameterMappingTest extend
                           _X, -(new Float(Float.MAX_VALUE)).doubleValue() * 10,
                           XXX_DOUBLE, "22003");
         assertUpdateState(rs, "F04",
+                          _X, Float.POSITIVE_INFINITY, XXX_FLOAT, "22003");
+        assertUpdateState(rs, "F04",
                           _X, Float.NEGATIVE_INFINITY, XXX_FLOAT, "22003");
         assertUpdateState(rs, "F04",
                           bdMinFloatValue.multiply(BigDecimal.TEN), "22003");
 
-        // Remove test when DERBY-5534 is fixed
+        // These two would fail prior to DERBY-3398
+        assertUpdateOK(rs, "F04", _X, Float.MIN_VALUE, XXX_FLOAT);
+        assertUpdateOK(rs, "F04", _X, -Float.MIN_VALUE, XXX_FLOAT);
+
+        // Make unconditional when DERBY-5534 is fixed
         if (usingEmbedded()) {
             assertUpdateState(rs, "F04",
                               _X, Float.NaN, XXX_FLOAT, "22003");
             assertUpdateState(rs, "F04",
                               _X, Double.MIN_VALUE, XXX_DOUBLE, "22003");
-
-            // REAL DB2 limits: remove if DERBY-3398 is implemented
-            assertUpdateState(rs, "F04", bdSmallestPosFloatValue, "22003");
-            assertUpdateState(rs, "F04", bdSmallestNegFloatValue, "22003");
-
-            assertUpdateState(rs, "F04", bdMaxFloatValue, "22003");
-            assertUpdateState(rs, "F04", bdMinFloatValue, "22003");
+            assertUpdateState(rs, "F04",
+                              _X, -Double.MIN_VALUE, XXX_DOUBLE, "22003");
         }
 
         // REAL Underflow checking
-        // Remove test when DERBY-5534 is fixed
+        // Make unconditional DERBY-5534 is fixed
         if (usingEmbedded()) {
             assertUpdateState(rs, "F04", bdSmallestPosDoubleValue, "22003");
             assertUpdateState(rs, "F04", bdSmallestNegDoubleValue, "22003");
@@ -4775,11 +4776,6 @@ public class ParameterMappingTest extend
                               bdMaxDoubleValue.multiply(BigDecimal.TEN),
                               "22003");
 
-            // Uncomment when DERBY-5534 is fixed, or remove entirely if
-            // DERBY-3398 is fixed
-            // assertUpdateState(rs, dfCols[i], _X,
-            //                   Double.MAX_VALUE, UPDATE_DOUBLE, "22003");
-
             assertUpdateState(rs, dfCols[i],
                               _X, Float.NEGATIVE_INFINITY, XXX_FLOAT, "22003");
             assertUpdateState(rs, dfCols[i],
@@ -4789,26 +4785,24 @@ public class ParameterMappingTest extend
                               bdMinDoubleValue.multiply(BigDecimal.TEN),
                               "22003");
 
-            // Uncomment when DERBY-5534 is fixed, or remove entirely if
-            // DERBY-3398 is fixed
-
-            // assertUpdateState(rs, dfCols[i], _X,
-            //                   Double.MIN_VALUE, UPDATE_DOUBLE, "22003");
-
-            // Remove test when DERBY-5534 is fixed
+            // Make unconditional when DERBY-5534 is fixed
             if (usingEmbedded()) {
                 assertUpdateState(rs, dfCols[i],
                                   _X, Double.NaN, XXX_DOUBLE, "22003");
             }
 
             // DOUBLE, FLOAT underflow checking
-            // Remove test when DERBY-5534 is fixed
+            // Make unconditional when DERBY-5534 is fixed
             if (usingEmbedded()) {
                 assertUpdateState(rs, dfCols[i],
                     bdSmallestPosDoubleValue.divide(BigDecimal.TEN), "22003");
                 assertUpdateState(rs, dfCols[i],
                     bdSmallestNegDoubleValue.divide(BigDecimal.TEN), "22003");
             }
+
+            // These two would fail prior to DERBY-3398
+            assertUpdateOK(rs, dfCols[i], _X, Double.MIN_VALUE, XXX_DOUBLE);
+            assertUpdateOK(rs, dfCols[i], _X, -Double.MIN_VALUE, XXX_DOUBLE);
         }
 
         // Derby BOOLEAN: not range checked: FALSE of 0, else TRUE.
@@ -4985,12 +4979,24 @@ public class ParameterMappingTest extend
         }
     }
 
-
     /*
      * Using ResultSet.updateXXX with value or dvalue as the case may be on
-     * colName, assert that we see the SQLstate expected. XXX is indicated by
+     * colName, assert that we do not see an error. XXX is indicated by
      * updateType.
      */
+    private void assertUpdateOK(
+            ResultSet rs,
+            String colName,
+            long value,
+            double dvalue,
+            int updateType) throws SQLException {
+        assertUpdateState(rs, colName, value, dvalue, updateType, null);
+    }
+    /*
+     * Using ResultSet.updateXXX with value or dvalue as the case may be on
+     * colName, assert that we see the SQLstate expected. XXX is indicated by
+     * updateType. If expected is null, expect no error.
+     */
     private void assertUpdateState(
         ResultSet rs,
         String colName,
@@ -5022,8 +5028,13 @@ public class ParameterMappingTest extend
                 fail("wrong argument");
             }
 
-            fail("exception expected");
+            if (expected != null) {
+                fail("exception expected");
+            }
         } catch (SQLException e) {
+            if (expected == null) {
+                throw e;
+            }
             println(e.toString());
             assertSQLState(expected, e);
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PrepStmtMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PrepStmtMetaDataTest.java?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PrepStmtMetaDataTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PrepStmtMetaDataTest.java Wed Feb 20 04:42:57 2013
@@ -237,7 +237,7 @@ public class PrepStmtMetaDataTest extend
         assertEquals(5, rsmd.getScale(4));
         // COLUMN 5 REAL
         assertEquals("java.lang.Float", rsmd.getColumnClassName(5));
-        assertEquals(13, rsmd.getColumnDisplaySize(5));
+        assertEquals(15, rsmd.getColumnDisplaySize(5));
         assertEquals("REALCOL", rsmd.getColumnLabel(5));
         assertEquals(java.sql.Types.REAL,rsmd.getColumnType(5));
         assertEquals("REAL", rsmd.getColumnTypeName(5));
@@ -246,7 +246,7 @@ public class PrepStmtMetaDataTest extend
         
         // COLUMN 6 DOUBLE
         assertEquals("java.lang.Double", rsmd.getColumnClassName(6));
-        assertEquals(22, rsmd.getColumnDisplaySize(6));
+        assertEquals(24, rsmd.getColumnDisplaySize(6));
         assertEquals("DOUBLECOL", rsmd.getColumnLabel(6));
         assertEquals(java.sql.Types.DOUBLE,rsmd.getColumnType(6));
         assertEquals("DOUBLE", rsmd.getColumnTypeName(6));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java Wed Feb 20 04:42:57 2013
@@ -125,7 +125,7 @@ public class ResultSetMiscTest extends B
         assertFalse(met.isCurrency(3));
         assertEquals(ResultSetMetaData.columnNullable, met.isNullable(3));
         assertTrue(met.isSigned(3));
-        assertEquals(13, met.getColumnDisplaySize(3));
+        assertEquals(15, met.getColumnDisplaySize(3));
         assertEquals("R", met.getColumnLabel(3));
         assertEquals("R", met.getColumnName(3));
         // beetle 5323
@@ -150,7 +150,7 @@ public class ResultSetMiscTest extends B
         assertFalse(met.isCurrency(4));
         assertEquals(ResultSetMetaData.columnNullable, met.isNullable(4));
         assertTrue(met.isSigned(4));
-        assertEquals(22, met.getColumnDisplaySize(4));
+        assertEquals(24, met.getColumnDisplaySize(4));
         assertEquals("D", met.getColumnLabel(4));
         assertEquals("D", met.getColumnName(4));
         // beetle 5323

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java Wed Feb 20 04:42:57 2013
@@ -33,15 +33,20 @@ public class MathTrigFunctionsTest exten
 
 	private static final boolean debugFlag = false;
 
-	private static final double SMALLEST_NEG_DERBY_DOUBLE = -1.79769E+308;
+   private static final double
+            PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE = -1.79769E+308;
 
-	private static final double SMALL_NEG_DOUBLE = -1.79768E+308;
+   private static final double
+            SMALL_NEG_DOUBLE = -1.79768E+308;
 
-	private static final double SMALLEST_POS_DERBY_DOUBLE = 2.225E-307;
+   private static final double
+            PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE = 2.225E-307;
 
-	private static final double LARGEST_POS_DERBY_DOUBLE = 1.79769E+308;
+   private static final double
+            PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE = 1.79769E+308;
 
-	private static final double LARGEST_NEG_DERBY_DOUBLE = -2.225E-307;
+   private static final double
+            PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE = -2.225E-307;
 
 	private static final double[] testRadians = { -0.000000001, -0.25,
 			0.000000001, 0.25, 0.5, 0.0, 1.0, 2.0, java.lang.StrictMath.PI,
@@ -51,19 +56,26 @@ public class MathTrigFunctionsTest exten
 			0.25, -0.25, 0.5, 0.0, -0.0, 1.0, -1.0 };
 
 	private static final double[] logValues = { 0.000000001, 0.25, 0.5, 1.0,
-			45.0, 90.0, 135.0, 180.0, 270, SMALLEST_POS_DERBY_DOUBLE,
-			LARGEST_POS_DERBY_DOUBLE };
+           45.0, 90.0, 135.0, 180.0, 270, PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE,
+           PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE };
 
-	private static final double[] testValues = { SMALLEST_NEG_DERBY_DOUBLE,
-			SMALL_NEG_DOUBLE, SMALLEST_POS_DERBY_DOUBLE,
-			LARGEST_POS_DERBY_DOUBLE, LARGEST_NEG_DERBY_DOUBLE, 0.000000001,
+   private static final double[] testValues = {
+            PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE,
+            SMALL_NEG_DOUBLE,
+            PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE,
+            PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE,
+            PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE,
+            0.000000001,
 			-0.000000001, 0.25, -0.25, 0.5, 0.0, -0.0, 1.0, -1.0, 2.0, 3.0,
 			java.lang.StrictMath.PI, 2 * java.lang.StrictMath.PI, 4.0, 45.0,
 			90.0, 135.0, 180.0, 270 };
 
-	private static final double[] testValuesTwo = { SMALLEST_NEG_DERBY_DOUBLE,
-			SMALL_NEG_DOUBLE, SMALLEST_POS_DERBY_DOUBLE,
-			LARGEST_NEG_DERBY_DOUBLE, 0.000000001, -0.000000001, 0.25, -0.25,
+   private static final double[] testValuesTwo = {
+            PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE,
+           SMALL_NEG_DOUBLE,
+            PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE,
+           PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE,
+            0.000000001, -0.000000001, 0.25, -0.25,
 			0.5, 0.0, -0.0, 1.0, -1.0, 2.0, 3.0, java.lang.StrictMath.PI,
 			2 * java.lang.StrictMath.PI, 4.0, 45.0, 90.0, 135.0, 180.0, 270 };
 
@@ -477,9 +489,10 @@ public class MathTrigFunctionsTest exten
 		}
 
 		try {
-			getValue(ps, SMALLEST_NEG_DERBY_DOUBLE);
+            // Yields -Infinity, so thould throw.
+            getValue(ps, PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE);
 			fail("DEGREES: Out of range test failed, input value is: "
-					+ SMALLEST_NEG_DERBY_DOUBLE);
+                   + PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE);
 		} catch (SQLException sqlE) {
 			// "ERROR 22003: The resulting value is outside the range for the
 			// data type DOUBLE.";
@@ -488,9 +501,10 @@ public class MathTrigFunctionsTest exten
 					sqlE);
 		}
 		try {
-			getValue(psFN, SMALLEST_NEG_DERBY_DOUBLE);
+            // Yields -Infinity, so thould throw.
+            getValue(psFN, PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE);
 			fail("DEGREES: Out of range test failed, input value is: "
-					+ SMALLEST_NEG_DERBY_DOUBLE);
+                   + PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE);
 		} catch (SQLException sqlE) {
 			// "ERROR 22003: The resulting value is outside the range for the
 			// data type DOUBLE.";
@@ -503,6 +517,10 @@ public class MathTrigFunctionsTest exten
         psFN.close();
 	}
 
+    // 2.2250738585072014E-308 remove when we move to compile with source level
+    // Java 6. Cf Double.MIN_NORMAL.
+    final static double DOUBLE_MIN_NORMAL = 2.2250738585072014E-308; 
+    
 	/**
 	 * Tests the RADIANS function which converts a DOUBLE PRECISION number from
 	 * degrees to radians.
@@ -549,28 +567,26 @@ public class MathTrigFunctionsTest exten
 
 		}
 
-		try {
-			getValue(ps, SMALLEST_POS_DERBY_DOUBLE);
-			fail("RADIANS: Out of range test failed, input value is: "
-					+ SMALLEST_NEG_DERBY_DOUBLE);
-		} catch (SQLException sqlE) {
-			// "ERROR 22003: The resulting value is outside the range for the
-			// data type DOUBLE.";
-			assertSQLState(
-					SQLStateConstants.DATA_EXCEPTION_NUMERIC_VALUE_OUT_OF_RANGE,
-					sqlE);
-		}
-		try {
-			getValue(psFN, SMALLEST_POS_DERBY_DOUBLE);
-			fail("RADIANS: Out of range test failed, input value is: "
-					+ SMALLEST_NEG_DERBY_DOUBLE);
-		} catch (SQLException sqlE) {
-			// "ERROR 22003: The resulting value is outside the range for the
-			// data type DOUBLE.";
-			assertSQLState(
-					SQLStateConstants.DATA_EXCEPTION_NUMERIC_VALUE_OUT_OF_RANGE,
-					sqlE);
-		}
+        // Numbers below verified by using lava.lang.StrictMath.toRadians
+        // outside Derby context. First number: argument to ps and psFN, second
+        // number: expected result.
+        double[][] inOut = new double[][] {
+            {180.0d, java.lang.StrictMath.PI},
+            {PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE, -3.1375609430176863E306},
+            {DOUBLE_MIN_NORMAL, 3.8834864931005E-310},
+            {Double.MIN_VALUE, 0.0d},
+            {Double.MAX_VALUE, 3.1375664143845866E306},
+            {PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE, 3.88335758568738E-309},
+            {PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE, -3.88335758568738E-309},
+        };
+
+        for (int i=0; i < inOut.length; i++) {
+            double dv = getValue(ps, inOut[i][0]);
+            assertEquals(inOut[i][1], dv, 0.0d);
+            dv = getValue(psFN, inOut[i][0]);
+            assertEquals(inOut[i][1], dv, 0.0d);
+        }
+
         ps.close();
         psFN.close();
 	}
@@ -617,9 +633,9 @@ public class MathTrigFunctionsTest exten
 		}
 
 		try {
-			getValue(ps, LARGEST_POS_DERBY_DOUBLE);
+            getValue(ps, PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE);
 			fail("EXP: Out of range test failed, input value is: "
-					+ LARGEST_POS_DERBY_DOUBLE);
+                   + PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE);
 		} catch (SQLException sqlE) {
 			// "ERROR 22003: The resulting value is outside the range for the
 			// data type DOUBLE.";
@@ -628,9 +644,9 @@ public class MathTrigFunctionsTest exten
 					sqlE);
 		}
 		try {
-			getValue(psFN, LARGEST_POS_DERBY_DOUBLE);
+            getValue(psFN, PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE);
 			fail("EXP: Out of range test failed, input value is: "
-					+ LARGEST_POS_DERBY_DOUBLE);
+                   + PRE_DERBY_3398_LARGEST_POS_DERBY_DOUBLE);
 		} catch (SQLException sqlE) {
 			// "ERROR 22003: The resulting value is outside the range for the
 			// data type DOUBLE.";

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/floattypes.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/floattypes.sql?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/floattypes.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/floattypes.sql Wed Feb 20 04:42:57 2013
@@ -1056,7 +1056,7 @@ insert into fake values -11;
 
 -- ============================================================
 
--- DB2 MAX_VALUES (first succeed, second fail)
+-- DB2 MAX_VALUES (first succeed, second used to fail)
 insert into fake values( -3.4019E+38 );
 insert into fake values( -3.4021E+38 );
 insert into fake values -21;
@@ -1065,7 +1065,7 @@ insert into fake values( +3.4019E+38 ); 
 insert into fake values( +3.4021E+38 ); 
 insert into fake values -22;
 
--- DB2 MIN_VALUES (first fail, second succeed)
+-- DB2 MIN_VALUES (first used to fail, second succeed)
 insert into fake values( -1.1749E-37 ); 
 insert into fake values( -1.1751E-37 ); 
 insert into fake values -23;
@@ -1074,7 +1074,7 @@ insert into fake values( +1.1749E-37 );
 insert into fake values( +1.1751E-37 );
 insert into fake values -24;
 
--- CS (fail)
+-- CS (used to fail pre DERBY-3398)
 insert into fake values( -3.4028234E38 );
 insert into fake values( -3.40282349E38 );
 insert into fake values( -3.40282351E38 );
@@ -1133,7 +1133,7 @@ values cast(5e-37 / 1e300 as real);
 values cast(cast(0.0e0 as real) - cast(0.0e0 as real) as real);
 values cast(cast(1.0e-30 as real) - cast(1.0e-30 as real) as real);
 
--- java (and CS previously) rounded result to zero, but now gives errors like DB2 (fail)
+-- used to fail pre DERBY-3398
 values cast(cast(5e-37 as real) - cast(4e-37 as real) as real);
 values cast(5e-37 - 4e-37 as real);
 values cast(5e-37 - 4.99e-37 as real);
@@ -1172,8 +1172,8 @@ insert into t1 values -1.401298464324817
 insert into t1 values +1.40129846432481700e-46;
 select * from t1;
 
--- these 2 insert statements should raise an error msg in compat mode
--- because the values are greater db2's limits (fail)
+-- these 2 insert statements used to raise error pre DERBY-3398
+-- because the values were greater than db2's limits
 insert into t1 values 3.40282346638528860e+38;
 insert into t1 values -3.40282346638528860e+38;
 select * from t1;
@@ -1188,8 +1188,8 @@ insert into t1 values -1.401298464324817
 insert into t1 values +1.40129846432481700e-46;
 select * from t1;
 
--- these 2 insert statements raise ERROR 22003 because
--- the values are greater db2's limits (fail)
+-- these 2 insert statements used to raise error pre DERBY-3398
+-- because the values were greater than db2's limits
 insert into t1 values 3.40282346638528860e+38;
 insert into t1 values -3.40282346638528860e+38;
 select * from t1;
@@ -1238,4 +1238,4 @@ values cast ('123.' as DECIMAL(6,2));
 values cast ('1e' as DECIMAL(6,2));
 values cast ('1e1.0' as DECIMAL(6,2));
 values cast ('.3' as DECIMAL(6,2));
-values cast ('' as DECIMAL(6,2));
\ No newline at end of file
+values cast ('' as DECIMAL(6,2));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_10.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_10.java?rev=1448002&r1=1448001&r2=1448002&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_10.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_10.java Wed Feb 20 04:42:57 2013
@@ -23,27 +23,16 @@ package org.apache.derbyTesting.function
 import java.io.File;
 import java.io.IOException;
 
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.sql.CallableStatement;
-import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.sql.DataSource;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.derbyTesting.functionTests.tests.upgradeTests.helpers.DisposableIndexStatistics;
 import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
-import org.apache.derbyTesting.junit.IndexStatsUtil;
 import org.apache.derbyTesting.junit.JDBC;
-import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.SupportFilesSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
@@ -308,5 +297,221 @@ public class Changes10_10 extends Upgrad
         
         }
     }
+
+    // Old DB2 constants in Limits.java:
+    // static final float DB2_SMALLEST_REAL = -3.402E+38f;
+    // static final float DB2_LARGEST_REAL  = +3.402E+38f;
+    // static final float DB2_SMALLEST_POSITIVE_REAL = +1.175E-37f;
+    // static final float DB2_LARGEST_NEGATIVE_REAL  = -1.175E-37f;
+
+    // static final double DB2_SMALLEST_DOUBLE = -1.79769E+308d;
+    // static final double DB2_LARGEST_DOUBLE  = +1.79769E+308d;
+    // static final double DB2_SMALLEST_POSITIVE_DOUBLE = +2.225E-307d;
+    // static final double DB2_LARGEST_NEGATIVE_DOUBLE  = -2.225E-307d;
+
+    static final float[] beyondDB2Real = new float[] {
+        Float.MIN_VALUE,
+        Float.MAX_VALUE,
+        +1.174E-37f,
+        -1.174E-37f,
+        1.17549435E-38f // Float.MIN_NORMAL
+        -1.17549435E-38f // -Float.MIN_NORMAL
+    };
+
+    static final double[] beyondDB2Double = new double[] {
+        Double.MIN_VALUE,
+        Double.MAX_VALUE,
+        +2.224E-307d,
+        -2.224E-307d,
+        2.2250738585072014E-308 // Double.MIN_NORMAL
+        -2.2250738585072014E-308 // -Double.MIN_NORMAL
+    };
+
+    /**
+     * Verify upgrade behavior DERBY-3398: removing DB2 float limits
+     */
+    public  void    testFloatLimits()  throws Exception
+    {
+        Statement st = createStatement();
+        st.execute("create table d3398(r real, d double)");
+
+        PreparedStatement psInsertReal =
+            prepareStatement("insert into d3398(r) values (?)");
+        PreparedStatement psInsertDouble =
+            prepareStatement("insert into d3398(d) values (?)");
+        PreparedStatement psSelect =
+            prepareStatement("select * from d3398",
+                ResultSet.TYPE_FORWARD_ONLY,
+                ResultSet.CONCUR_UPDATABLE);
+
+        st.execute("insert into d3398 values (0.0, 0.0)");
+
+
+        switch ( getPhase() )
+        {
+        case PH_CREATE: // create with old version
+            verifyDB2Behavior(psSelect, psInsertReal, psInsertDouble, false);
+
+            break;
+        case PH_POST_SOFT_UPGRADE: // soft-downgrade: boot with old
+                                   // version after soft-upgrade
+            verifyDB2Behavior(psSelect, psInsertReal, psInsertDouble, false);
+
+            break;
+        case PH_SOFT_UPGRADE: // boot with new version and soft-upgrade
+
+            verifyDB2Behavior(psSelect, psInsertReal, psInsertDouble, true);
+
+            break;
+        case PH_HARD_UPGRADE: // boot with new version and hard-upgrade
+
+            for (int i = 0; i < beyondDB2Real.length; i++) {
+                psInsertReal.setFloat(1, beyondDB2Real[i]);
+                psInsertReal.execute();
+
+                ResultSet rs = psSelect.executeQuery();
+                rs.next();
+                rs.updateFloat(1, beyondDB2Real[i]);
+                rs.updateRow();
+                rs.close();
+            }
+
+            for (int i = 0; i < beyondDB2Double.length; i++) {
+                psInsertDouble.setDouble(1, beyondDB2Double[i]);
+                psInsertDouble.execute();
+
+                ResultSet rs = psSelect.executeQuery();
+                rs.next();
+                rs.updateDouble(2, beyondDB2Double[i]);
+                rs.updateRow();
+                rs.close();
+            }
+
+            break;
+        }
+
+        st.executeUpdate("drop table d3398");
+        st.close();
+    }
+
+    private void assertSetError(PreparedStatement ps, float fv, boolean defer)
+            throws SQLException {
+        try {
+            ps.setFloat(1, fv);
+
+            if (!defer) {
+                fail();
+            }
+
+            ps.executeUpdate();
+            fail();
+        } catch (SQLException e) {
+            assertSQLState("22003", e);
+        }
+    }
     
+    private void assertSetError(PreparedStatement ps, double dv, boolean defer)
+            throws SQLException {
+        try {
+            ps.setDouble(1, dv);
+
+            if (!defer) {
+                fail();
+            }
+
+            ps.executeUpdate();
+            fail();
+        } catch (SQLException e) {
+            assertSQLState("22003", e);
+        }
+    }
+
+
+    private void assertUpdateError(
+            PreparedStatement ps,
+            float fv,
+            boolean defer) throws SQLException {
+
+        boolean supportsForwardUpdatableResultSet = oldAtLeast( 10, 2 );
+
+        if (!supportsForwardUpdatableResultSet) {
+            return;
+        }
+
+        ResultSet rs = ps.executeQuery();
+        rs.next();
+
+        try {
+            rs.updateFloat(1, fv);
+
+            if (!defer) {
+                fail();
+            }
+
+            rs.updateRow();
+            fail();
+        } catch (SQLException e) {
+            assertSQLState("22003", e);
+        } finally {
+            rs.close();
+        }
+    }
+
+    private void assertUpdateError(
+            PreparedStatement ps,
+            double fv,
+            boolean defer) throws SQLException {
+
+        boolean supportsForwardUpdatableResultSet = oldAtLeast( 10, 2 );
+
+        if (!supportsForwardUpdatableResultSet) {
+            return;
+        }
+
+        ResultSet rs = ps.executeQuery();
+        rs.next();
+
+        try {
+            rs.updateDouble(1, fv);
+
+            if (!defer) {
+                fail();
+            }
+
+            rs.updateRow();
+            fail();
+        } catch (SQLException e) {
+            assertSQLState("22003", e);
+        } finally {
+            rs.close();
+        }
+    }
+
+    /**
+     * Check that the old DB2 limits are (still) enforced.
+     *
+     * @param defer In soft upgrade mode, the checking if deferred after
+     * DERBY-3398, i.e. instead of throwing on the DB2 limits when calling
+     * {@code ResultSet#updateXXX} or {@code PreparedStatement#setXXX}, the
+     * check throws on {@code ResultSet#updateRow}, or {#insertRow}, and
+     * similarly on {@code PreparedStatement#execute} or {@code #executeUpdate}.
+     *
+     * @throws SQLException if we see some expected error.
+     */
+    private void verifyDB2Behavior (
+            PreparedStatement psSelect,
+            PreparedStatement psInsertReal,
+            PreparedStatement psInsertDouble,
+            boolean defer) throws SQLException {
+
+        for (int i = 0; i < beyondDB2Real.length; i++) {
+            assertSetError(psInsertReal, beyondDB2Real[i], defer);
+            assertUpdateError(psSelect, beyondDB2Real[i], defer);
+        }
+
+        for (int i = 0; i < beyondDB2Double.length; i++) {
+            assertSetError(psInsertDouble, beyondDB2Double[i], defer);
+            assertUpdateError(psSelect, beyondDB2Double[i], defer);
+        }
+    }
 }



Mime
View raw message