You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by mi...@apache.org on 2005/10/06 20:07:05 UTC

svn commit: r306822 [1/2] - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/types/ engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/suites/ testing/org/apa...

Author: mikem
Date: Thu Oct  6 11:06:47 2005
New Revision: 306822

URL: http://svn.apache.org/viewcvs?rev=306822&view=rev
Log:
committing on behalf of: Sunitha Kambhampati

1. adds changes to not do materialization of the stream at normalization
- fix bug in ReaderToUTF8Stream.read(b[],,) to allow for correct reads
- changes to SQLClob to not materialize stream
- per sql standard, truncation of clobs is allowed for trailing blanks and this is the behavior of clobs in
derby today. Keep information about truncation information along with the stream. The truncation checking logic
is pushed to the stream(ReaderToUTF8Stream) and thus will be enforced only when the stream is read.
- With these changes, the stream will be read only once, driven by store layer. This is efficient.
Earlier, the stream would be converted to char array which involves the char to derby specific utf8 encoding, and then back from utf8encoding to char as part of the materialization and once again at the store layer, the char is converted to derby specific utf8encoding.

Also note, no changes have been made to existing behavior of streams for char,varchar and long varchar. This fix includes changes only for clobs.

2. Test changes
- added new test for clobs in characterStreams.java
- added new test for clob truncation in streamingColumn.java
Note, also made changes to disable logStatmentText=true (derby595 and also disabling streamTest5).
- added tests to test for insert,select,update of 2G clob and blobs, as part of the largedata suite. This test LobLimits.java will not run as part of derbyall because it needs considerable amount of disk space and also takes long time to run.I have added extra tests for blobs although it is not related to this fix and as a result have found some issues that will need to be looked into. In LobLimits.java, some tests are therefore currently disabled.
- there are existing stream tests that run as part of derbyall ( ex blobclob4BLOB.java,resultsetStream.java) that will test for clobs streaming but may not be able to catch if clobs are being materialized or not, which is why it is important to run the largedata/LobLimits at some intervals to ensure that no regression has occurred.


Ran derbyall on jdk142/win2k ok.


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LobLimits.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimits.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimits_app.properties
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/ReaderToUTF8Stream.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/copyfiles.ant
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_derby.properties

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- 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 Thu Oct  6 11:06:47 2005
@@ -24,6 +24,7 @@
 import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.error.StandardException;
 
+import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -193,6 +194,49 @@
 	{
 		throw dataTypeConversion("java.sql.Timestamp");
 	}
+    
+    
+    /**
+     * Normalization method - this method may be called when putting
+     * a value into a SQLClob, for example, when inserting into a SQLClob
+     * column.  See NormalizeResultSet in execution.
+     * Per the SQL standard ,if the clob column is not big enough to 
+     * hold the value being inserted,truncation error will result
+     * if there are trailing non-blanks. Truncation of trailing blanks
+     * is allowed.
+     * @param desiredType   The type to normalize the source column to
+     * @param sourceValue   The value to normalize
+     *
+     *
+     * @exception StandardException             Thrown for null into
+     *                                          non-nullable column, and for
+     *                                          truncation error
+     */
+
+    public void normalize(
+                DataTypeDescriptor desiredType,
+                DataValueDescriptor sourceValue)
+                    throws StandardException
+    {
+        // if sourceValue is of type clob, and has a stream,
+        // dont materialize it here (as the goal of using a stream is to
+        // not have to materialize whole object in memory in the server), 
+        // but instead truncation checks will be done when data is streamed in.
+        // (see ReaderToUTF8Stream) 
+        // if sourceValue is not a stream, then follow the same
+        // protocol as varchar type for normalization
+        if( sourceValue instanceof SQLClob)
+        {
+            SQLClob clob = (SQLClob)sourceValue;
+            if (clob.stream != null)
+            {
+                copyState(clob);
+                return;
+            }
+        }
+        
+        super.normalize(desiredType,sourceValue);
+    }
 
 	public void setValue(Time theValue, Calendar cal) throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java Thu Oct  6 11:06:47 2005
@@ -603,14 +603,7 @@
 		default:
 			throw dataTypeConversion(parameterIndex, "java.io.Reader");
 		}
-		if (length < 0) //we are doing the check here and not in setCharacterStreamInternal becuase setClob needs to pass -1 for length.
-			throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
 
