db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r536104 - in /db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types: SQLBinary.java SQLBlob.java SQLChar.java SQLClob.java
Date Tue, 08 May 2007 06:59:51 GMT
Author: kristwaa
Date: Mon May  7 23:59:50 2007
New Revision: 536104

URL: http://svn.apache.org/viewvc?view=rev&rev=536104
Log:
DERBY-595: Using derby.language.logStatementText=true can mask certain exceptions and lead
to incorrect behavior in some cases. Merged 'derby595_v2.diff' from trunk (revision 529983).

Patch contributed by Mayuresh Nirhali.

Modified:
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBinary.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBlob.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLChar.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLClob.java

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBinary.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBinary.java?view=diff&rev=536104&r1=536103&r2=536104
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBinary.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBinary.java Mon
May  7 23:59:50 2007
@@ -1124,4 +1124,23 @@
 
                   ps.setBytes(position, getBytes());
      }
+
+    /**
+     * Gets a trace representation for debugging.
+     *
+     * @return a trace representation of this SQL DataType.
+     */
+    public final String getTraceString() throws StandardException {
+        // Check if the value is SQL NULL.
+        if (isNull()) {
+            return "NULL";
+        }
+
+        // Check if we have a stream.
+        if (getStream() != null) {
+            return (getTypeName() + "(" + getStream().toString() + ")");
+        }
+
+        return (getTypeName() + ":Length=" + getLength());
+    }
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBlob.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBlob.java?view=diff&rev=536104&r1=536103&r2=536104
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBlob.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLBlob.java Mon May
 7 23:59:50 2007
@@ -168,25 +168,6 @@
     }
 
     /**
-     * Gets a trace representation of the BLOB for debugging.
-     *
-     * @return a trace representation of the BLOB.
-     */
-    public final String getTraceString() throws StandardException {
-        // Check if the value is SQL NULL.
-        if (isNull()) {
-            return "NULL";
-        }
-
-        // Check if we have a stream.
-        if (getStream() != null) {
-            return ("BLOB(" + getStream().toString() + ")");
-        }
-
-        return ("BLOB(" + getLength() + ")");
-    }
-
-    /**
 	   Return my format identifier.
            
 	   @see org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLChar.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLChar.java?view=diff&rev=536104&r1=536103&r2=536104
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLChar.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLChar.java Mon May
 7 23:59:50 2007
@@ -2768,4 +2768,18 @@
 		this.localeFinder = localeFinder;
 	}
 
+    /**
+     * Gets a trace representation for debugging.
+     *
+     * @return a trace representation of this SQL Type.
+     */
+    public String getTraceString() throws StandardException {
+        // Check if the value is SQL NULL.
+        if (isNull()) {
+            return "NULL";
+        }
+
+        return (toString());
+    }
+
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLClob.java?view=diff&rev=536104&r1=536103&r2=536104
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/SQLClob.java Mon May
 7 23:59:50 2007
@@ -212,10 +212,10 @@
 
         // Check if we have a stream.
         if (getStream() != null) {
-            return ("CLOB(" + getStream().toString() + ")");
+            return (getTypeName() + "(" + getStream().toString() + ")");
         }
 
-        return ("CLOB(" + getLength() + ")");
+        return (getTypeName() + "(" + getLength() + ")");
     }
     
     /**



Mime
View raw message