db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r517577 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/CrossConverters.java testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
Date Tue, 13 Mar 2007 07:45:26 GMT
Author: kahatlen
Date: Tue Mar 13 00:45:25 2007
New Revision: 517577

URL: http://svn.apache.org/viewvc?view=rev&rev=517577
Log:
DERBY-2430: setObject(int targetType, Blob source) and setObject(int
targetType, Clob source) should disallow updates on all targetTypes
except BLOB and CLOB respectively

Patch contributed by V. Narayanan.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java?view=diff&rev=517577&r1=517576&r2=517577
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java Tue Mar
13 00:45:25 2007
@@ -749,14 +749,6 @@
         switch (targetType) {
         case Types.BLOB:
             return source;
-        case Types.BINARY:
-        case Types.VARBINARY:
-        case Types.LONGVARBINARY:
-            try {
-                return source.getBytes(1L, (int) source.length());
-            } catch (java.sql.SQLException e) {
-                throw new SqlException(e);                        
-            }
         default:
             throw new SqlException(agent_.logWriter_, 
                 new ClientMessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
@@ -814,10 +806,6 @@
         switch (targetType) {
         case Types.CLOB:
             return source;
-        case Types.CHAR:
-        case Types.VARCHAR:
-        case Types.LONGVARCHAR:
-            return source.toString();
         default:
             throw new SqlException(agent_.logWriter_, 
                 new ClientMessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java?view=diff&rev=517577&r1=517576&r2=517577
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
Tue Mar 13 00:45:25 2007
@@ -254,12 +254,12 @@
         /* 3 DECIMAL       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018",
"XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
         /* 4 REAL          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
         /* 5 DOUBLE        */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
-        /* 6 CHAR          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
-        /* 7 VARCHAR       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
-        /* 8 LONGVARCHAR   */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
-        /* 9 CHAR FOR BIT  */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "22001",
"XCL12", "PASS", "XCL12", "XCL12"},
-        /* 10 VARCH. BIT   */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "22001",
"XCL12", "PASS", "XCL12", "XCL12"},
-        /* 11 LONGVAR. BIT */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "PASS", 
"XCL12", "PASS", "XCL12", "XCL12"},
+        /* 6 CHAR          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
+        /* 7 VARCHAR       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
+        /* 8 LONGVARCHAR   */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",
 "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12",  "PASS",  "PASS",  "PASS",  "XCL12",
"PASS",  "PASS", "XCL12", "XCL12"},
+        /* 9 CHAR FOR BIT  */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "PASS", "XCL12", "XCL12"},
+        /* 10 VARCH. BIT   */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "PASS", "XCL12", "XCL12"},
+        /* 11 LONGVAR. BIT */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12",
 "XCL12", "PASS", "XCL12", "XCL12"},
         /* 12 CLOB         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",
 "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12",
"XCL12", "PASS", "XCL12", "XCL12"},
         /* 13 DATE         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",
 "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "PASS",  "XCL12",
"XCL12", "PASS", "XCL12", "XCL12"},
         /* 14 TIME         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",
 "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12",
"XCL12", "PASS", "XCL12", "XCL12"},



Mime
View raw message