db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r529983 - in /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types: SQLBinary.java SQLBlob.java SQLChar.java SQLClob.java
Date Wed, 18 Apr 2007 11:21:36 GMT
Author: kristwaa
Date: Wed Apr 18 04:21:34 2007
New Revision: 529983

URL: http://svn.apache.org/viewvc?view=rev&rev=529983
Log:
DERBY-595: Using derby.language.logStatementText=true can mask certain exceptions and lead
to incorrect behavior in some cases. Streams will no longer be exhausted/read when logging
values.
The format of the log strings for data values in derby.log has been slightly changed.

Patch contributed by Mayuresh Nirhali.

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

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java?view=diff&rev=529983&r1=529982&r2=529983
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java Wed Apr 18
04:21:34 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/trunk/java/engine/org/apache/derby/iapi/types/SQLBlob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBlob.java?view=diff&rev=529983&r1=529982&r2=529983
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBlob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBlob.java Wed Apr 18 04:21:34
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/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java?view=diff&rev=529983&r1=529982&r2=529983
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java Wed Apr 18 04:21:34
2007
@@ -2784,4 +2784,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/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java?view=diff&rev=529983&r1=529982&r2=529983
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java Wed Apr 18 04:21:34
2007
@@ -229,10 +229,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