db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1341046 [1/6] - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/services/io/ engine/org/apache/derby/iapi/sql/ engine/org/apache/derby/iapi/types/ engine/org/apache/derby/impl/sql/execute/ shared...
Date Mon, 21 May 2012 14:30:25 GMT
Author: kahatlen
Date: Mon May 21 14:30:24 2012
New Revision: 1341046

URL: http://svn.apache.org/viewvc?rev=1341046&view=rev
Log:
DERBY-129: CAST should warn about truncation

Made subclasses of SQLChar and SQLBinary generate a DataTruncation
warning when they are truncated to a shorter value.

Pass warnings up to the statement from NoRowsResultSetImpl.

Make the network server transfer DataTruncation in a way the client
accepts.

Update test canons to expect warnings on truncation.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/CounterOutputStream.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBit.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/SQLVarbit.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dml083.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dml149.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/heapscan.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/lockTable.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readlocks.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso2multi.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardRecovery.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subqueryFlattening.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/update.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocksJDBC30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CastingTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LockTableQuery.subsql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/cast.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LockTableQuery.subsql

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Mon May 21 14:30:24 2012
@@ -2374,7 +2374,7 @@ class DRDAConnThread extends Thread {
 		writeRDBNAM(database.getDatabaseName());
 		writer.endDdm();
 		writer.startDdm(CodePoint.SQLCARD);
-		writeSQLCAGRP(e, getSqlCode(getExceptionSeverity(e)), 0, 0);
+		writeSQLCAGRP(e, 0, 0);
 		writer.endDdmAndDss();
 	}
 	/**
@@ -5910,7 +5910,7 @@ class DRDAConnThread extends Thread {
 	{
 		writer.createDssObject();
 		writer.startDdm(CodePoint.SQLCARD);
-		writeSQLCAGRP(e, getSqlCode(severity), updateCount, rowCount);
+		writeSQLCAGRP(e, updateCount, rowCount);
 		writer.endDdmAndDss();
 
 		// If we have a shutdown exception, restart the server.
@@ -6040,13 +6040,14 @@ class DRDAConnThread extends Thread {
 	 *   SQLDIAGGRP; DRDA TYPE N-GDA; ENVLID 0x56; Length Override 0
 	 *
 	 * @param e 	SQLException encountered
-	 * @param sqlcode	sqlcode
 	 * 
 	 * @exception DRDAProtocolException
 	 */