-		if (reader == null)
-		{
-			setNull(parameterIndex, jdbcTypeId);
-			return;
-		}
 
 		setCharacterStreamInternal(parameterIndex, reader, length);
 	}
@@ -619,21 +612,74 @@
 						Reader reader, int length)
 	    throws SQLException
 	{
+        // currently the max number of chars that can be inserted
+        // into a clob field is Integer.MAX_INT ( 2Gb -1)
+        // setClob or setCharacterStream interfaces will eventually call 
+        // this method and in setClob, a long is casted to an int; hence
+        // check for -ve length
+        if (length < 0) 
+          throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
+      
 		checkStatus();
 
 		int jdbcTypeId = getParameterJDBCType(parameterIndex);
-
+	    
+		    
+        if (reader == null)
+        {
+            setNull(parameterIndex, jdbcTypeId);
+            return;
+        }
 
 		try {
+           
+            LimitReader limitIn = new LimitReader(reader);
 			ParameterValueSet pvs = getParms();
+            int usableLength = length;
+            ReaderToUTF8Stream utfIn = null;
 
-			LimitReader limitIn = new LimitReader(reader);
-			if (length != -1)
-				limitIn.setLimit(length);
-			ReaderToUTF8Stream utfIn = new ReaderToUTF8Stream(limitIn);
-
-			/* JDBC is one-based, DBMS is zero-based */
-			pvs.getParameterForSet(parameterIndex - 1).setValue(utfIn, length);
+            // Currently long varchar does not allow for truncation of trailing
+            // blanks.  
+            // For char and varchar types, current mechanism of materializing
+            // when using streams seems fine given their  max limits.
+            // This change is fix for DERBY-352: Insert of clobs using streams
+            // should not materialize the entire stream into memory
+            // In case of clobs, the truncation of trailing blanks is factored
+            // in when reading from the stream without materializing the entire
+            // stream, and so the special casing for clob below.
+            if (jdbcTypeId == Types.CLOB) 
+            {
+                // Need column width to figure out if truncation is needed 
+                DataTypeDescriptor dtd[] = preparedStatement
+                        .getParameterTypes();
+                int colWidth = dtd[parameterIndex - 1].getMaximumWidth();
+
+                // It is possible that the length of the stream passed in is
+                // greater than the column width, in which case the data from
+                // the stream needs to be truncated.
+                // usableLength is the length of the data from stream that can
+                // be inserted which is min(colWidth,length) provided 
+                // length - colWidth has trailing blanks only
+                if (colWidth < length)
+                    usableLength = colWidth;
+                
+                // keep information with the stream about how much data needs 
+                // to be truncated, and colWidth info to give proper truncation
+                // message
+                utfIn = new ReaderToUTF8Stream(
+                            limitIn, colWidth, length - usableLength);
+            }
+            else
+            {
+                utfIn = new ReaderToUTF8Stream(
+                            limitIn,usableLength,length - usableLength);
+            }
+
+            limitIn.setLimit(usableLength);
+
+            /* JDBC is one-based, DBMS is zero-based */
+            pvs.getParameterForSet(
+                parameterIndex - 1).setValue(utfIn,usableLength);
 
 		} catch (StandardException t) {
 			throw EmbedResultSet.noStateChangeException(t);
@@ -661,8 +707,8 @@
 		default:
 			throw dataTypeConversion(parameterIndex, "java.io.InputStream");
 		}
-		if (length < 0) //we are doing the check here and not in setBinaryStreamInternal becuase setBlob needs to pass -1 for length.
-			throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
+        if (length < 0) //we are doing the check here and not in setBinaryStreamInternal becuase setBlob needs to pass -1 for length.
+            throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
 
     	setBinaryStreamInternal(parameterIndex, x, length);
 	}
@@ -1117,7 +1163,7 @@
 		if (x == null)
 			setNull(i, Types.BLOB);
 		else
