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 dj...@apache.org on 2005/12/31 04:43:39 UTC
svn commit: r360226 - in /db/derby/code/trunk/java:
engine/org/apache/derby/iapi/types/TypeId.java
testing/org/apache/derbyTesting/functionTests/master/LOB.out
Author: djd
Date: Fri Dec 30 19:43:35 2005
New Revision: 360226
URL: http://svn.apache.org/viewcvs?rev=360226&view=rev
Log:
DERBY-786 Make TypeId.variableLength() return true for CLOBs to ensure values
assigned to CLOBs are truncated correctly on a CAST.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java?rev=360226&r1=360225&r2=360226&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java Fri Dec 30 19:43:35 2005
@@ -1759,7 +1759,9 @@
}
/**
- * Is type variable length
+ * Does type hava a declared variable length (defined by the application).
+ * Examples are CHAR(10), CLOB(1M).
+ * Unbounded long types, like LONG VARCHAR return false here.
* @return boolean true if type is variable length false if not.
*/
public boolean variableLength()
@@ -1774,16 +1776,8 @@
case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
case StoredFormatIds.BLOB_TYPE_ID:
-// none of the LONG_VARCHAR types are true here...????
-// case StoredFormatIds.CLOB_TYPE_ID:
-// case StoredFormatIds.NCLOB_TYPE_ID:
- // RESOLVE: does "variableLength" here mean simply
- // that the length is variable, or that the user
- // can specify a length, such as "char(20)"? The
- // answer to that determines where XML is supposed
- // to be...
- case StoredFormatIds.XML_TYPE_ID:
- return true;
+ case StoredFormatIds.CLOB_TYPE_ID:
+ return true;
default:
return false;
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out?rev=360226&r1=360225&r2=360226&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 Fri Dec 30 19:43:35 2005
@@ -205,7 +205,7 @@
12345
1234
12345
-1234&
+12345
ij> select * from n;
ERROR 42X05: Table 'N' does not exist.
ij> -- concatenate
@@ -233,7 +233,7 @@
12345
1234
12345
-1234&
+12345
ij> select * from n where n like '12%';
ERROR 42X05: Table 'N' does not exist.
ij> select * from b where b like cast('0102%' as blob(10));
@@ -245,7 +245,7 @@
12345
1234
12345
-1234&
+12345
ij> select * from n where n like cast('12%' as nclob(10));
ERROR 0A000: Feature not implemented: NCLOB.
ij> -- cleanup