-	private void writeSQLCAGRP(SQLException e, int sqlcode, int updateCount,
-			long rowCount) throws DRDAProtocolException
+    private void writeSQLCAGRP(SQLException e, int updateCount, long rowCount)
+        throws DRDAProtocolException
 	{
+        int sqlcode = 0;
+
         if (e == null) {
             // Forwarding to the optimized version when there is no
             // exception object
@@ -6054,6 +6055,19 @@ class DRDAConnThread extends Thread {
             return;
         }
 
+        // SQLWarnings should have warning severity, except if it's a
+        // DataTruncation warning for write operations (with SQLState 22001),
+        // which is supposed to be used as an exception even though it's a
+        // sub-class of SQLWarning.
+        if (e instanceof SQLWarning &&
+                !SQLState.LANG_STRING_TRUNCATION.equals(e.getSQLState())) {
+            sqlcode = ExceptionSeverity.WARNING_SEVERITY;
+        } else {
+            // Get the SQLCODE for exceptions. Note that this call will always
+            // return -1, so the real error code will be lost.
+            sqlcode = getSqlCode(getExceptionSeverity(e));
+        }
+
 		if (rowCount < 0 && updateCount < 0)
 		{
 			writer.writeByte(CodePoint.NULLDATA);
@@ -6635,7 +6649,7 @@ class DRDAConnThread extends Thread {
 
 		// all went well we will just write a null SQLCA
 		writer.startDdm(CodePoint.SQLDARD);
-		writeSQLCAGRP(e, getSqlCode(getExceptionSeverity(e)), 0, 0);
+		writeSQLCAGRP(e, 0, 0);
 
 		if (sqlamLevel >= MGRLVL_7)
 			writeSQLDHROW(ps.getResultSetHoldability());
@@ -7123,7 +7137,7 @@ class DRDAConnThread extends Thread {
 			if (sqlw == null)
                 writeSQLCAGRP(nullSQLState, 0, -1, -1);
 			else
-				writeSQLCAGRP(sqlw, sqlw.getErrorCode(), 1, -1);
+				writeSQLCAGRP(sqlw, 1, -1);
 
             // Save the position right after the warnings so we know where to
             // insert more warnings later.
@@ -7274,7 +7288,7 @@ class DRDAConnThread extends Thread {
                 if (sqlw != null) {
                     truncated.setNextWarning(sqlw);
                 }
-                writeSQLCAGRP(truncated, CodePoint.SVRCOD_WARNING, 1, -1);
+                writeSQLCAGRP(truncated, 1, -1);
                 writer.writeBytes(data);
                 stmt.clearTruncationWarnings();
             }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/CounterOutputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/CounterOutputStream.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/CounterOutputStream.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/CounterOutputStream.java Mon May 21 14:30:24 2012
@@ -42,7 +42,7 @@ public class CounterOutputStream extends
 		so that the count is intially zero.
 	*/
 	public CounterOutputStream() {
-		super();
+        limit = -1;
 	}
 
 	public void setOutputStream(OutputStream out) {
@@ -101,26 +101,11 @@ public class CounterOutputStream extends
 			throw new EOFException();
 		}
 
-		out.write(b);
+		if (out != null) out.write(b);
 		count++;
 	}
 
 	/**
-		Add b.length to the count.
-
-		@see OutputStream#write
-	*/
-	public void write(byte b[]) throws IOException {
-		
-		if ((limit >= 0) && ((count + b.length) > limit)) {
-			throw new EOFException();
-		}
-
-		out.write(b);
-		count += b.length;
-	}
-
-	/**
 		Add len to the count, discard the data.
 
 		@see OutputStream#write
@@ -131,7 +116,7 @@ public class CounterOutputStream extends
 			throw new EOFException();
 		}
 
-		out.write(b, off, len);
+		if (out != null) out.write(b, off, len);
 		count += len;
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java Mon May 21 14:30:24 2012
@@ -335,6 +335,13 @@ public interface ResultSet
 	 */
 	public String	getCursorName();
 
+    /**
+     * Add a warning to this result set.
+     *
+     * @param w the warning to add
+     */
+    void addWarning(SQLWarning w);
+
 	/**
 		Return the set of warnings generated during the execution of
 		this result set. The warnings are cleared once this call returns.

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?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- 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 Mon May 21 14:30:24 2012
@@ -21,39 +21,37 @@
 
 package org.apache.derby.iapi.types;
 
+import org.apache.derby.iapi.sql.conn.StatementContext;
+
+import org.apache.derby.iapi.reference.ContextId;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.MessageId;
 
 import org.apache.derby.iapi.services.io.ArrayInputStream;
 
-import org.apache.derby.iapi.types.BitDataValue;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.ConcatableDataValue;
 import org.apache.derby.iapi.error.StandardException;
 
+import org.apache.derby.iapi.services.context.ContextService;
+
 import org.apache.derby.iapi.services.io.DerbyIOException;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.io.FormatIdInputStream;
+import org.apache.derby.iapi.services.io.InputStreamUtil;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.i18n.MessageService;
 
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.NumberDataValue;
-
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.SQLInteger;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
 import java.io.InputStream;
 
 import java.sql.Blob;
+import java.sql.DataTruncation;
 import java.sql.SQLException;
 import java.sql.PreparedStatement;
-import org.apache.derby.iapi.services.io.InputStreamUtil;
 
 /**
  * SQLBinary is the abstract class for the binary datatypes.
@@ -1296,5 +1294,36 @@ abstract class SQLBinary
         }
         catch (SQLException se) { throw StandardException.plainWrapException( se ); }
     }
-    
+
+    /**
+     * Truncate this value to the desired width by removing bytes at the
+     * end of the byte sequence.
+     *
+     * @param sourceWidth the original width in bytes (only used for
+     *   diagnostics, ignored if {@code warn} is {@code false})
+     * @param desiredWidth the desired width in bytes
+     * @param warn whether or not to generate a truncation warning
+     */
+    void truncate(int sourceWidth, int desiredWidth, boolean warn)
+            throws StandardException {
+        if (warn) {
+            // SQL:2003, part 2, 6.12 <cast specification>,
+            // general rule 12 says we should warn about truncation.
+            DataTruncation warning = new DataTruncation(
+                    -1,    // column index is unknown
+                    false, // parameter
+                    true,  // read
+                    getLength(), desiredWidth);
+
+            StatementContext statementContext = (StatementContext)
+                ContextService.getContext(ContextId.LANG_STATEMENT);
+            statementContext.getActivation().
+                    getResultSet().addWarning(warning);
+        }
+
+        // Truncate to the desired width.
+        byte[] shrunkData = new byte[desiredWidth];
+        System.arraycopy(getValue(), 0, shrunkData, 0, desiredWidth);
+        setValue(shrunkData);
+    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBit.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBit.java Mon May 21 14:30:24 2012
@@ -214,19 +214,11 @@ public class SQLBit
 									String.valueOf(desiredWidth));
 				}
 			}
-			//else
-			//{
-			// RESOLVE: when we have warnings, issue a warning if
-			// truncation of non-zero bits will occur
-			//}
 	
 			/*
 			** Truncate to the desired width.
 			*/
-			byte[] shrunkData = new byte[desiredWidth];
-			System.arraycopy(dataValue, 0, shrunkData, 0, desiredWidth);
-			dataValue = shrunkData;
-
+            truncate(sourceWidth, desiredWidth, !errorOnTrunc);
 		}
 	}
 

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?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- 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 Mon May 21 14:30:24 2012
@@ -236,11 +236,7 @@ public class SQLBlob extends SQLBinary
                 /*
                  * Truncate to the desired width.
                  */