-			setBinaryStreamInternal(i, x.getBinaryStream(), -1);
+ 			setBinaryStreamInternal(i, x.getBinaryStream(), -1);
 	}
 
     /**
@@ -1144,7 +1190,23 @@
 		if (x == null)
 			setNull(i, Types.CLOB);
 		else
-			setCharacterStreamInternal(i, x.getCharacterStream(), -1);
+        {
+            // 1. max number of characters that can be inserted into a clob column
+            // is 2Gb-1 which is Integer.MAX_INT.
+            // This means that we do not allow any inserts of clobs where
+            // clob.length() > Integer.MAX_INT. For now, we cast the x.length()
+            // to int as a result. This will work ok for valid clob values that
+            // derby supports. If we ever decide to increase these limits for clobs, in that
+            // case the cast of x.Length() to int would not be appropriate.
+            // 2. Note, x.length() needs to be called before retrieving the
+            // stream using x.getCharacterStream() because EmbedClob.length()
+            // will read from the stream and drain the stream. 
+            // Hence the need to declare this local variable - streamLength
+            int streamLength = (int) x.length();
+
+            setCharacterStreamInternal(i, x.getCharacterStream(), streamLength);
+        }
+        
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java Thu Oct  6 11:06:47 2005
@@ -2566,14 +2566,6 @@
 			default:
 				throw dataTypeConversion(columnIndex, "java.io.Reader");
 		}
-		if (length < 0) //we are doing the check here and not in updateCharacterStreamInternal becuase updateClob needs to pass -1 for length.
-			throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
-
-		if (x == null)
-		{
-			updateNull(columnIndex);
-			return;
-		}
 		updateCharacterStreamInternal(columnIndex, x, length, "updateCharacterStream");
 	}
 
@@ -2582,14 +2574,66 @@
 	    throws SQLException
 	{
 		try {
-			LimitReader limitIn = new LimitReader(reader);
-			if (length != -1)
-				limitIn.setLimit(length);
-			ReaderToUTF8Stream utfIn = new ReaderToUTF8Stream(limitIn);
-			getDVDforColumnToBeUpdated(columnIndex, updateMethodName).setValue(utfIn, length);
-		} catch (StandardException t) {
-			throw noStateChangeException(t);
-		}
+
+            // currently the max number of chars that is allowed in update
+            // via updateCharacterStream or updateClob interface
+            // is Integer.MAX_INT ( 2Gb -1) for clobs.
+            // check for -ve length here 
+            if (length < 0) 
+                throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
+
+            if (reader == null)
+            {
+                updateNull(columnIndex);
+                return;
+            }
+
+            LimitReader limitIn = new LimitReader(reader);
+            
+            // length is +ve. at this point, all checks for negative
+            // length has already been done
+            int usableLength = length;
+            ReaderToUTF8Stream utfIn = null;
+
+            // Currently long varchar does not allow for truncation of
+            // trailing blanks.  For char and varchar types, current mechanism 
+            // of materializing when using streams seems fine given their max
+            // limits. This change is fix for DERBY-352: Insert of clobs using
+            // streams should not materialize the entire stream into memory
+            // In case of clobs, the truncation of trailing blanks is
+            // factored in when reading from the stream without materializing
+            // the entire stream, and so the special casing for clob below.
+            if (getColumnType(columnIndex) == Types.CLOB) {
+                // Need column width to figure out if truncation is
+                // needed
+                int colWidth = resultDescription.getColumnDescriptor(
+                        columnIndex).getType().getMaximumWidth();
+
+                // It is possible that the length of the stream passed
+                // in is greater than the column width, in which case the data
+                // from the stream needs to be truncated.
+                // usableLength is the length of the data from stream
+                // that can be used which is min(colWidth,length) provided
+                // length - colWidth has trailing blanks only
+                if (colWidth < length)
+                    usableLength = colWidth;
+
+                // keep information with the stream about how much data
+                // needs to be truncated, and colWidth info to give proper
+                // truncation message
+                utfIn = new ReaderToUTF8Stream(
+                            limitIn, colWidth,     length - usableLength);
+            } else {
+                utfIn = new ReaderToUTF8Stream(
+                            limitIn, usableLength, length - usableLength);
+            }
+
+            limitIn.setLimit(usableLength);
+            getDVDforColumnToBeUpdated(columnIndex, updateMethodName).setValue(
+                    utfIn, length);
+        } catch (StandardException t) {
+            throw noStateChangeException(t);
+        }
 	}
 
 	/**
@@ -3556,9 +3600,32 @@
             throw dataTypeConversion(columnIndex, "java.sql.Clob");
 
         if (x == null)
+        {
             updateNull(columnIndex);
+        }
         else
-            updateCharacterStreamInternal(columnIndex, x.getCharacterStream(), -1, "updateClob");
+        {
+
+            // 1. max number of characters that can be updated into a clob 
+            // column is 2Gb-1 which is Integer.MAX_INT.
+            // This means that we do not allow any updates of clobs where
+            // clob.length() > Integer.MAX_INT. For now, we cast the x.length()
+            // to int as a result. This will work ok for valid clob values that
+            // derby supports. If we ever decide to increase these limits for 
+            // clobs, in that case the cast of x.Length() to int would not be 
+            // appropriate.
+            //
+            // 2. Note, x.length() needs to be called before retrieving the
+            // stream using x.getCharacterStream() because EmbedClob.length()
+            // will read from the stream and drain the stream.
+            // Hence the need to declare this local variable to store the 
+            // length.  The cast from long to int, can make length -ve.  The 
+            // length will be checked later in updateCharacterStreamInternal
+            int length = (int)x.length();
+
+            updateCharacterStreamInternal(
+                columnIndex, x.getCharacterStream(),length, "updateClob");
+        }
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/ReaderToUTF8Stream.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/ReaderToUTF8Stream.java?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/ReaderToUTF8Stream.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/ReaderToUTF8Stream.java Thu Oct  6 11:06:47 2005
@@ -28,6 +28,7 @@
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.io.LimitReader;
+import org.apache.derby.iapi.types.TypeId;
 
 /**
 	Converts a java.io.Reader to the on-disk UTF8 format used by Cloudscape.
@@ -46,12 +47,26 @@
     // buffer to hold the data read from stream 
     // and converted to UTF8 format
     private final static int BUFSIZE = 32768;
-
-	ReaderToUTF8Stream(LimitReader reader)
+    
+    // Number of characters to truncate from this stream
+    // The SQL standard allows for truncation of trailing spaces 
+    // for clobs,varchar,char.
+    private int charsToTruncate;
+    private final char SPACE =' ';
+    
+    // this stream needs to fit into a column of colWidth
+    // if truncation error happens ,then the error message includes 
+    // information about the column width which is why this variable
+    // is needed.
+    private int colWidth;  
+    
+	ReaderToUTF8Stream(LimitReader reader,int length,int numCharsToTruncate)
 	{
 		this.reader = reader;
 		buffer = new byte[BUFSIZE];
 		blen = -1;
+        this.charsToTruncate = numCharsToTruncate;
+        this.colWidth = length;
 	}
 
 	public int read() throws IOException {
@@ -90,7 +105,8 @@
 			{
 				if (eof)
 				{
-					return readCount == 0 ? readCount : -1;
+                    // return actual number of bytes read into b[]
+					return readCount > 0 ? readCount : -1;
 				}
 				fillBuffer(0);
 				continue;
@@ -103,6 +119,7 @@
 			boff += copyBytes;
 			len -= copyBytes;
 			readCount += copyBytes;
+            off += copyBytes;
 
 		}
 
@@ -157,26 +174,59 @@
 	*/
 	private void checkSufficientData() throws IOException
 	{
-		int remainingBytes = reader.clearLimit();
-
+		// now that we finished reading from the stream; the amount
+        // of data that we can insert,start check for trailing spaces
+        if (charsToTruncate > 0)
+        {
+            reader.setLimit(charsToTruncate);
+            int c = 0;
+            do
+            {
+                c = reader.read();
+                
+                if (c < 0)
+                {
+                    break;
+                }
+                else if (c != SPACE)
+                {
+                    // throw truncation error, wont happen here for any other 
+                    // type except for clob
+                    // hence using TypeId.CLOB_NAME to avoid having to store
+                    // the type information along with this stream.
+                    throw new IOException(
+                        MessageService.getTextMessage(
+                            SQLState.LANG_STRING_TRUNCATION,
+                            TypeId.CLOB_NAME, 
+                            "XXXX", 
+                            String.valueOf(colWidth)));
+                }
+            }
+            while (c == SPACE);
+        }
+        
+        int remainingBytes = reader.clearLimit();
 		if (remainingBytes > 0)
 			throw new IOException(MessageService.getTextMessage(SQLState.SET_STREAM_INEXACT_LENGTH_DATA));
 
 		// if we had a limit try reading one more character.
-		// JDBC 3.0 states the stream muct have the correct number of characters in it.
+		// JDBC 3.0 states the stream muct have the correct number of 
+        // characters in it.
+
 		if (remainingBytes == 0) {
 			int c;
 			try
 			{
 				c = reader.read();
+               
 			}
 			catch (IOException ioe) {
 				c = -1;
 			}
 			if (c >= 0)
 				throw new IOException(MessageService.getTextMessage(SQLState.SET_STREAM_INEXACT_LENGTH_DATA));
-		}
-
+        }
+		
 		// can put the correct length into the stream.
 		if (!multipleBuffer)
 		{
@@ -214,5 +264,5 @@
        // on this stream
        return (BUFSIZE > remainingBytes ? remainingBytes : BUFSIZE);
     }
-}
+  }
 

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LobLimits.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LobLimits.out?rev=306822&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LobLimits.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LobLimits.out Thu Oct  6 11:06:47 2005
@@ -0,0 +1,103 @@
+-----------------------------------
+ START setup
+-----------------------------------
+ END setup
+-----------------------------------
+ END setup
+========================================
+START ClobTest #1  -insertClob of size = 2147483647
+Rows inserted with clob of size (2147483647) = 2
+========================================
+========================================
+START ClobTest #2 - SELECT CLOB of size = 2147483647
+Matched rows selected with clob of size(2147483647) =1
+========================================
+========================================
+START ClobTest #3 - SELECT CLOB of size = 2147483647
+Matched rows selected with clob of size(2147483647) =1
+========================================
+========================================
+START ClobTest #4 - select and then update clob of size= 2147483647 - Uses setClob api
+Rows Updated = 1
+========================================
+========================================
+START ClobTest #5.1 insert Clob of size = 104857600
+ Rows inserted with clob of size (104857600) =1
+========================================
+========================================
+START ClobTest #5.2  - SELECT CLOB of size = 104857600
+Matched rows selected with clob of size(104857600) =1
+========================================
+========================================
+START ClobTest #8.2 - select and then update clob of size= 104857600 - Uses setClob api
+Rows Updated = 1
+========================================
+========================================
+START ClobTest #6.1 insert Clob of size = 104857600
+ Rows inserted with clob of size (104857600) =1
+========================================
+========================================
+START ClobTest #6.2  - SELECT CLOB of size = 104857600
+Matched rows selected with clob of size(104857600) =1
+========================================
+========================================
+START ClobTest #7insert Clob of size = 104857600
+EXPECTED EXCEPTION - stream has trailing spaces,but stream  length is 1 less than actual length of stream
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+========================================
+START ClobTest #7insert Clob of size = 104857600
+EXPECTED EXCEPTION - stream has trailing spaces,but stream  length is 1 greater than actual length of stream
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+========================================
+START ClobTest #9.1 insert Clob of size = 104857601
+NEGATIVE TEST - Expected Exception: truncation of non-blanks not allowed
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'A truncation error was encountered trying to shrink CLOB 'XXXX' to length 104857600.: java.io.IOException'.
+========================================
+START ClobTest #9.2  - SELECT CLOB of size = 104857600
+Matched rows selected with clob of size(104857600) =0
+========================================
+========================================
+START ClobTest #10 insert Clob of size = 104857601
+NEGATIVE TEST - Expected Exception: truncation of non-blanks not allowed and stream length is one greater than actual length of the stream 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'A truncation error was encountered trying to shrink CLOB 'XXXX' to length 104857600.: java.io.IOException'.
+========================================
+START ClobTest #11 insert Clob of size = 104857601
+NEGATIVE TEST - Expected Exception: truncation of non-blanks not allowed and stream length is one less than actual length of the stream 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+Rows deleted =2
+========================================
+START ClobTest #12.1  -insertClob of size = 104857600
+NEGATIVE TEST - Expected Exception:
+EXPECTED SQL Exception: (XJ025) Input stream cannot have negative length.
+========================================
+START ClobTest #12.2 - SELECT CLOB of size = 104857600
+Matched rows selected with clob of size(104857600) =0
+========================================
+Rows deleted =2
+========================================
+START BlobTest #1insertBlob of size = 2147483647
+ Rows inserted with blob of size (2147483647) =2
+========================================
+========================================
+START BlobTest #2 - SELECT BLOB of size = 2147483647
+Matched rows selected with blob of size(2147483647) =1
+========================================
+========================================
+START BlobTest #3 - SELECT BLOB of size = 2147483647
+Matched rows selected with blob of size(2147483647) =1
+========================================
+========================================
+START BlobTest #5.1 insert Blob of size = 104857600
+ Rows inserted with blob of size (104857600) =1
+========================================
+========================================
+START BlobTest #5.2  - SELECT BLOB of size = 104857600
+Matched rows selected with blob of size(104857600) =1
+========================================
+Rows deleted =1
+Rows deleted =2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out Thu Oct  6 11:06:47 2005
@@ -181,5 +181,188 @@
 ST-CHAR-0 DONE
 ST-VARCHAR-32532 DONE
 ST-LONG VARCHAR-32700 DONE