-				
-
-				byte[] shrunkData = new byte[desiredWidth];
-				System.arraycopy(getBytes(), 0, shrunkData, 0, desiredWidth);
-				dataValue = shrunkData;
+				truncate(sourceWidth, desiredWidth, true);
             }
         }
     }

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?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- 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 Mon May 21 14:30:24 2012
@@ -29,14 +29,9 @@ import org.apache.derby.iapi.services.io
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.io.StreamStorable;
 import org.apache.derby.iapi.services.io.FormatIdInputStream;
+import org.apache.derby.iapi.services.io.FormatIdOutputStream;
 
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.StringDataValue;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.ConcatableDataValue;
+import org.apache.derby.iapi.reference.ContextId;
 import org.apache.derby.iapi.reference.SQLState;
 
 import org.apache.derby.iapi.error.StandardException;
@@ -44,18 +39,15 @@ import org.apache.derby.iapi.jdbc.Charac
 
 import org.apache.derby.iapi.services.cache.ClassSize;
 import org.apache.derby.iapi.services.io.ArrayInputStream;
+import org.apache.derby.iapi.services.io.CounterOutputStream;
 import org.apache.derby.iapi.services.io.InputStreamUtil;
 import org.apache.derby.iapi.util.StringUtil;
 import org.apache.derby.iapi.util.UTF8Util;
 import org.apache.derby.iapi.services.i18n.LocaleFinder;
+import org.apache.derby.iapi.sql.conn.StatementContext;
 
 import org.apache.derby.iapi.db.DatabaseContext;
 
-import org.apache.derby.iapi.types.SQLInteger;
-import org.apache.derby.iapi.types.SQLDate;
-import org.apache.derby.iapi.types.SQLTime;
-import org.apache.derby.iapi.types.SQLTimestamp;
-
 import java.io.InputStream;
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
@@ -64,6 +56,7 @@ import java.io.UTFDataFormatException;
 import java.io.EOFException;
 import java.io.Reader;
 import java.sql.Clob;
+import java.sql.DataTruncation;
 import java.sql.Date;
 import java.sql.ResultSet;
 import java.sql.PreparedStatement;
@@ -984,22 +977,33 @@ public class SQLChar
 
             if ( characterReader != null ) { c = characterReader.read(); }
             else { c = isRaw ? data[i] : lvalue.charAt(i); }