+run test with clob column
+Test setAsciiStream into CHAR
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+1          |Lieberman ran with Gore  |23         |NULL                     |NULL       |NULL                     |NULL       
+4          |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Test setAsciiStream into VARCHAR
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+5          |NULL                     |NULL       |Lieberman ran with Gore  |23         |NULL                     |NULL       
+8          |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Test setAsciiStream into CLOB
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+9          |NULL                     |NULL       |NULL                     |NULL       |Lieberman ran with Gore  |23         
+12         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Test setCharacterStream into CHAR
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+13         |A Mississippi Republican |24         |NULL                     |NULL       |NULL                     |NULL       
+14         |Lott has apologized      |19         |NULL                     |NULL       |NULL                     |NULL       
+17         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Test setCharacterStream into VARCHAR
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XCL30) An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+18         |NULL                     |NULL       |A Mississippi Republican |24         |NULL                     |NULL       
+19         |NULL                     |NULL       |Lott has apologized      |19         |NULL                     |NULL       
+22         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Test setCharacterStream into CLOB
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED 
+EXPECTED SQL Exception: (XSDA4) An unexpected exception was thrown
+EXPECTED SQL Exception: (XJ001) Java exception: 'Input stream did not have exact amount of data as the requested length.: java.io.IOException'.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+23         |NULL                     |NULL       |NULL                     |NULL       |A Mississippi Republican |24         
+24         |NULL                     |NULL       |NULL                     |NULL       |Lott has apologized      |19         
+27         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+setAsciiStream(LONG ASCII STREAMS)
+AS-CHAR-18 DONE
+AS-VARCHAR-104 DONE
+AS-CLOB-67 DONE
+CS-CHAR-18 DONE
+CS-VARCHAR-104 DONE
+CS-CLOB-67 DONE
+ST-CHAR-18 DONE
+ST-VARCHAR-104 DONE
+ST-CLOB-67 DONE
+AS-CHAR-25 DONE
+AS-VARCHAR-16732 DONE
+AS-CLOB-14563 DONE
+CS-CHAR-25 DONE
+CS-VARCHAR-16732 DONE
+CS-CLOB-14563 DONE
+ST-CHAR-25 DONE
+ST-VARCHAR-16732 DONE
+ST-CLOB-14563 DONE
+AS-CHAR-1 DONE
+AS-VARCHAR-32433 DONE
+AS-CLOB-32673 DONE
+CS-CHAR-1 DONE
+CS-VARCHAR-32433 DONE
+CS-CLOB-32673 DONE
+ST-CHAR-1 DONE
+ST-VARCHAR-32433 DONE
+ST-CLOB-32673 DONE
+AS-CHAR-0 DONE
+AS-VARCHAR-32532 DONE
+AS-CLOB-32700 DONE
+CS-CHAR-0 DONE
+CS-VARCHAR-32532 DONE
+CS-CLOB-32700 DONE
+ST-CHAR-0 DONE
+ST-VARCHAR-32532 DONE
+ST-CLOB-32700 DONE
+setCharacterStream(LONG CHARACTER STREAMS WITH UNICODE)
+AS-CHAR-14 DONE
+AS-VARCHAR-93 DONE
+AS-CLOB-55 DONE
+CS-CHAR-14 DONE
+CS-VARCHAR-93 DONE
+CS-CLOB-55 DONE
+ST-CHAR-14 DONE
+ST-VARCHAR-93 DONE
+ST-CLOB-55 DONE
+AS-CHAR-25 DONE
+AS-VARCHAR-19332 DONE
+AS-CLOB-18733 DONE
+CS-CHAR-25 DONE
+CS-VARCHAR-19332 DONE
+CS-CLOB-18733 DONE
+ST-CHAR-25 DONE
+ST-VARCHAR-19332 DONE
+ST-CLOB-18733 DONE
+AS-CHAR-1 DONE
+AS-VARCHAR-32433 DONE
+AS-CLOB-32673 DONE
+CS-CHAR-1 DONE
+CS-VARCHAR-32433 DONE
+CS-CLOB-32673 DONE
+ST-CHAR-1 DONE
+ST-VARCHAR-32433 DONE
+ST-CLOB-32673 DONE
+AS-CHAR-0 DONE
+AS-VARCHAR-32532 DONE
+AS-CLOB-32700 DONE
+CS-CHAR-0 DONE
+CS-VARCHAR-32532 DONE
+CS-CLOB-32700 DONE
+ST-CHAR-0 DONE
+ST-VARCHAR-32532 DONE
+ST-CLOB-32700 DONE
 PASS
 Test characterStreams finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out Thu Oct  6 11:06:47 2005
@@ -98,4 +98,33 @@
 ===> testing trailing non-blanks(using setObject) length = 32703
 expected exception for data > 32700 in length
 Test 13 - long varchar truncation tests end in here
+Test 14 - clob truncation tests start from here
+===> testing(using setAsciiStream) extin/char32675trailingblanks.data length = 32675
+No truncation and hence no error
+===> testing(using setCharacterStream) extin/char32675trailingblanks.data length = 32675
+No truncation and hence no error
+===> testing trailing blanks(using setString) length = 32675
+No truncation and hence no error
+===> testing trailing blanks(using setObject) length = 32675
+No truncation and hence no error
+===> testing trailing blanks using concatenation
+No truncation and hence no error.
+===> testing(using setAsciiStream) extin/char32675.data length = 32675
+EXPECTED SQLSTATE(XSDA4): An unexpected exception was thrown
+EXPECTED SQLSTATE(XJ001): Java exception: 'A truncation error was encountered trying to shrink CLOB 'XXXX' to length 32672.: java.io.IOException'.
+===> testing(using setCharacterStream) extin/char32675.data length = 32675
+EXPECTED SQLSTATE(XSDA4): An unexpected exception was thrown
+EXPECTED SQLSTATE(XJ001): Java exception: 'A truncation error was encountered trying to shrink CLOB 'XXXX' to length 32672.: java.io.IOException'.
+===> testing trailing non-blanks(using setString) length = 32675
+expected exception for data > 32672 in length
+===> testing trailing non-blanks(using setObject) length = 32675
+expected exception for data > 32672 in length
+===> testing trailing non-blank characters using concatenation
+expected exception for data > 32672 in length
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+Test 14 - clob truncation tests end in here
 Test streamingColumn finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall Thu Oct  6 11:06:47 2005