-            
-            if ((c >= 0x0001) && (c <= 0x007F))
-            {
-                out.write(c);
-            }
-            else if (c > 0x07FF)
-            {
-                out.write(0xE0 | ((c >> 12) & 0x0F));
-                out.write(0x80 | ((c >>  6) & 0x3F));
-                out.write(0x80 | ((c >>  0) & 0x3F));
-            }
-            else
-            {
-                out.write(0xC0 | ((c >>  6) & 0x1F));
-                out.write(0x80 | ((c >>  0) & 0x3F));
-            }
+
+            writeUTF(out, c);
+        }
+    }
+
+    /**
+     * Write a single character to a stream in the modified UTF-8 format.
+     *
+     * @param out the destination stream
+     * @param c the character to write
+     * @throws IOException if writing to the destination stream fails
+     */
+    private static void writeUTF(ObjectOutput out, int c) throws IOException {
+        if ((c >= 0x0001) && (c <= 0x007F))
+        {
+            out.write(c);
+        }
+        else if (c > 0x07FF)
+        {
+            out.write(0xE0 | ((c >> 12) & 0x0F));
+            out.write(0x80 | ((c >>  6) & 0x3F));
+            out.write(0x80 | ((c >>  0) & 0x3F));
+        }
+        else
+        {
+            out.write(0xC0 | ((c >>  6) & 0x1F));
+            out.write(0x80 | ((c >>  0) & 0x3F));
         }
     }
 
@@ -1914,9 +1918,38 @@ readingLoop:
             /*
             ** Check whether any non-blank characters will be truncated.
             */
-            if (errorOnTrunc)
+            try {
                 hasNonBlankChars(getString(), desiredWidth, sourceWidth);
-            //RESOLVE: should issue a warning instead
+            } catch (StandardException se) {
+                if (errorOnTrunc) {
+                    throw se;
+                }
+
+                // Generate a truncation warning, as specified in SQL:2003,
+                // part 2, 6.12 <cast specification>, general rules 10)c)2)
+                // and 11)c)2).
+
+                // Data size and transfer size need to be in bytes per
+                // DataTruncation javadoc.
+                String source = getString();
+                int transferSize = getUTF8Length(source, 0, desiredWidth);
+                int dataSize = transferSize +
+                        getUTF8Length(source, desiredWidth, source.length());
+
+                DataTruncation warning = new DataTruncation(
+                    -1,     // column index is unknown
+                    false,  // parameter
+                    true,   // read
+                    dataSize,
+                    transferSize);
+
+                warning.initCause(se);
+
+                StatementContext statementContext = (StatementContext)
+                    ContextService.getContext(ContextId.LANG_STATEMENT);
+                statementContext.getActivation().
+                        getResultSet().addWarning(warning);
+            }
 
             /*
             ** Truncate to the desired width.
@@ -1926,6 +1959,33 @@ readingLoop:
         return;
     }
 
+    /**
+     * Get the number of bytes needed to represent a string in modified
+     * UTF-8, which is the encoding used by {@code writeExternal()} and
+     * {@code writeUTF()}.
+     *
+     * @param string the string whose length to calculate
+     * @param start start index (inclusive)
+     * @param end end index (exclusive)
+     */
+    private int getUTF8Length(String string, int start, int end)
+            throws StandardException {
+        CounterOutputStream cs = new CounterOutputStream();
+
+        try {
+            FormatIdOutputStream out = new FormatIdOutputStream(cs);
+            for (int i = start; i < end; i++) {
+                writeUTF(out, string.charAt(i));
+            }
+            out.close();
+        } catch (IOException ioe) {
+            throw StandardException.newException(
+                    SQLState.LANG_IO_EXCEPTION, ioe, ioe.toString());
+        }
+
+        return cs.getCount();
+    }
+
     /*
     ** SQL Operators
     */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarbit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarbit.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarbit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarbit.java Mon May 21 14:30:24 2012
@@ -138,19 +138,11 @@ public class SQLVarbit extends SQLBit
 									String.valueOf(desiredWidth));
 				}
 			}
-			//else
-			//{
-			// RESOLVE: when we have warnings, issue a warning if
-			// truncation of non-zero bits will occur
-			//}
 	
 			/*
 			** Truncate to the desired width.
 			*/
-			byte[] shrunkData = new byte[desiredWidth];
-			System.arraycopy(dataValue, 0, shrunkData, 0, desiredWidth);
-			dataValue = shrunkData;
-
+            truncate(sourceWidth, desiredWidth, !errorOnTrunc);
 		}
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java Mon May 21 14:30:24 2012
@@ -1018,7 +1018,7 @@ implements NoPutResultSet
         }
     }
 