@@ -1 +1,2 @@
 largedata/lobLengthTests.java
+largedata/LobLimits.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java?rev=306822&r1=306821&r2=306822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java Thu Oct  6 11:06:47 2005
@@ -62,7 +62,13 @@
 
 			conn.createStatement().executeUpdate("create table charstream(id int GENERATED ALWAYS AS IDENTITY primary key, c char(25), vc varchar(32532), lvc long varchar)");
 
-			setStreams(conn);
+			setStreams(conn,"LONG VARCHAR");
+
+            System.out.println("run test with clob column");
+            conn.createStatement().executeUpdate("drop table charstream");
+            conn.createStatement().executeUpdate("create table charstream(id int GENERATED ALWAYS AS IDENTITY primary key, c char(25), vc varchar(32532), lvc clob)");
+            
+            setStreams(conn,"CLOB");
 
 			conn.close();
 
@@ -98,7 +104,7 @@
             sqle = sqle.getNextException();
         }
     }
-	static void setStreams(Connection conn) throws Exception {
+	static void setStreams(Connection conn,String colType) throws Exception {
 
 		ResultSet rs;
 
@@ -149,8 +155,8 @@
 		psi.setString(1, null);
 		psi.setString(2, null);
 		psi.setString(3, null);
-		// test setAsciiStream into LONG VARCHAR
-		System.out.println("\nTest setAsciiStream into LONG VARCHAR");
+		// test setAsciiStream into lvc column
+		System.out.println("\nTest setAsciiStream into "+colType);
 		maxid = getMaxId(conn);
 		setAscii(psi, 3);
 		psq.setInt(1, maxid);
@@ -193,7 +199,7 @@
 		psi.setString(3, null);
 
 		// test setCharacterStream into LONG VARCHAR
-		System.out.println("\nTest setCharacterStream into LONG VARCHAR");
+		System.out.println("\nTest setCharacterStream into "+colType);
 		maxid = getMaxId(conn);
 		setCharacter(psi, 3);
 		psq.setInt(1, maxid);
@@ -206,16 +212,16 @@
 
 		// now insert long values using streams and check them programatically.
 		System.out.println("setAsciiStream(LONG ASCII STREAMS)");
-		checkAsciiStreams(psDel, psi, psq2, 18, 104, 67);
-		checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563);
-		checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673);
-		checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700);
+		checkAsciiStreams(psDel, psi, psq2, 18, 104, 67,colType);
+		checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563,colType);
+		checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673,colType);
+		checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700,colType);
 
 		System.out.println("setCharacterStream(LONG CHARACTER STREAMS WITH UNICODE)");
-		checkCharacterStreams(psDel, psi, psq2, 14, 93, 55);
-		checkCharacterStreams(psDel, psi, psq2, 25, 19332, 18733);
-		checkCharacterStreams(psDel, psi, psq2, 1, 32433, 32673);
-		checkCharacterStreams(psDel, psi, psq2, 0, 32532, 32700);
+		checkCharacterStreams(psDel, psi, psq2, 14, 93, 55,colType);
+		checkCharacterStreams(psDel, psi, psq2, 25, 19332, 18733,colType);
+		checkCharacterStreams(psDel, psi, psq2, 1, 32433, 32673,colType);
+		checkCharacterStreams(psDel, psi, psq2, 0, 32532, 32700,colType);
 	}
 
 	private static int getMaxId(Connection conn) throws SQLException {
@@ -408,7 +414,7 @@
 	}
 
 	private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2,
-				int cl, int vcl, int lvcl)
+				int cl, int vcl, int lvcl,String colType)
 				throws SQLException, java.io.IOException {
 
 		psDel.executeUpdate();
@@ -433,7 +439,7 @@
 		System.out.println("DONE");
 
 		is = rs.getAsciiStream(3);
-		System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("AS-"+colType+"-" + lvcl + " ");
 		c3AsciiStream.check(is, lvcl, -1);
 		System.out.println("DONE");
 
@@ -453,7 +459,7 @@
 		System.out.println("DONE");
 
 		r = rs.getCharacterStream(3);
-		System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("CS-"+colType+"-" + lvcl + " ");
 		c3AsciiStream.check(r, lvcl, -1);
 		System.out.println("DONE");
 
@@ -475,7 +481,7 @@
 		System.out.println("DONE");
 
 		r = new java.io.StringReader(rs.getString(3));
-		System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("ST-"+colType+"-" + lvcl + " ");
 		c3AsciiStream.check(r, lvcl, -1);
 		System.out.println("DONE");
 
@@ -483,7 +489,7 @@
 		}
 
 	private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2,
-				int cl, int vcl, int lvcl)
+				int cl, int vcl, int lvcl,String colType)
 				throws SQLException, java.io.IOException {
 
 		psDel.executeUpdate();
@@ -507,7 +513,7 @@
 		System.out.println("DONE");
 
 		is = rs.getAsciiStream(3);
-		System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("AS-"+colType+"-" + lvcl + " ");
 		c3Reader.check(is, lvcl, -1);
 		System.out.println("DONE");
 
@@ -527,7 +533,7 @@
 		System.out.println("DONE");
 
 		r = rs.getCharacterStream(3);
-		System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("CS-"+colType+"-" + lvcl + " ");
 		c3Reader.check(r, lvcl, -1);
 		System.out.println("DONE");
 
@@ -551,7 +557,7 @@
 
 		suv = rs.getString(3);
 		r = new java.io.StringReader(suv);
-		System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
+		System.out.print("ST-"+colType+"-" + lvcl + " ");
 		c3Reader.check(r, lvcl, -1);
 		System.out.println("DONE");