-	protected final void addWarning(SQLWarning w) {
+	public final void addWarning(SQLWarning w) {
 
 		if (isTopResultSet) {
 			if (warnings == null)
@@ -1031,10 +1031,10 @@ implements NoPutResultSet
 		if (activation != null) {
 
 			ResultSet rs = activation.getResultSet();
-			if (rs instanceof BasicNoPutResultSetImpl) {
-				((BasicNoPutResultSetImpl) rs).addWarning(w);
-			}
 
+            if (rs != null) {
+                rs.addWarning(w);
+            }
 		}
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java Mon May 21 14:30:24 2012
@@ -21,15 +21,14 @@
 
 package org.apache.derby.impl.sql.execute;
 
+import java.sql.SQLWarning;
 import java.sql.Timestamp;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.loader.GeneratedMethod;
-import org.apache.derby.iapi.services.monitor.Monitor;
 import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.iapi.sql.ResultDescription;
@@ -45,7 +44,6 @@ import org.apache.derby.iapi.sql.execute
 import org.apache.derby.iapi.sql.execute.ResultSetStatisticsFactory;
 import org.apache.derby.iapi.sql.execute.RunTimeStatistics;
 import org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.iapi.types.DataValueDescriptor;
 
 /**
@@ -757,7 +755,14 @@ abstract class NoRowsResultSetImpl imple
 		return false;
 	}
 
-	public java.sql.SQLWarning getWarnings() {
+    public void addWarning(SQLWarning w) {
+        // We're not returning a (JDBC) ResultSet, so add the warning to
+        // the Activation so that it's included in the warning chain of the
+        // executing Statement.
+        getActivation().addWarning(w);
+    }
+
+	public SQLWarning getWarnings() {
 		return null;
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java Mon May 21 14:30:24 2012
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.sql.execute;
 
+import java.sql.SQLWarning;
 import java.sql.Timestamp;
 
 import org.apache.derby.iapi.error.StandardException;
@@ -1306,7 +1307,12 @@ class TemporaryRowHolderResultSet implem
 		catch (CloneNotSupportedException e) {}
 		return clo;
 	}
-	public java.sql.SQLWarning getWarnings() {
+
+    public void addWarning(SQLWarning w) {
+        getActivation().addWarning(w);
+    }
+
+	public SQLWarning getWarnings() {
 		return null;
 	}
 

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java Mon May 21 14:30:24 2012
@@ -1327,7 +1327,7 @@ public interface SQLState {
 	String LANG_CURSOR_ALREADY_EXISTS                                  = "X0X60.S";
 	String LANG_INDEX_COLUMN_NOT_EQUAL                                 = "X0X61.S";
 	String LANG_INCONSISTENT_ROW_LOCATION                              = "X0X62.S";
-	String LANG_FILE_ERROR                                             = "X0X63.S";
+	String LANG_IO_EXCEPTION                                           = "X0X63.S";
 	String LANG_COLUMN_NOT_ORDERABLE_DURING_EXECUTION                  = "X0X67.S";
 	String LANG_OBJECT_NOT_FOUND_DURING_EXECUTION                      = "X0X81.S";
 	String LANG_NON_KEYED_INDEX                                        = "X0X85.S";

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out Mon May 21 14:30:24 2012
@@ -180,6 +180,7 @@ ij> insert into b values(cast(X'01020304
 1 row inserted/updated/deleted
 ij> insert into b values(cast(X'010203040506' as blob(5)));
 1 row inserted/updated/deleted
+WARNING 01004: Data truncation
 ij> -- clob/nclob
 --   ok in spite of not being cast
 insert into c values('1234');
@@ -201,6 +202,7 @@ ij> insert into c values(cast('12345' as
 1 row inserted/updated/deleted
 ij> insert into c values(cast('123456' as clob(5)));
 1 row inserted/updated/deleted
+WARNING 01004: Data truncation
 ij> insert into n values(cast('1234' as nclob(5)));
 ERROR 0A000: Feature not implemented: NCLOB.
 ij> insert into n values(cast('12345' as nclob(5)));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out Mon May 21 14:30:24 2012
@@ -36,7 +36,7 @@ ij> --
 create view lock_table as
 select 
     cast(username as char(8)) as username,
-    cast(t.type as char(8)) as trantype,
+    cast(t.type as char(15)) as trantype,
     cast(l.type as char(8)) as type,
     cast(lockcount as char(3)) as cnt,
     mode,
@@ -98,9 +98,9 @@ ij> ------------------------------------
 insert into heap_only values (1);
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
 ij> commit;
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out Mon May 21 14:30:24 2012
@@ -37,7 +37,7 @@ ij> --
 create view lock_table as
 select 
     cast(username as char(8)) as username,
-    cast(t.type as char(8)) as trantype,
+    cast(t.type as char(15)) as trantype,
     cast(l.type as char(8)) as type,
     cast(lockcount as char(3)) as cnt,
     mode,
@@ -99,8 +99,8 @@ ij> ------------------------------------
 insert into heap_only values (1);
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
 ij> commit;
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out Mon May 21 14:30:24 2012
@@ -36,7 +36,7 @@ ij> --
 create view lock_table as
 select 
     cast(username as char(8)) as username,
-    cast(t.type as char(8)) as trantype,
+    cast(t.type as char(15)) as trantype,
     cast(l.type as char(8)) as type,
     cast(lockcount as char(3)) as cnt,
     mode,
@@ -98,9 +98,9 @@ ij> ------------------------------------
 insert into heap_only values (1);
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
 ij> commit;
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out Mon May 21 14:30:24 2012
@@ -36,7 +36,7 @@ ij> --
 create view lock_table as
 select 
     cast(username as char(8)) as username,
-    cast(t.type as char(8)) as trantype,
+    cast(t.type as char(15)) as trantype,
     cast(l.type as char(8)) as type,
     cast(lockcount as char(3)) as cnt,
     mode,
@@ -98,9 +98,9 @@ ij> ------------------------------------
 insert into heap_only values (1);
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
 ij> commit;
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out Mon May 21 14:30:24 2012
@@ -64,7 +64,7 @@ ij> --
 create view lock_table as
 select 
     cast(username as char(8)) as username,
-    cast(t.type as char(8)) as trantype,
+    cast(t.type as char(15)) as trantype,
     cast(l.type as char(8)) as type,
     cast(lockcount as char(3)) as cnt,
     mode,
@@ -132,8 +132,8 @@ select a, b from a;
 A          |B          
 -----------------------
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from one row heap table
@@ -141,18 +141,18 @@ ij> ------------------------------------
 insert into a values (1, -1, PADSTRING('one',1900));
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
 ij> commit;
 ij> select a, b from a;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from two row heap table - this will release one row lock as it
@@ -167,8 +167,8 @@ A          |B          
 1          |-1         
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from three row heap table (multiple pages) - this will release 
@@ -181,20 +181,20 @@ ij> insert into a values (4, -4, PADSTRI
 ij> insert into a values (5, -5, PADSTRING('two',1900));
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
 ij> commit;
 ij> delete from a where a.a = 3;
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
 ij> commit;
 ij> select a,b from a;
 A          |B          
@@ -204,8 +204,8 @@ A          |B          
 4          |-4         
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full read cursor scan over all the rows in the heap, no group fetch.
@@ -225,59 +225,59 @@ ij> get cursor scan_cursor as
 ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
 0 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
 0 rows inserted/updated/deleted
 ij> --------------------------------------------------------------------------------
@@ -298,51 +298,51 @@ ij> get cursor scan_cursor as
 ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
 0 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full cursor scan over all the rows in the heap, with default group fetch
@@ -350,51 +350,51 @@ ij> ------------------------------------
 get cursor scan_cursor as
     'select a, b from a';
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full cursor for update scan over all the rows in the heap, 
@@ -403,56 +403,56 @@ ij> ------------------------------------
 get cursor scan_cursor as
     'select a, b from a for update';
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full read cursor scan on a join over all the rows in the btree, 
@@ -485,8 +485,8 @@ select a, b from a;
 A          |B          
 -----------------------
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from one row index'd table
@@ -494,18 +494,18 @@ ij> ------------------------------------
 insert into a values (5, -5, PADSTRING('five',1900), 5, PADSTRING('negative five',2000));
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
 ij> commit;
 ij> select a, b from a;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from two row indexed heap table - this will release one row
@@ -520,8 +520,8 @@ A          |B          
 4          |-4         
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test select from three row indexed heap table (multiple pages) - this will
@@ -534,20 +534,20 @@ ij> insert into a values (2, -2, PADSTRI
 ij> insert into a values (1, -1, PADSTRING('one',1900),   1, PADSTRING('negtive one',2000));
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
 ij> commit;
 ij> delete from a where a.a = 3;
 1 row inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |2   |X   |A           |(3,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |2   |X   |A           |(3,6)     |GRANT|ACTIVE  
 ij> commit;
 ij> select a,b from a;
 A          |B          
@@ -557,8 +557,8 @@ A          |B          
 4          |-4         
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full read cursor scan over all the rows in the indexed heap, 
@@ -580,59 +580,59 @@ ij> get cursor scan_cursor as
 ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
 0 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
-APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTransaction|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> --------------------------------------------------------------------------------
 -- Test full cursor scan over all the rows in the index , 2 row group fetch.
 --------------------------------------------------------------------------------
@@ -651,51 +651,51 @@ ij> get cursor scan_cursor as
 ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
 0 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test full cursor scan over all the rows in the index, with default group
@@ -712,51 +712,51 @@ ij> commit;
 ij> get cursor scan_cursor as
     'select a, b from a';
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 1          |-1         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 2          |-2         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 4          |-4         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 A          |B          
 -----------------------
 5          |-5         
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> next scan_cursor;
 No current row
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
 ij> close scan_cursor;
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
 ij> commit;
 ij> --------------------------------------------------------------------------------
 -- Test getting index lock on a drop index - track 1634
@@ -774,10 +774,11 @@ ij> commit;
 ij> drop index a2;
 0 rows inserted/updated/deleted
 ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
-USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
----------------------------------------------------------------------------
-APP     |UserTran|TABLE   |1   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
-APP     |UserTran|TABLE   |3   |X   |A           |Tablelock |GRANT|ACTIVE  
+USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+----------------------------------------------------------------------------------
+APP     |UserTransaction|TABLE   |1   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+WARNING 01004: Data truncation
+APP     |UserTransaction|TABLE   |3   |X   |A           |Tablelock |GRANT|ACTIVE  
 ij> commit;
 ij> drop table a;
 0 rows inserted/updated/deleted

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out?rev=1341046&r1=1341045&r2=1341046&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out Mon May 21 14:30:24 2012
@@ -391,12 +391,14 @@ create table tmp (x int, y smallint);
 0 rows inserted/updated/deleted
 ij> insert into tmp (x, y) select avg(i), avg(s) from t;
 1 row inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
 0          |107   
 ij> insert into tmp (x, y) select avg(i), avg(s) from t group by b;
 3 rows inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
@@ -1077,12 +1079,14 @@ create table tmp (x int, y smallint);
 0 rows inserted/updated/deleted
 ij> insert into tmp (x, y) select count(i), count(c) from t;
 1 row inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
 15         |15    
 ij> insert into tmp (x, y) select count(i), count(c) from t group by b;
 3 rows inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
@@ -1684,12 +1688,14 @@ create table tmp (x int, y smallint);
 0 rows inserted/updated/deleted
 ij> insert into tmp (x, y) select sum(i), sum(s) from t;
 1 row inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
 1          |1600  
 ij> insert into tmp (x, y) select sum(i), sum(s) from t group by b;
 3 rows inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y     
 ------------------
@@ -2247,12 +2253,14 @@ create table tmp (x int, y char(20));
 0 rows inserted/updated/deleted
 ij> insert into tmp (x, y) select max(i), max(c) from t;
 1 row inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y                   
 --------------------------------
 1          |goodbye             
 ij> insert into tmp (x, y) select max(i), max(c) from t group by b;
 3 rows inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y                   
 --------------------------------
@@ -2778,12 +2786,14 @@ create table tmp (x int, y char(20));
 0 rows inserted/updated/deleted
 ij> insert into tmp (x, y) select min(i), min(c) from t;
 1 row inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y                   
 --------------------------------
 0          |duplicate           
 ij> insert into tmp (x, y) select min(i), min(c) from t group by b;
 3 rows inserted/updated/deleted
+WARNING 01003: Null values were eliminated from the argument of a column function.
 ij> select * from tmp;
 X          |Y                   
 --------------------------------



Mime
View raw message