db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r612576 [1/2] - in /db/derby/code/branches/10.3/java: client/org/apache/derby/client/am/ engine/org/apache/derby/catalog/types/ engine/org/apache/derby/iapi/services/io/ engine/org/apache/derby/iapi/sql/compile/ engine/org/apache/derby/iapi...
Date Wed, 16 Jan 2008 21:46:57 GMT
Author: mamta
Date: Wed Jan 16 13:46:54 2008
New Revision: 612576

URL: http://svn.apache.org/viewvc?rev=612576&view=rev
Log:
Merging changes (revision 612525) from trunk into 10.3 codeline. Had to undo the changes
to TypeDescriptorImpl becase trunk has a method isStringType in TypeDescriptorImpl but
10.3 codeline does not have it. Other than that, the merge from trunk into 10.3 worked
fine. The tests on 10.3 codeline ran fine on Windows XP machine with Sun's jdk14.

The commit comments for trunk were as follows
DERBY-2720 and DERBY-3315
Removing the disabled national character related code. This will make it easy to maintain
the territory based code.


Removed:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLNClob.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLNationalChar.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLNationalLongvarchar.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLNationalVarchar.java
Modified:
    db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/PreparedStatement.java
    db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Types.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/RegisteredFormatIds.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DTSClassInfo.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/Like.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLChar.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/TypeId.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/Util.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CLOBTypeCompiler.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ModifyColumnNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/TypeCompilerFactoryImpl.java

Modified: db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/PreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/PreparedStatement.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/PreparedStatement.java (original)
+++ db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/PreparedStatement.java Wed Jan 16 13:46:54 2008
@@ -2454,9 +2454,9 @@
         //
         // Throws: (...) SQLFeatureNotSupportedException - if
         // targetSqlType is a ARRAY, BLOB, CLOB, DATALINK,
-        // JAVA_OBJECT, NCHAR, NCLOB, NVARCHAR, LONGNVARCHAR, REF,
-        // ROWID, SQLXML or STRUCT data type and the JDBC driver does
-        // not support this data type
+        // JAVA_OBJECT, LONGNVARCHAR, REF, ROWID, SQLXML or 
+    	// STRUCT data type and the JDBC driver does not
+        // support this data type
         //
         // Of these types, we only support BLOB, CLOB and
         // (sort of) JAVA_OBJECT.
@@ -2464,9 +2464,6 @@
         switch (dataType) {
         case java.sql.Types.ARRAY:
         case java.sql.Types.DATALINK:
-        case JDBC40Translation.NCHAR:
-        case JDBC40Translation.NCLOB:
-        case JDBC40Translation.NVARCHAR:
         case JDBC40Translation.LONGNVARCHAR:
         case java.sql.Types.REF:
         case JDBC40Translation.ROWID:

Modified: db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Types.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Types.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Types.java (original)
+++ db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Types.java Wed Jan 16 13:46:54 2008
@@ -107,10 +107,6 @@
             // Types we don't support:
             case java.sql.Types.ARRAY: return "ARRAY";
             case java.sql.Types.DATALINK: return "DATALINK";
-            case JDBC40Translation.NCHAR: return "NATIONAL CHAR";
-            case JDBC40Translation.NCLOB: return "NCLOB";
-            case JDBC40Translation.NVARCHAR: return "NATIONAL CHAR VARYING";
-            case JDBC40Translation.LONGNVARCHAR: return "LONG NVARCHAR";
             case java.sql.Types.REF: return "REF";
             case JDBC40Translation.ROWID: return "ROWID";
             case JDBC40Translation.SQLXML: return "SQLXML";

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java Wed Jan 16 13:46:54 2008
@@ -159,11 +159,8 @@
 
           case StoredFormatIds.CHAR_TYPE_ID_IMPL:
           case StoredFormatIds.VARCHAR_TYPE_ID_IMPL:
-          case StoredFormatIds.NATIONAL_CHAR_TYPE_ID_IMPL:
-          case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID_IMPL:
           case StoredFormatIds.BLOB_TYPE_ID_IMPL:
           case StoredFormatIds.CLOB_TYPE_ID_IMPL:
-          case StoredFormatIds.NCLOB_TYPE_ID_IMPL:
                 retval += "(" + td.getMaximumWidth() + ")";
                 break;
 
@@ -343,30 +340,6 @@
                 SQLTypeName = TypeId.CLOB_NAME;
                 JDBCTypeId = JDBC20Translation.SQL_TYPES_CLOB;
                 wrapperTypeFormatId = StoredFormatIds.CLOB_TYPE_ID;
-                break;
-
-          case StoredFormatIds.NATIONAL_CHAR_TYPE_ID_IMPL:
-                SQLTypeName = TypeId.NATIONAL_CHAR_NAME;
-                JDBCTypeId = Types.CHAR;
-                wrapperTypeFormatId = StoredFormatIds.NATIONAL_CHAR_TYPE_ID;
-                break;
-
-          case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID_IMPL:
-                SQLTypeName = TypeId.NATIONAL_VARCHAR_NAME;
-                JDBCTypeId = Types.VARCHAR;
-                wrapperTypeFormatId = StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID;
-                break;
-
-          case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID_IMPL:
-                SQLTypeName = TypeId.NATIONAL_LONGVARCHAR_NAME;
-                JDBCTypeId = Types.LONGVARCHAR;
-                wrapperTypeFormatId = StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID;
-                break;
-
-         case StoredFormatIds.NCLOB_TYPE_ID_IMPL:
-                SQLTypeName = TypeId.NCLOB_NAME;
-                JDBCTypeId = JDBC20Translation.SQL_TYPES_CLOB;
-                wrapperTypeFormatId = StoredFormatIds.NCLOB_TYPE_ID;
                 break;
 
           case StoredFormatIds.BIT_TYPE_ID_IMPL:

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java Wed Jan 16 13:46:54 2008
@@ -40,9 +40,6 @@
                   case StoredFormatIds.CHAR_TYPE_ID_IMPL:
                   case StoredFormatIds.VARCHAR_TYPE_ID_IMPL:
                   case StoredFormatIds.LONGVARCHAR_TYPE_ID_IMPL:
-                  case StoredFormatIds.NATIONAL_CHAR_TYPE_ID_IMPL:
-                  case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID_IMPL:
-                  case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID_IMPL:
                   case StoredFormatIds.BIT_TYPE_ID_IMPL:
                   case StoredFormatIds.VARBIT_TYPE_ID_IMPL:
                   case StoredFormatIds.LONGVARBIT_TYPE_ID_IMPL:
@@ -51,7 +48,6 @@
                   case StoredFormatIds.TIMESTAMP_TYPE_ID_IMPL:
                   case StoredFormatIds.BLOB_TYPE_ID_IMPL:
                   case StoredFormatIds.CLOB_TYPE_ID_IMPL:
-                  case StoredFormatIds.NCLOB_TYPE_ID_IMPL:
                   case StoredFormatIds.XML_TYPE_ID_IMPL:
                           return new BaseTypeIdImpl(fmtId);
                   case StoredFormatIds.DECIMAL_TYPE_ID_IMPL:

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/RegisteredFormatIds.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/RegisteredFormatIds.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/RegisteredFormatIds.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/RegisteredFormatIds.java Wed Jan 16 13:46:54 2008
@@ -414,15 +414,15 @@
         /* 359 */       "org.apache.derby.impl.sql.depend.DepClassInfo",
         /* 360 */       "org.apache.derby.impl.store.access.btree.index.B2IStaticCompiledInfo",
         /* 361 */       null, // SQLData marker
-        /* 362 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter
-        /* 363 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter,
-        /* 364 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter,
-        /* 365 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter,
-        /* 366 */       "org.apache.derby.catalog.types.TypesImplInstanceGetter",
-        /* 367 */       "org.apache.derby.catalog.types.TypesImplInstanceGetter",
-        /* 368 */       "org.apache.derby.catalog.types.TypesImplInstanceGetter",
-        /* 369 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter
-        /* 370 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter
+        /* 362 */       null,
+        /* 363 */       null,
+        /* 364 */       null,
+        /* 365 */       null,
+        /* 366 */       null,
+        /* 367 */       null,
+        /* 368 */       null,
+        /* 369 */       null,
+        /* 370 */       null,
         /* 371 */       "org.apache.derby.impl.sql.catalog.CoreDDFinderClassInfo",             // InstanceGetter
         /* 372 */       null,
         /* 373 */       null,
@@ -508,9 +508,9 @@
 
     /// --- NLOB is copying NATIONAL LONGVARCHAR in implementation
         
-        /* 448 */   "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter
-        /* 449 */       "org.apache.derby.catalog.types.TypesImplInstanceGetter",
-        /* 450 */       "org.apache.derby.iapi.types.DTSClassInfo", //InstanceGetter,
+        /* 448 */   null,
+        /* 449 */   null,
+        /* 450 */   null,
 
         /* 451 */   "org.apache.derby.catalog.types.RoutineAliasInfo",
 		/* 452 */   null,

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java Wed Jan 16 13:46:54 2008
@@ -559,26 +559,26 @@
     /**
         class org.apache.derby.iapi.types.NationalCharTypeId
      */
-    static public final int NATIONAL_CHAR_TYPE_ID =
-            (MIN_ID_2 + 370);
+    //static public final int NATIONAL_CHAR_TYPE_ID =
+            //(MIN_ID_2 + 370);
     
     /**
         class org.apache.derby.iapi.types.NationalLongvarcharTypeId
      */
-    static public final int NATIONAL_LONGVARCHAR_TYPE_ID =
-            (MIN_ID_2 + 362);
+    //static public final int NATIONAL_LONGVARCHAR_TYPE_ID =
+            //(MIN_ID_2 + 362);
     
     /**
         class org.apache.derby.iapi.types.NationalLongvarcharTypeId
      */
-    static public final int NCLOB_TYPE_ID = 
-            (MIN_ID_2 + 448);
+    //static public final int NCLOB_TYPE_ID = 
+            //(MIN_ID_2 + 448);
     
     /**
         class org.apache.derby.iapi.types.NationalVarcharTypeId
      */
-    static public final int NATIONAL_VARCHAR_TYPE_ID =
-            (MIN_ID_2 + 369);
+    //static public final int NATIONAL_VARCHAR_TYPE_ID =
+            //(MIN_ID_2 + 369);
 
     /**
     class org.apache.derby.impl.sql.catalog.SchemaDescriptorFinder
@@ -851,26 +851,26 @@
     /**
         class org.apache.derby.catalog.types.NationalCharTypeIdImpl
      */
-    static public final int NATIONAL_CHAR_TYPE_ID_IMPL =
-            (MIN_ID_2 + 366);
+    //static public final int NATIONAL_CHAR_TYPE_ID_IMPL =
+            //(MIN_ID_2 + 366);
 
     /**
         class org.apache.derby.catalog.types.NationalVarcharTypeIdImpl
      */
-    static public final int NATIONAL_VARCHAR_TYPE_ID_IMPL =
-            (MIN_ID_2 + 367);
+    //static public final int NATIONAL_VARCHAR_TYPE_ID_IMPL =
+            //(MIN_ID_2 + 367);
 
     /**
         class org.apache.derby.catalog.types.NationalLongVarcharTypeIdImpl
      */
-    static public final int NATIONAL_LONGVARCHAR_TYPE_ID_IMPL =
-            (MIN_ID_2 + 368);
+    //static public final int NATIONAL_LONGVARCHAR_TYPE_ID_IMPL =
+            //(MIN_ID_2 + 368);
     
     /**
         class org.apache.derby.catalog.types.NationalLongVarcharTypeIdImpl
      */
-    static public final int NCLOB_TYPE_ID_IMPL =
-            (MIN_ID_2 + 449);
+    //static public final int NCLOB_TYPE_ID_IMPL =
+            //(MIN_ID_2 + 449);
     
     /**
         class org.apache.derby.iapi.types.XML (implementation of
@@ -1533,17 +1533,17 @@
     public static final int SQL_BLOB_ID =
             (MIN_ID_2 + 443);
 
-    public static final int SQL_NATIONAL_CHAR_ID = 
-            (MIN_ID_2 + 363);
+    //public static final int SQL_NATIONAL_CHAR_ID = 
+            //(MIN_ID_2 + 363);
 
-    public static final int SQL_NATIONAL_VARCHAR_ID = 
-            (MIN_ID_2 + 364);
+    //public static final int SQL_NATIONAL_VARCHAR_ID = 
+            //(MIN_ID_2 + 364);
 
-    public static final int SQL_NATIONAL_LONGVARCHAR_ID = 
-            (MIN_ID_2 + 365);
+    //public static final int SQL_NATIONAL_LONGVARCHAR_ID = 
+            //(MIN_ID_2 + 365);
 
-    public static final int SQL_NCLOB_ID = 
-            (MIN_ID_2 + 450);
+    //public static final int SQL_NCLOB_ID = 
+            //(MIN_ID_2 + 450);
 
     // Interface: org.apache.derby.iapi.types.XMLDataValue
     public static final int XML_ID = 

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java Wed Jan 16 13:46:54 2008
@@ -206,7 +206,7 @@
     // LOB
     static final int BLOB_CONSTANT_NODE = 195;
     static final int CLOB_CONSTANT_NODE = 196;
-    static final int NCLOB_CONSTANT_NODE = 197;
+    //static final int NCLOB_CONSTANT_NODE = 197;
     // for SAVEPOINT sql
     static final int SAVEPOINT_NODE = 198;
 

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java Wed Jan 16 13:46:54 2008
@@ -165,14 +165,6 @@
 	 */
 	String getPrimitiveMethodName();
 
-
-	/**
-	 * Get the name of the matching national char type.
-	 *
-	 * @return The name of the matching national char type.
-	 */
-	String getMatchingNationalCharTypeName();
-
 	/**
 	 * Generate the code necessary to produce a SQL null of the appropriate
 	 * type. The stack must contain a DataValueFactory and a null or a value

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DTSClassInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DTSClassInfo.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DTSClassInfo.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DTSClassInfo.java Wed Jan 16 13:46:54 2008
@@ -48,9 +48,6 @@
                 case StoredFormatIds.LONGINT_TYPE_ID: 
                 case StoredFormatIds.LONGVARBIT_TYPE_ID: 
                 case StoredFormatIds.LONGVARCHAR_TYPE_ID: 
-                case StoredFormatIds.NATIONAL_CHAR_TYPE_ID: 
-                case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID: 
-                case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID: 
                 case StoredFormatIds.REAL_TYPE_ID: 
                 case StoredFormatIds.REF_TYPE_ID: 
                 case StoredFormatIds.SMALLINT_TYPE_ID: 
@@ -62,7 +59,6 @@
                 case StoredFormatIds.VARCHAR_TYPE_ID: 
                 case StoredFormatIds.BLOB_TYPE_ID:
                 case StoredFormatIds.CLOB_TYPE_ID:
-                case StoredFormatIds.NCLOB_TYPE_ID:
                 case StoredFormatIds.XML_TYPE_ID:
                         return new TypeId(fmtId);
                 default:

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java Wed Jan 16 13:46:54 2008
@@ -1198,12 +1198,9 @@
 
 			case StoredFormatIds.CHAR_TYPE_ID:
 			case StoredFormatIds.VARCHAR_TYPE_ID:
-			case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-			case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
 				return (double) (2.0 * getMaximumWidth());
 
 			case StoredFormatIds.LONGVARCHAR_TYPE_ID:
-			case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
 				/* Who knows? Let's just use some big number */
 				return 10000.0;
 

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactory.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactory.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactory.java Wed Jan 16 13:46:54 2008
@@ -239,35 +239,6 @@
          */
         StringDataValue getClobDataValue(String value, StringDataValue previous,
                 int collationType) throws StandardException;
-        
-        /**
-         * Get a SQL national varchar with the given value.  A null argument means get
-         * a SQL null value.  The second form uses the previous value (if non-null)
-         * to hold the return value.
-         */
-        StringDataValue         getNationalVarcharDataValue(String value);
-        StringDataValue         getNationalVarcharDataValue(String value,
-                                                                                        StringDataValue previous)
-                                                                                                        throws StandardException;
-
-        /**
-         * Get a SQL national long varchar with the given value.  A null argument means
-         * get a SQL null value.  The second form uses the previous value
-         * (if non-null) to hold the return value.
-         */
-        StringDataValue         getNationalLongvarcharDataValue(String value);
-        StringDataValue         getNationalLongvarcharDataValue(String value,
-                                                                                                StringDataValue previous)
-                                                                                                        throws StandardException;
-
-        /**
-         * Get a SQL national blob with the given value.  A null argument means
-         * get a SQL null value.  The second form uses the previous value
-         * (if non-null) to hold the return value.
-         */
-        StringDataValue         getNClobDataValue(String value);
-        StringDataValue         getNClobDataValue(String value, StringDataValue previous) 
-            throws StandardException;
 
         /**
          * Get a User-defined data value with the given value and type name.
@@ -427,15 +398,6 @@
                 int collationType) throws StandardException;
 
         /**
-         * Get a SQL national char with the given value.  A null argument means get
-         * a SQL null value.  The second form re-uses the previous value,
-         * if non-null, as the data holder to return.
-         */
-        StringDataValue         getNationalCharDataValue(String value);
-        StringDataValue         getNationalCharDataValue(String value, StringDataValue previous)
-                                                        throws StandardException;
-
-        /**
          * Get a SQL date with the given value.  A null argument means get
          * a SQL null value.  The second form re-uses the previous value,
          * if non-null, as the data holder to return.
@@ -694,37 +656,6 @@
          */
         StringDataValue         getNullClob(StringDataValue dataValue,
                 int collationType);
-
-        /**
-         * Get a SQL national char with a SQL null value. If the supplied value
-         * is null then get a new value, otherwise set it to null and return 
-         * that value.
-         */
-        StringDataValue         getNullNationalChar(StringDataValue dataValue);
-
-        /**
-         * Get a SQL national varchar with a SQL null value. If the supplied value
-         * is null then get a new value, otherwise set it to null and return 
-         * that value.
-         *
-         */
-        StringDataValue         getNullNationalVarchar(StringDataValue dataValue);
-
-        /**
-         * Get a SQL national long varchar with a SQL null value. If the supplied value
-         * is null then get a new value, otherwise set it to null and return 
-         * that value.
-         *
-         */
-        StringDataValue         getNullNationalLongvarchar(StringDataValue dataValue);
-
-        /**
-         * Get a SQL NCLOB with a SQL null value. If the supplied value
-         * is null then get a new value, otherwise set it to null and return 
-         * that value.
-         *
-         */
-        StringDataValue         getNullNClob(StringDataValue dataValue);
 
         /**
          * Get a User-defined data value with a SQL null value. If the supplied value

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java Wed Jan 16 13:46:54 2008
@@ -551,66 +551,6 @@
             return previous;
         }
 
-        //
-        public StringDataValue getNationalCharDataValue(String value)
-        {
-                return new SQLNationalChar(value, getLocaleFinder());
-        }
-
-        public StringDataValue getNationalCharDataValue(String value,
-                                                                                        StringDataValue previous)
-                                                                                                        throws StandardException
-        {
-                if (previous == null)
-                        return new SQLNationalChar(value, getLocaleFinder());
-                previous.setValue(value);
-                return previous;
-        }
-
-        public StringDataValue getNationalVarcharDataValue(String value)
-        {
-                return new SQLNationalVarchar(value, getLocaleFinder());
-        }
-
-        public StringDataValue getNationalVarcharDataValue(String value,
-                                                                                                StringDataValue previous)
-                                                                                                        throws StandardException
-        {
-                if (previous == null)
-                        return new SQLNationalVarchar(value, getLocaleFinder());
-                previous.setValue(value);
-                return previous;
-        }
-
-        public StringDataValue getNationalLongvarcharDataValue(String value)
-        {
-                return new SQLNationalLongvarchar(value, getLocaleFinder());
-        }
-
-        public StringDataValue getNationalLongvarcharDataValue(String value,
-                                                                                                        StringDataValue previous)
-                                                                                                        throws StandardException
-        {
-                if (previous == null)
-                        return new SQLNationalLongvarchar(value, getLocaleFinder());
-                previous.setValue(value);
-                return previous;
-        }
-
-        public StringDataValue getNClobDataValue(String value)
-        {
-                return new SQLNClob(value, getLocaleFinder());
-        }
-
-        public StringDataValue getNClobDataValue(String value, StringDataValue previous)
-            throws StandardException
-        {
-                if (previous == null)
-                        return new SQLNClob(value, getLocaleFinder());
-                previous.setValue(value);
-                return previous;
-        }
-
         public DateTimeDataValue getDataValue(Date value) throws StandardException
         {
                 return new SQLDate(value);
@@ -977,58 +917,6 @@
             return previous;
         }
 
-        public StringDataValue          getNullNationalChar(StringDataValue dataValue)
-        {
-                if (dataValue == null)
-                {
-                        return getNationalCharDataValue((String) null);
-                }
-                else
-                {
-                        dataValue.setToNull();
-                        return dataValue;
-                }
-        }
-
-        public StringDataValue          getNullNationalVarchar(StringDataValue dataValue)
-        {
-                if (dataValue == null)
-                {
-                        return getNationalVarcharDataValue((String) null);
-                }
-                else
-                {
-                        dataValue.setToNull();
-                        return dataValue;
-                }
-        }
-
-        public StringDataValue          getNullNationalLongvarchar(StringDataValue dataValue)
-        {
-                if (dataValue == null)
-                {
-                        return getNationalLongvarcharDataValue((String) null);
-                }
-                else
-                {
-                        dataValue.setToNull();
-                        return dataValue;
-                }
-        }
-
-        public StringDataValue          getNullNClob(StringDataValue dataValue)
-        {
-                if (dataValue == null)
-                {
-                        return getNClobDataValue((String) null);
-                }
-                else
-                {
-                        dataValue.setToNull();
-                        return dataValue;
-                }
-        }
-
         public UserDataValue            getNullObject(UserDataValue dataValue)
         {
                 if (dataValue == null)
@@ -1257,9 +1145,6 @@
         case StoredFormatIds.SQL_DOUBLE_ID: return new SQLDouble();
         case StoredFormatIds.SQL_INTEGER_ID: return new SQLInteger();
         case StoredFormatIds.SQL_LONGINT_ID: return new SQLLongint();
-        case StoredFormatIds.SQL_NATIONAL_CHAR_ID: return new SQLNationalChar();
-        case StoredFormatIds.SQL_NATIONAL_LONGVARCHAR_ID: return new SQLNationalLongvarchar();
-        case StoredFormatIds.SQL_NATIONAL_VARCHAR_ID: return new SQLNationalVarchar();
         case StoredFormatIds.SQL_REAL_ID: return new SQLReal();
         case StoredFormatIds.SQL_REF_ID: return new SQLRef();
         case StoredFormatIds.SQL_SMALLINT_ID: return new SQLSmallint();
@@ -1273,7 +1158,6 @@
         case StoredFormatIds.SQL_USERTYPE_ID_V3: return new UserType();
         case StoredFormatIds.SQL_BLOB_ID: return new SQLBlob();
         case StoredFormatIds.SQL_CLOB_ID: return new SQLClob();
-        case StoredFormatIds.SQL_NCLOB_ID: return new SQLNClob();
         case StoredFormatIds.XML_ID: return new XML();
         case StoredFormatIds.ACCESS_HEAP_ROW_LOCATION_V1_ID: 
         // This is an specific implementation of RowLocation, known to be

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/Like.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/Like.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/Like.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/Like.java Wed Jan 16 13:46:54 2008
@@ -89,37 +89,8 @@
 				escapeLength, collator);
 	}
 
-	/**
-		For national chars.
-		@param val value to compare. if null, result is null.
-		@param valLength length of val
-		@param pat pattern to compare. if null, result is null.
-		@param patLength length of pat
-		@param escape escape character. Must be 1 char long.
-			if null, no escape character is used.
-		@param escapeLength length of escape
-		@param collator	The collator to use.
-
-		@return null if val or pat null, otherwise true if match
-		and false if not.
-		@exception StandardException thrown if data invalid
-	 */
-	public static Boolean like
-	(
-		int[] 	val, 
-		int 	valLength, 
-		int[] 	pat, 
-		int 	patLength, 
-		int[] 	escape,
-		int 	escapeLength,
-		RuleBasedCollator collator
-	) throws StandardException 
-	{
-		return like(val, 0, valLength, pat, 0, patLength, escape, escapeLength, collator);
-	}
-
 	/* For character string types with UCS_BASIC and territory based
-	 * collation. There is a different method for non-national chars */
+	 * collation. */
 	private static Boolean like
 	(
 		char[] 	val, 
@@ -306,236 +277,8 @@
 	    return collator.compare(s1, s2) == 0; 
 	}
 
-	/* national chars */
-	private static Boolean like
-	(
-		int[] 	val, 
-		int 	vLoc, 	// start at val[vLoc]
-		int 	vEnd, 	// end at val[vEnd]
-		int[] 	pat, 
-		int 	pLoc, 	// start at pat[pLoc]
-		int 	pEnd, 	// end at pat[pEnd]
-		int[] 	escape,
-		int 	escapeLength,
-		RuleBasedCollator	collator
-	) throws StandardException 
-	{
-		int[] escCharInts = null;
-		boolean haveEsc = true;
-		int[] anyCharInts = new int[1];	// assume only 1 int
-		int[] anyStringInts = new int[1];	// assume only 1 int
-		
-		if (val == null) return null;
-		if (pat == null) return null;
-
-		if (escape == null)
-		{
-			haveEsc = false;
-		}
-		else
-		{
-			escCharInts = escape;
-		}
-
-		Boolean result;
-
-		// get the collation integer representing "_"
-		CollationElementIterator cei =
-									collator.getCollationElementIterator("_");
-		anyCharInts[0] = cei.next();
-		{
-			int nextInt;
-
-			// There may be multiple ints representing this character
-			while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)
-			{
-				int[] temp = new int[anyCharInts.length + 1];
-				for (int index = 0; index < anyCharInts.length; index++)
-				{
-					temp[index] = anyCharInts[index];
-				}
-				temp[anyCharInts.length] = nextInt;
-				anyCharInts = temp;
-			}
-		}
-		// get the collation integer representing "%"
-		cei = collator.getCollationElementIterator("%");
-		anyStringInts[0] = cei.next();
-		{
-			int nextInt;
-
-			// There may be multiple ints representing this character
-			while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)
-			{
-				int[] temp = new int[anyStringInts.length + 1];
-				for (int index = 0; index < anyStringInts.length; index++)
-				{
-					temp[index] = anyStringInts[index];
-				}
-				temp[anyStringInts.length] = nextInt;
-				anyStringInts = temp;
-			}
-		}
-
-		while (true) 
-		{
-			// returns null if more work to do, otherwise match Boolean
-			result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd, anyStringInts);
-			if (result != null) 
-				return result;
-
-			// go until we get a special char in the pattern or hit EOS
-			while ( (! matchSpecial(pat, pLoc, pEnd, anyCharInts)) &&
-					(! matchSpecial(pat, pLoc, pEnd, anyStringInts)) &&
-					((! haveEsc)
-						|| (! matchSpecial(pat, pLoc, pEnd, escCharInts))))
-			{
-				if (val[vLoc] == pat[pLoc]) 
-				{
-					vLoc++; pLoc++;
-	
-					result = checkLengths(vLoc, vEnd, pLoc,
-								pat, pEnd, anyStringInts);
-					if (result != null) 
-					{
-						return result;
-					}
-				}
-				else 
-				{
-					return Boolean.FALSE;
-				}
-			}
-
-			// deal with escCharInt first, as it can be escaping a special char
-			// and can be a special char itself.
-			if (haveEsc && matchSpecial(pat, pLoc, pEnd, escCharInts))
-			{
-				pLoc += escCharInts.length;
-				if (pLoc == pEnd) 
-				{
-					throw StandardException.newException(
-						SQLState.LANG_INVALID_ESCAPE_SEQUENCE);
-				}
-
-				int[] specialInts = null;
-				if (matchSpecial(pat, pLoc, pEnd, escCharInts))
-				{
-					specialInts = escCharInts;
-				}
-				if (matchSpecial(pat, pLoc, pEnd, anyCharInts))
-				{
-					specialInts = anyCharInts;
-				}
-				if (matchSpecial(pat, pLoc, pEnd, anyStringInts))
-				{
-					specialInts = anyStringInts;
-				}
-				if (specialInts == null)
-				{
-					throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_SEQUENCE);
-				}
-				// regardless of the char in pat, it must match exactly:
-				for (int index = 0; index < specialInts.length; index++)
-				{
-					if (val[vLoc + index] != pat[pLoc + index])
-					{
-						return Boolean.FALSE;
-					}
-				}
-
-				vLoc += specialInts.length; 
-				pLoc += specialInts.length; 
-	
-				// returns null if more work to do, otherwise match Boolean
-				result = checkLengths(vLoc, vEnd,
-						pLoc, pat, pEnd, anyStringInts);
-
-				if (result != null) 
-					return result;
-			}
-			else if (matchSpecial(pat, pLoc, pEnd, anyCharInts))
-			{
-				// regardless of the char, it matches
-				vLoc += anyCharInts.length; 
-				pLoc += anyCharInts.length; 
-	
-				result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd, anyStringInts);
-				if (result != null) 
-					return result;
-			}
-			else if (matchSpecial(pat, pLoc, pEnd, anyStringInts))
-			{
-				// catch the simple cases -- end of the pattern or of the string
-				if (pLoc+1 == pEnd)
-					return Boolean.TRUE;
-
-				// would return true, but caught in checkLengths above
-				if (SanityManager.DEBUG)
-					SanityManager.ASSERT(vLoc!=vEnd, 
-						"Should have been found already");
-
-				if (vLoc == vEnd)
-					return Boolean.TRUE;
-
-				// check if remainder of pattern is anyString's
-				// if escChar == anyString, we couldn't be here
-				// If there is an escape in the pattern we break
-				boolean allPercentChars = true;
-				for (int i=pLoc+1;i<pEnd;i++)
-				{
-					if (! matchSpecial(pat, i, pEnd, anyStringInts))
-					{
-						allPercentChars=false;
-						break;
-					}
-				}
-				if (allPercentChars)
-					return Boolean.TRUE;
-
-				// pattern can match 0 or more chars in value.
-				// to test that, we take the remainder of pattern and
-				// apply it to ever-shorter  remainders of value until
-				// we hit a match.
-
-				// the loop never continues from this point -- we will
-				// always generate an answer here.
-
-				// REMIND: there are smarter ways to pick the remainders
-				// and do this matching.
-
-				// num chars left in value includes current char
-				int vRem = vEnd - vLoc;
-
-				int n=0;
-
-				// num chars left in pattern excludes the anyString
-				int minLen = getMinLen(pat, pLoc+1, pEnd, haveEsc, escCharInts, anyStringInts);
-				for (int i=vRem; i>=minLen; i--) 
-				{
-					Boolean restResult = Like.like(val,vLoc+n,vLoc+n+i,pat,pLoc+1,pEnd,escape,escapeLength, collator);
-					if (SanityManager.DEBUG)
-					{
-						if (restResult == null)
-						{
-							SanityManager.THROWASSERT("null result on like(vLoc+n = "+(vLoc+n)+", i = "+i+
-													  ", pLoc+1 = " + (pLoc+1) + ", pEnd-(pLoc+1) = " + 
-													  (pEnd-(pLoc+1)) + ")");
-						}
-					}
-					if (restResult.booleanValue())
-						return restResult;
-
-					n++;
-				}
-				// none of the possibilities worked 
-				return Boolean.FALSE;
-			}
-		}
-	}
-
 	/**
-		Calculate the shortest length string that could match this pattern for non-national chars
+		Calculate the shortest length string that could match this pattern
 	 */
 	static int getMinLen(char[] pattern, int pStart, int pEnd, boolean haveEsc, char escChar) 
 	{
@@ -557,33 +300,7 @@
 	}
 
 	/**
-		Calculate the shortest length string that could match this pattern for national chars
-	 */
-	static int getMinLen(int[] pattern, int pStart, int pEnd, boolean haveEsc, 
-						 int[] escCharInts, int[] anyStringInts) 
-	{
-		int m=0;
-		for (int l = pStart; l<pEnd; ) 
-		{
-			if (haveEsc && matchSpecial(pattern, l, pEnd, escCharInts))
-			{ 
-				l += escCharInts.length + 1;
-				m += escCharInts.length;
-			}
-			else if (matchSpecial(pattern, l, pEnd, anyStringInts)) 
-			{
-				l += anyStringInts.length; // anyString, nothing needed
-			}
-			else 
-			{ // anyChar or other chars, need one char
-				l++; m++;
-			}
-		}
-		return m;
-	}
-
-	/**
-	 * checkLengths -- non-national chars 
+	 * checkLengths  
 	 *
 	 * Returns null if we are not done.
 	 * Returns true if we are at the end of our value and pattern
@@ -626,49 +343,6 @@
 	}
 
 	/**
-	 * checkLengths -- national chars 
-	 *
-	 * Returns null if we are not done.
-	 * Returns true if we are at the end of our value and pattern
-	 * Returns false if there is more pattern left but out of input value
-	 *
-	 * @param vLoc current index into int[] val
-	 * @param vEnd end index or our value
-	 * @param pLoc current index into our int[] pattern
-	 * @param pat  pattern int []
-	 * @param pEnd end index of our pattern []
-	 */
-
-	static Boolean checkLengths(int vLoc, int vEnd,
-			int pLoc, int[] pat, int pEnd, int[] anyStringInts) 
-	{
-		if (vLoc == vEnd) 
-		{
-			if (pLoc == pEnd) 
-			{
-				return Boolean.TRUE;
-			}
-			else 
-			{
-				// if remainder of pattern is anyString chars, ok
-				for (int i=pLoc; i<pEnd; i += anyStringInts.length) 
-				{
-					if (! matchSpecial(pat, i, pEnd, anyStringInts))
-					{
-						return Boolean.FALSE;
-					}
-				}
-				return Boolean.TRUE;
-			}
-		}
-		else if (pLoc == pEnd)
-		{
-			return Boolean.FALSE; // ran out of pattern
-		}
-		else return null; // still have strings to match, not done
-	}
-
-	/**
 	 * matchSpecial
 	 *
 	 *	check the pattern against the various special character arrays.
@@ -698,8 +372,7 @@
 
 	/*
 		Most typical interface for character string types with UCS_BASIC and 
-		territory based collation. There is a different method for non-national 
-		chars.
+		territory based collation.
 	 */
 	public static Boolean like(char[] value, int valueLength, char[] pattern, 
 			int patternLength, RuleBasedCollator collator) 
@@ -707,16 +380,6 @@
 		if (value == null || pattern == null) return null;
 		return like(value, valueLength, pattern, patternLength, null, 0, 
 				collator);
-	}
-
-	/*
-		Most typical interface for national chars
-	 */
-	public static Boolean like(int[] value, int valueLength, int[] pattern, int patternLength, RuleBasedCollator collator) 
-		throws StandardException 
-	{ 
-		if (value == null || pattern == null) return null;
-		return like(value, valueLength, pattern, patternLength, null, 0, collator);
 	}
 
 	// Methods for LIKE transformation at preprocess time:

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLChar.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLChar.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLChar.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/SQLChar.java Wed Jan 16 13:46:54 2008
@@ -346,9 +346,6 @@
 					// free up this char[] array to reduce memory usage
 					rawData = null;
 					rawLength = -1;
-					// clear out the int array as well, so it will stay current
-					intArray = null;
-					intLength = 0;
 					cKey = null;
 				}
 
@@ -412,9 +409,6 @@
 			getString();
 			rawData = value.toCharArray();
 			rawLength = rawData.length;
-			// clear out the int array as well, so it will stay current
-			intArray = null;
-			intLength = 0;
 			cKey = null;
 			return rawData;
 		}
@@ -436,9 +430,6 @@
 		this.value = null;
 		this.rawLength = -1;
 		this.stream = newStream;
-		// clear out the int array as well, so it will stay current
-		intArray = null;
-		intLength = 0;
 		cKey = null;
 	}
 
@@ -635,9 +626,6 @@
         value  = null;
         stream = null;
 
-        // clear out the int array, so it will stay current
-        intArray = null;
-        intLength = 0;
         cKey = null;
     }
     char[][] arg_passer = new char[1][];
@@ -825,9 +813,6 @@
         rawData = str;
         rawLength = strlen;
                         
-        // clear out the int array, so it will stay current
-        intArray = null;
-        intLength = 0;
         cKey = null;
     }
 
@@ -852,9 +837,6 @@
 		value = null;
 		stream = null;
 		rawLength = -1;
-		// clear out the int array as well, so it will stay current
-		intArray = null;
-		intLength = 0;
 		cKey = null;
 	}
 
@@ -1008,9 +990,6 @@
 	{
 		stream = null;
 		rawLength = -1;
-		// clear out the int array as well, so it will stay current
-		intArray = null;
-		intLength = 0;
 		cKey = null;
 
 		value = theValue;
@@ -1680,29 +1659,17 @@
 	{
 		Boolean likeResult;
 
-		if (! isNationalString())
-		{
-			// note that we call getLength() because the length
-			// of the char array may be different than the
-			// length we should be using (i.e. getLength()).
-			// see getCharArray() for more info
-			char[] evalCharArray = getCharArray();
-			char[] patternCharArray = ((SQLChar)pattern).getCharArray();
-			likeResult = Like.like(evalCharArray, 
-								   getLength(),
- 		    					   patternCharArray,
-								   pattern.getLength(),
-								   null);
-		}
-		else
-		{
-			SQLChar patternSQLChar = (SQLChar) pattern;
-			likeResult = Like.like(getIntArray(), 
-					getIntLength(), 
-					patternSQLChar.getIntArray(),
-					patternSQLChar.getIntLength(),
-					getLocaleFinder().getCollator());
-		}
+		// note that we call getLength() because the length
+		// of the char array may be different than the
+		// length we should be using (i.e. getLength()).
+		// see getCharArray() for more info
+		char[] evalCharArray = getCharArray();
+		char[] patternCharArray = ((SQLChar)pattern).getCharArray();
+		likeResult = Like.like(evalCharArray, 
+							   getLength(),
+		    					   patternCharArray,
+							   pattern.getLength(),
+							   null);
 
 		return SQLBoolean.truthValue(this,
 									 pattern,
@@ -1743,61 +1710,27 @@
 			throw StandardException.newException(SQLState.LANG_ESCAPE_IS_NULL);
 		}
 
-		if (! isNationalString())
-		{
-			// note that we call getLength() because the length
-			// of the char array may be different than the
-			// length we should be using (i.e. getLength()).
-			// see getCharArray() for more info
-			char[] evalCharArray = getCharArray();
-			char[] patternCharArray = ((SQLChar)pattern).getCharArray();
-			char[] escapeCharArray = (((SQLChar) escape).getCharArray());
-			int escapeLength = escape.getLength();
-
-			if (escapeCharArray != null && escapeLength != 1 )
-			{
-				throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_CHARACTER,
-						new String(escapeCharArray));
-			}
-			else 
-			{
-			  // Make sure we fail for both varchar an nvarchar
-			  // for multiple collation characters.
-			  SQLChar escapeSQLChar = (SQLChar) escape;
-			  int[] escapeIntArray = escapeSQLChar.getIntArray();
-			  if (escapeIntArray != null && (escapeIntArray.length != 1))
-			  {
-				throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_CHARACTER,new String(escapeSQLChar.getCharArray()));
-			  }
-			}
-			likeResult = Like.like(evalCharArray, 
-								   getLength(),
- 		    					   patternCharArray,
-								   pattern.getLength(),
-								   escapeCharArray,
-								   escapeLength,
-								   null);
-		}
-		else
-		{
-			SQLChar patternSQLChar = (SQLChar) pattern;
-			SQLChar escapeSQLChar = (SQLChar) escape;
-			int[] escapeIntArray = escapeSQLChar.getIntArray();
-			int escapeLength = escapeSQLChar.getIntLength();
-
-			if (escapeIntArray != null && (escapeIntArray.length != 1))
-			{
-				throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_CHARACTER,
-						new String(escapeSQLChar.getCharArray()));
-			}
-			likeResult = Like.like(getIntArray(),
-					getIntLength(), 
-					patternSQLChar.getIntArray(),
-					patternSQLChar.getIntLength(),
-					escapeIntArray,
-					escapeLength,
-					getLocaleFinder().getCollator());
-		}
+		// note that we call getLength() because the length
+		// of the char array may be different than the
+		// length we should be using (i.e. getLength()).
+		// see getCharArray() for more info
+		char[] evalCharArray = getCharArray();
+		char[] patternCharArray = ((SQLChar)pattern).getCharArray();
+		char[] escapeCharArray = (((SQLChar) escape).getCharArray());
+		int escapeLength = escape.getLength();
+
+		if (escapeCharArray != null && escapeLength != 1 )
+		{
+			throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_CHARACTER,
+					new String(escapeCharArray));
+		}
+		likeResult = Like.like(evalCharArray, 
+							   getLength(),
+		    					   patternCharArray,
+							   pattern.getLength(),
+							   escapeCharArray,
+							   escapeLength,
+							   null);
 
 		return SQLBoolean.truthValue(this,
 									 pattern,
@@ -2336,9 +2269,7 @@
 	}
 
 	/** 
-	 * Compare two SQLChars.  This method will be overriden in the
-	 * National char wrappers so that the appropriate comparison
-	 * is done.
+	 * Compare two SQLChars.  
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
@@ -2459,38 +2390,6 @@
 		*/
 		return 0;
 	}
-
-
-	/**
-	 * Compare a localized string with this one.
-	 *
-	 * @param str2              The other string
-	 *
-	 * @return  -1 - this <  str2
-	 * 			 0 - this == str2
-	 *			 1 - this > str2
-	 */
-	protected int stringCollatorCompare(SQLChar str2) 
-		throws StandardException
-	{	
-		CollationKey ckey1 = this.getCollationKey();
-		CollationKey ckey2 = str2.getCollationKey();
-
-		
-		/*
-		** By convention, nulls sort High, and null == null
-		*/
-		if (ckey1 == null || ckey2 == null)
-		{
-			if (ckey1 != null)	// str2 == null
-				return -1;
-			if (ckey2 != null)	// this == null
-				return 1;
-			return 0;			// both == null
-		}
-
-		return ckey1.compareTo(ckey2);
-	}
 		
 	/**
 	 * This method gets called for the collation sensitive char classes ie
@@ -2607,90 +2506,9 @@
 	}
 
 	/**
-	 * Implementation of hashCode() for the national character types,
-	 * put here to make it accessible to all the national types.
-	 */
-	protected int nationalHashCode()
-	{
-		CollationKey tmpCKey = null;
-
-		try
-		{
-			tmpCKey = getCollationKey();
-		}
-		catch (StandardException se)
-		{
-			if (SanityManager.DEBUG)
-			{
-				SanityManager.THROWASSERT("Unexpected exception", se);
-			}
-		}
-
-		if (tmpCKey == null)
-			return 0;
-		return tmpCKey.hashCode();
-	}
-	
-	private int[] getIntArray()
-		throws StandardException
-	{
-		if (isNull())
-		{
-			return (int[]) null;
-		}
-
-		if (intArray != null)
-		{
-			return intArray;
-		}
-
-		// intLength should always be 0 when intArray is null
-		if (SanityManager.DEBUG)
-		{
-			if (intLength != 0)
-			{
-				SanityManager.THROWASSERT(
-					"intLength expected to be 0, not " + intLength);
-			}
-		}
-
-		intArray = new int[getLength()];
-
-		RuleBasedCollator rbc = getLocaleFinder().getCollator();
-		CollationElementIterator cei = rbc.getCollationElementIterator(getString());
-		int nextInt;
-		while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)
-		{
-			/* Believe it or not, a String might have more
-			 * collation elements than characters.
-			 * So, we handle that case by increasing the int array
-			 * by 5 and copying array elements.
-			 */
-			if (intLength == intArray.length)
-			{
-				int[] tempArray = intArray;
-				intArray = new int[intLength + 5];
-				for (int index = 0; index < tempArray.length; index++)
-				{
-					intArray[index] = tempArray[index];
-				}
-			}
-			intArray[intLength++] = nextInt;
-		}
-
-		return intArray;
-	}
-
-	private int getIntLength()
-	{
-		return intLength;
-	}
-
-	/**
 	 * Get a SQLVarchar for a built-in string function.  
-	 * (Could be either a SQLVarchar or SQLNationalVarchar.)
 	 *
-	 * @return a SQLVarchar or SQLNationalVarchar.
+	 * @return a SQLVarchar.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
@@ -2699,54 +2517,6 @@
 		return new SQLVarchar();
 	}
 
-	/** 
-	 * Return whether or not this is a national character datatype.
-	 */
-	protected boolean isNationalString()
-	{
-		return false;
-	}
-
-	/**
-	 * This implements getDate() for the national types. It lives
-	 * here so it can be shared between all the national types.
-	 *
-	 * @exception StandardException thrown on failure to convert
-	 */
-	protected Date	nationalGetDate( Calendar cal) throws StandardException
-	{
-		if (isNull())
-            return null;
-        SQLDate internalDate = new SQLDate( getString(), false, getLocaleFinder(), cal);
-        return internalDate.getDate( cal);
-	}
-
-	/**
-	 * This implements getTime() for the national types. It lives
-	 * here so it can be shared between all the national types.
-	 *
-	 * @exception StandardException thrown on failure to convert
-	 */
-	protected Time nationalGetTime( Calendar cal) throws StandardException
-	{
-		if (isNull())
-            return null;
-        SQLTime internalTime = new SQLTime( getString(), false, getLocaleFinder(), cal);
-        return internalTime.getTime( cal);
-	}
-
-	/**
-	 * This implements getTimestamp() for the national types. It lives
-	 * here so it can be shared between all the national types.
-	 *
-	 * @exception StandardException thrown on failure to convert
-	 */
-	protected Timestamp	nationalGetTimestamp( Calendar cal) throws StandardException
-	{
-        // DB2 does not support internationalized timestamps
-        return getTimestamp( cal, getString(), getLocaleFinder());
-	}
-
 	protected void setLocaleFinder(LocaleFinder localeFinder)
 	{
 		this.localeFinder = localeFinder;
@@ -2835,10 +2605,6 @@
 	 * The value as a stream in the on-disk format.
 	 */
 	InputStream stream;
-	
-	/* Comparison info for National subclasses) */
-	private int[]	intArray;
-	private int		intLength;
 
 	/* Locale info (for International support) */
 	private LocaleFinder localeFinder;
@@ -2851,8 +2617,6 @@
         if( null != rawData)
             sz += 2*rawData.length;
         // Assume that cKey, stream, and localFinder are shared, so do not count their memory usage
-        if( null != intArray)
-            sz += intArray.length*ClassSize.getIntSize();
         return sz;
     } // end of estimateMemoryUsage
 
@@ -2863,8 +2627,6 @@
 		this.rawLength = other.rawLength;
 		this.cKey = other.cKey;
 		this.stream = other.stream;
-		this.intArray = intArray;
-		this.intLength = intLength;
 		this.localeFinder = localeFinder;
 	}
 

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/TypeId.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/TypeId.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/TypeId.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/types/TypeId.java Wed Jan 16 13:46:54 2008
@@ -103,9 +103,6 @@
         public static final int CHAR_MAXWIDTH           = Limits.DB2_CHAR_MAXWIDTH;
         public static final int VARCHAR_MAXWIDTH        = Limits.DB2_VARCHAR_MAXWIDTH;
         public static final int LONGVARCHAR_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
-        public static final int NATIONAL_CHAR_MAXWIDTH  = Integer.MAX_VALUE;
-        public static final int NATIONAL_VARCHAR_MAXWIDTH       = Integer.MAX_VALUE;
-        public static final int NATIONAL_LONGVARCHAR_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
         public static final int BIT_MAXWIDTH            = Limits.DB2_CHAR_MAXWIDTH;
         public static final int VARBIT_MAXWIDTH         = Limits.DB2_VARCHAR_MAXWIDTH;
         public static final int LONGVARBIT_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
@@ -113,7 +110,6 @@
         // not supposed to be limited! 4096G should be ok(?), if Derby can handle...
         public static final int BLOB_MAXWIDTH = Integer.MAX_VALUE; // to change long
         public static final int CLOB_MAXWIDTH = Integer.MAX_VALUE; // to change long
-        public static final int NCLOB_MAXWIDTH = Integer.MAX_VALUE; // to change long
         public static final int XML_MAXWIDTH = Integer.MAX_VALUE;
 
         // Max width for datetime values is the length of the
@@ -210,11 +206,7 @@
         public static final int SMALLINT_PRECEDENCE = 40;
         public static final int TINYINT_PRECEDENCE       = 30;
         public static final int REF_PRECEDENCE           = 25;
-        public static final int NATIONAL_LONGVARCHAR_PRECEDENCE = 18;
-        public static final int NATIONAL_VARCHAR_PRECEDENCE  = 17;
-        public static final int NATIONAL_CHAR_PRECEDENCE         = 16;
         public static final int CLOB_PRECEDENCE = 14;
-        public static final int NCLOB_PRECEDENCE = 13; 
         public static final int LONGVARCHAR_PRECEDENCE = 12;
         public static final int VARCHAR_PRECEDENCE  = 10;
         public static final int CHAR_PRECEDENCE  = 0;
@@ -232,7 +224,7 @@
         /*
         ** Others are created on demand by the getBuiltInTypeId(int),
         ** if they are built-in (i.e.? Part of JDBC .Types),
-        ** or by getBuiltInTypeId(string) if they are NATIONAL types or REF_NAME type.
+        ** or by getBuiltInTypeId(string) if they are REF_NAME type.
         */
 
         private static TypeId                   TINYINT_ID;
@@ -243,9 +235,6 @@
         private static TypeId                   DECIMAL_ID;
         private static TypeId                   NUMERIC_ID;
         private static TypeId                   VARCHAR_ID;
-        private static TypeId                   NATIONAL_CHAR_ID;
-        private static TypeId                   NATIONAL_LONGVARCHAR_ID;
-        private static TypeId                   NATIONAL_VARCHAR_ID;
         private static TypeId                   DATE_ID;
         private static TypeId                   TIME_ID;
         private static TypeId                   TIMESTAMP_ID;
@@ -257,7 +246,6 @@
 
         private static TypeId                   BLOB_ID;
         private static TypeId                   CLOB_ID;
-        private static TypeId                   NCLOB_ID;
         private static TypeId                   XML_ID;
 
         /**
@@ -611,30 +599,7 @@
                 TypeId ret = null;
 
                 // Types defined below here are SQL types and non-JDBC types that are supported by Derby
-                if (SQLTypeName.equals(TypeId.NCLOB_NAME)) {
-                        ret = NCLOB_ID;
-                        if (ret == null)
-                                ret = NCLOB_ID = new TypeId(StoredFormatIds.NCLOB_TYPE_ID,
-                                                            new BaseTypeIdImpl(StoredFormatIds.NCLOB_TYPE_ID_IMPL));
-                } else if (SQLTypeName.equals(TypeId.NATIONAL_CHAR_NAME)) {
-                        ret = NATIONAL_CHAR_ID;
-                        if (ret == null)
-                                ret = NATIONAL_CHAR_ID = new TypeId(StoredFormatIds.NATIONAL_CHAR_TYPE_ID,
-                                                                    new BaseTypeIdImpl(StoredFormatIds.NATIONAL_CHAR_TYPE_ID_IMPL));
-
-                } else if (SQLTypeName.equals(TypeId.NATIONAL_LONGVARCHAR_NAME)) {
-                        ret = NATIONAL_LONGVARCHAR_ID;
-                        if (ret == null)
-                                ret = NATIONAL_LONGVARCHAR_ID = new TypeId(StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID,
-                                                                        new BaseTypeIdImpl(StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID_IMPL));
-
-                } else if (SQLTypeName.equals(TypeId.NATIONAL_VARCHAR_NAME)) {
-                        ret = NATIONAL_VARCHAR_ID;
-                        if (ret == null)
-                                ret = NATIONAL_VARCHAR_ID = new TypeId(StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID,
-                                                                        new BaseTypeIdImpl(StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID_IMPL));
-
-                } else if (SQLTypeName.equals(TypeId.REF_NAME)) {
+                if (SQLTypeName.equals(TypeId.REF_NAME)) {
                         ret = REF_ID;
                         if (ret == null)
                                 ret = REF_ID = new TypeId(StoredFormatIds.REF_TYPE_ID,
@@ -823,31 +788,6 @@
                                 isLongConcatableTypeId = true;
                                 break;
 
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                                typePrecedence = NATIONAL_CHAR_PRECEDENCE;
-                                javaTypeName = "java.lang.String";
-                                maxMaxWidth = TypeId.NATIONAL_CHAR_MAXWIDTH;
-                                isStringTypeId = true;
-                                isConcatableTypeId = true;
-                                break;
-
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                                typePrecedence = NATIONAL_LONGVARCHAR_PRECEDENCE;
-                                javaTypeName = "java.lang.String";
-                                maxMaxWidth = TypeId.NATIONAL_LONGVARCHAR_MAXWIDTH;
-                                isStringTypeId = true;
-                                isConcatableTypeId = true;
-                                isLongConcatableTypeId = true;
-                                break;
-
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                                typePrecedence = NATIONAL_VARCHAR_PRECEDENCE;
-                                javaTypeName = "java.lang.String";
-                                maxMaxWidth = TypeId.NATIONAL_VARCHAR_MAXWIDTH;
-                                isStringTypeId = true;
-                                isConcatableTypeId = true;
-                                break;
-
                         case StoredFormatIds.REAL_TYPE_ID:
                                 maxPrecision = TypeId.REAL_PRECISION;
                                 maxScale = TypeId.REAL_SCALE;
@@ -949,16 +889,6 @@
                               isLOBTypeId = true;
                               break;
 
-                      case StoredFormatIds.NCLOB_TYPE_ID:
-                              typePrecedence = NCLOB_PRECEDENCE;
-                              javaTypeName = "java.sql.Clob";
-                              maxMaxWidth = TypeId.NCLOB_MAXWIDTH;
-                              isStringTypeId = true;
-                              isConcatableTypeId = true;
-                              isLongConcatableTypeId = true; // ??
-                              isLOBTypeId = true;
-                              break;
-
                       case StoredFormatIds.XML_TYPE_ID:
 
                               typePrecedence = XML_PRECEDENCE;
@@ -1121,22 +1051,20 @@
 	
 		/**
 		 * Is this a fixed string type?
-		 * @return true if this is CHAR or NCHAR
+		 * @return true if this is CHAR
 		 */
 		public boolean isFixedStringTypeId()
 		{
-				return ((formatId == StoredFormatIds.CHAR_TYPE_ID)||
-						(formatId == StoredFormatIds.NATIONAL_CHAR_TYPE_ID));
+				return (formatId == StoredFormatIds.CHAR_TYPE_ID);
 		}
 
 		/** 
 		 *Is this a Clob?
-		 * @return true if this is CLOB or NCLOB
+		 * @return true if this is CLOB
 		 */
 		public boolean isClobTypeId()
 		{
-			   return ((formatId == StoredFormatIds.CLOB_TYPE_ID)||
-					   (formatId == StoredFormatIds.NCLOB_TYPE_ID));
+			   return (formatId == StoredFormatIds.CLOB_TYPE_ID);
 		}
 
 		/** 
@@ -1155,8 +1083,7 @@
 		 */
 		public boolean isLongVarcharTypeId()
 		{
-				return ((formatId == StoredFormatIds.LONGVARCHAR_TYPE_ID) ||
-						(formatId == StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID));
+				return (formatId == StoredFormatIds.LONGVARCHAR_TYPE_ID);
 		}
 
 
@@ -1172,26 +1099,6 @@
 						(formatId == StoredFormatIds.TIMESTAMP_TYPE_ID));
 		}
 
-        /**
-                Does this type id represent a national character string.
-                If this returns true then isStringTypeId will also return true.
-        */
-        public boolean isNationalStringTypeId()
-        {
-                switch (formatId)
-                {
-                        default:
-                                return false;
-
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                        case StoredFormatIds.NCLOB_TYPE_ID:
-                                return true;
-
-                }
-        }
-
         /** 
          *Is this an XML doc?
          * @return true if this is XML
@@ -1217,8 +1124,6 @@
                         // cmp not allowed, indexing not allowed
                         case StoredFormatIds.BLOB_TYPE_ID:
                         case StoredFormatIds.CLOB_TYPE_ID:
-                        case StoredFormatIds.NCLOB_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
                         case StoredFormatIds.LONGVARCHAR_TYPE_ID:
                         case StoredFormatIds.XML_TYPE_ID:
                         case StoredFormatIds.LONGVARBIT_TYPE_ID:
@@ -1319,8 +1224,6 @@
                 return "java.sql.Blob";
             if ((CLOB_ID != null) && CLOB_ID.equals(this))
                 return "java.sql.Clob";
-            if ((NCLOB_ID != null) && NCLOB_ID.equals(this))
-                return "java.sql.Clob";
             return getCorrespondingJavaTypeName();
         }
 
@@ -1535,21 +1438,9 @@
                         case StoredFormatIds.CLOB_TYPE_ID:
                                 return new SQLClob();
 
-                        case StoredFormatIds.NCLOB_TYPE_ID:
-                                return new SQLNClob();
-
                         case StoredFormatIds.LONGVARCHAR_TYPE_ID:
                                 return new SQLLongvarchar();
 
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                                return new SQLNationalChar();
-
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                                return new SQLNationalVarchar();
-
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                                return new SQLNationalLongvarchar();
-
                         case StoredFormatIds.REAL_TYPE_ID:
                                 return new SQLReal();
 
@@ -1625,7 +1516,6 @@
                                 return (int)(Math.ceil(dts.getMaximumWidth()/8d));
 
                         case StoredFormatIds.CHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
                                 return (2 * dts.getMaximumWidth()) + 2;
 
                         case StoredFormatIds.DECIMAL_TYPE_ID:
@@ -1642,7 +1532,6 @@
                         case StoredFormatIds.LONGVARBIT_TYPE_ID:
                         case StoredFormatIds.BLOB_TYPE_ID:
                         case StoredFormatIds.CLOB_TYPE_ID:
-                        case StoredFormatIds.NCLOB_TYPE_ID:
                         // RESOLVE: Should XML be here?  What's this value mean, anyway?
                         case StoredFormatIds.XML_TYPE_ID:
                                 return 10240;
@@ -1667,10 +1556,8 @@
                                         return (int)(Math.ceil(dts.getMaximumWidth()/8d));
                                 }
 
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
                         case StoredFormatIds.VARCHAR_TYPE_ID:
                         case StoredFormatIds.LONGVARCHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
                                 // Return 200 if maximum width is max int
                                 if (dts.getMaximumWidth() == Integer.MAX_VALUE)
                                 {
@@ -1785,8 +1672,6 @@
                         case StoredFormatIds.DECIMAL_TYPE_ID:
                         case StoredFormatIds.CHAR_TYPE_ID:
                         case StoredFormatIds.VARCHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
                         case StoredFormatIds.BLOB_TYPE_ID:
                         case StoredFormatIds.CLOB_TYPE_ID:
                                  return true;

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/Util.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/Util.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/Util.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/Util.java Wed Jan 16 13:46:54 2008
@@ -316,16 +316,9 @@
 			case Types.DECIMAL	:  return TypeId.DECIMAL_NAME;
 
 			case Types.CHAR		:  return TypeId.CHAR_NAME;
-			case JDBC40Translation.NCHAR:
-				return TypeId.NATIONAL_CHAR_NAME;
 			case Types.VARCHAR 	:  return TypeId.VARCHAR_NAME;
-			case JDBC40Translation.NVARCHAR:
-				return TypeId.NATIONAL_VARCHAR_NAME;
 			case Types.LONGVARCHAR 	:  return "LONGVARCHAR";
-			case JDBC40Translation.LONGNVARCHAR:
-				return TypeId.NATIONAL_LONGVARCHAR_NAME;
             case Types.CLOB     :  return TypeId.CLOB_NAME;
-			case JDBC40Translation.NCLOB: return TypeId.NCLOB_NAME;
 
 			case Types.DATE 		:  return TypeId.DATE_NAME;
 			case Types.TIME 		:  return TypeId.TIME_NAME;

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java Wed Jan 16 13:46:54 2008
@@ -69,13 +69,6 @@
 		return null;
 	}
 
-	/** @see TypeCompiler#getMatchingNationalCharTypeName */
-	public String getMatchingNationalCharTypeName()
-	{
-		return TypeId.NATIONAL_CHAR_NAME;
-	}
-
-
 	/**
 	 * @see TypeCompiler#resolveArithmeticOperation
 	 *

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java Wed Jan 16 13:46:54 2008
@@ -132,7 +132,6 @@
 	{
 		super.bindExpression(fromList, subqueryList, aggregateVector);
 
-//RESOLVELOCALIZE - convert constants to national constants
 		TypeCompiler leftTC = leftOperand.getTypeCompiler();
 		TypeCompiler rightTC = rightOperand.getTypeCompiler();
 		TypeId leftTypeId = leftOperand.getTypeId();
@@ -177,36 +176,6 @@
 							leftTypeServices.getMaximumWidth()),
 					getContextManager());
 			((CastNode) leftOperand).bindCastNodeOnly();
-		}
-		/* If we are comparing a char with a national char then
-		 * we need to generate a cast to the appropriate national
-		 * char above the char operand.
-		 */
-		else if (! leftTypeId.isNationalStringTypeId() &&
-			rightTypeId.isNationalStringTypeId())
-		{
-			leftOperand =  (ValueNode)
-				getNodeFactory().getNode(
-					C_NodeTypes.CAST_NODE,
-					leftOperand, 
-					DataTypeDescriptor.getBuiltInDataTypeDescriptor(leftTC.getMatchingNationalCharTypeName(),
-										leftTC.getCastToCharWidth(
-											leftOperand.getTypeServices())),
-					getContextManager());
-			((CastNode) leftOperand).bindCastNodeOnly();
-		}
-		else if (! rightTypeId.isNationalStringTypeId() &&
-				leftTypeId.isNationalStringTypeId())
-		{
-			rightOperand =  (ValueNode)
-				getNodeFactory().getNode(
-					C_NodeTypes.CAST_NODE,
-					rightOperand, 
-					DataTypeDescriptor.getBuiltInDataTypeDescriptor(rightTC.getMatchingNationalCharTypeName(), 
-										rightTC.getCastToCharWidth(
-											rightOperand.getTypeServices())),
-					getContextManager());
-			((CastNode) rightOperand).bindCastNodeOnly();
 		}
 
 		/* Test type compatability and set type info for this node */

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CLOBTypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CLOBTypeCompiler.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CLOBTypeCompiler.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CLOBTypeCompiler.java Wed Jan 16 13:46:54 2008
@@ -95,7 +95,6 @@
             int formatId = getStoredFormatIdFromTypeId();
             switch (formatId) {
                 case StoredFormatIds.CLOB_TYPE_ID:  return "java.sql.Clob";
-                case StoredFormatIds.NCLOB_TYPE_ID: return "java.sql.Clob";
                 default:
                     if (SanityManager.DEBUG)
                         SanityManager.THROWASSERT("unexpected formatId in getCorrespondingPrimitiveTypeName() - " + formatId);
@@ -103,11 +102,6 @@
             }
         }
 
-        public String getMatchingNationalCharTypeName()
-        {
-            return TypeId.NCLOB_NAME;
-        }
-
         /**
          * @see TypeCompiler#getCastToCharWidth
          */
@@ -120,7 +114,6 @@
             int formatId = getStoredFormatIdFromTypeId();
             switch (formatId) {
                 case StoredFormatIds.CLOB_TYPE_ID:  return "getNullClob";
-                case StoredFormatIds.NCLOB_TYPE_ID: return "getNullNClob";
                 default:
                     if (SanityManager.DEBUG)
                         SanityManager.THROWASSERT("unexpected formatId in nullMethodName() - " + formatId);
@@ -133,7 +126,6 @@
             int formatId = getStoredFormatIdFromTypeId();
             switch (formatId) {
                 case StoredFormatIds.CLOB_TYPE_ID:  return "getClobDataValue";
-                case StoredFormatIds.NCLOB_TYPE_ID: return "getNClobDataValue";
                 default:
                     if (SanityManager.DEBUG)
                         SanityManager.THROWASSERT("unexpected formatId in dataValueMethodName() - " + formatId);

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java Wed Jan 16 13:46:54 2008
@@ -131,35 +131,6 @@
                 return dts.getMaximumWidth();
         }
 
-        /** @see TypeCompiler#getMatchingNationalCharTypeName */
-        public String getMatchingNationalCharTypeName()
-        {
-                int formatId = getStoredFormatIdFromTypeId();
-                switch (formatId)
-                {
-                        case StoredFormatIds.CHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                                return TypeId.NATIONAL_CHAR_NAME;
-
-                        case StoredFormatIds.LONGVARCHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                                return TypeId.NATIONAL_LONGVARCHAR_NAME;
-
-                        case StoredFormatIds.VARCHAR_TYPE_ID:
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                                return TypeId.NATIONAL_VARCHAR_NAME;
-
-                        default:
-                                if (SanityManager.DEBUG)
-                                {
-                                        SanityManager.THROWASSERT(
-                                                "unexpected formatId in getMatchingNationalCharTypeName() - " + formatId);
-                                }
-                                return null;
-                }
-        }
-
-
         String nullMethodName()
         {
                 int formatId = getStoredFormatIdFromTypeId();
@@ -171,15 +142,6 @@
                         case StoredFormatIds.LONGVARCHAR_TYPE_ID:
                                 return "getNullLongvarchar";
 
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                                return "getNullNationalChar";
-
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                                return "getNullNationalLongvarchar";
-
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                                return "getNullNationalVarchar";
-
                         case StoredFormatIds.VARCHAR_TYPE_ID:
                                 return "getNullVarchar";
 
@@ -214,15 +176,6 @@
 
                         case StoredFormatIds.LONGVARCHAR_TYPE_ID:
                                 return "getLongvarcharDataValue";
-
-                        case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-                                return "getNationalCharDataValue";
-
-                        case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-                                return "getNationalLongvarcharDataValue";
-
-                        case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-                                return "getNationalVarcharDataValue";
 
                         case StoredFormatIds.VARCHAR_TYPE_ID:
                                 return "getVarcharDataValue";

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java Wed Jan 16 13:46:54 2008
@@ -795,7 +795,7 @@
 
 			default:
 			// All other default type checks either 
-			// (TINYINT, NATIONAL_CHAR, etc), or 2) require a DB2 cast-
+			// (TINYINT, etc), or 2) require a DB2 cast-
 			// function (ex. blob(...), which Derby doesn't
 			// support yet--see Beetle 5281), and so they are not
 			// valid for Derby running in DB2 compatibility mode.

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java Wed Jan 16 13:46:54 2008
@@ -328,8 +328,8 @@
             rightConstant = true;
         }
 
-        /* If we are comparing a char with a national char then
-         * we generate a cast above the receiver to force preprocess to
+        /* If we are comparing a UCS_BASIC char with a terriotry based char 
+         * then we generate a cast above the receiver to force preprocess to
          * not attempt any of the > <= optimizations since there is no
          * way to determine the 'next' character for the <= operand.
          *
@@ -578,7 +578,7 @@
         if (!(receiver instanceof ColumnReference))
         {
             // We also do an early return here if in bindExpression we found 
-            // we had a National Char and put a CAST above the receiver.
+            // we had a territory based Char and put a CAST above the receiver.
             //
             return this;
         }
@@ -596,7 +596,7 @@
          *   given collation could sort: ab, a'\u0000'.  Is there any guarantee
          *   about the sort of the unicode '\u0000'.
          *
-         * o National char's don't try to produce a < than, is there a way
+         * o National char's didn't try to produce a < than, is there a way
          *   in collation?
          */
         if (receiver.getTypeServices().getCollationType() != 
@@ -628,16 +628,10 @@
             greaterEqualString = 
                 Like.greaterEqualString(pattern, escape, maxWidth);
 
-            /* We do not generate the < and we cannot drop the LIKE
-             * when doing LIKE on a national char column.
-             */
-            if (!receiver.getTypeId().isNationalStringTypeId())
-            {
-                lessThanString          = 
-                    Like.lessThanString(pattern, escape, maxWidth);
-                eliminateLikeComparison = 
-                    !Like.isLikeComparisonNeeded(pattern);
-            }
+            lessThanString          = 
+                Like.lessThanString(pattern, escape, maxWidth);
+            eliminateLikeComparison = 
+                !Like.isLikeComparisonNeeded(pattern);
         }
 
         /* For some unknown reason we need to clone the receiver if it is
@@ -670,14 +664,10 @@
                             getContextManager());
 
         /* Create the AND <, if lessThanString is non-null or 
-         * (leftOperand is a parameter and not a national string).
-         *
-         * Currently for a national string we do not add a < than operator 
-         * since we don't know (?) how to calculate such a string.
+         * leftOperand is a parameter.
          */
         if (lessThanString != null || 
-            (leftOperand.requiresTypeFromContext() && 
-             !receiver.getTypeId().isNationalStringTypeId()))
+            leftOperand.requiresTypeFromContext())
         {
             QueryTreeNode likeLTopt;
             if (leftOperand.requiresTypeFromContext())

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ModifyColumnNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ModifyColumnNode.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ModifyColumnNode.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ModifyColumnNode.java Wed Jan 16 13:46:54 2008
@@ -114,10 +114,9 @@
 					 SQLState.LANG_MODIFY_COLUMN_CHANGE_TYPE, name);
 		}			
 		
-		// can only alter the length of varchar, nvarchar, bitvarying columns
+		// can only alter the length of varchar, bitvarying columns
 		String typeName = getDataTypeServices().getTypeName();
-		if (!(typeName.equals(TypeId.NATIONAL_VARCHAR_NAME)) &&
-			!(typeName.equals(TypeId.VARCHAR_NAME)) &&
+		if (!(typeName.equals(TypeId.VARCHAR_NAME)) &&
 			!(typeName.equals(TypeId.VARBIT_NAME)))
 		{
 			throw StandardException.newException(

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java?rev=612576&r1=612575&r2=612576&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java Wed Jan 16 13:46:54 2008
@@ -1638,8 +1638,6 @@
 				return constantValue;
 
 			case StoredFormatIds.VARCHAR_TYPE_ID:
-			case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-			case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
 				String sourceValue = constantValue.getString();
 				int sourceWidth = sourceValue.length();
 				int posn;
@@ -1652,32 +1650,8 @@
 
 				if (sourceWidth <= maxWidth)
 				{
-					switch (formatId)
-					{
-						// For NCHAR we must pad the result, saves on normilization later if all
-						// constants are of the correct size
-						case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-
-							if (sourceWidth < maxWidth)
-							{
-								StringBuffer stringBuffer = new StringBuffer(sourceValue);
-
-								int needed = maxWidth - sourceWidth;
-								char blankArray[] = new char[needed];
-								for (int i = 0; i < needed; i++)
-									blankArray[i] = ' ';
-								stringBuffer.append(blankArray, 0,
-												maxWidth - sourceWidth);
-								sourceValue = stringBuffer.toString();
-							}
-							return dvf.getNationalCharDataValue(sourceValue);
-
-						case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-							return dvf.getNationalVarcharDataValue(sourceValue);
-
-						case StoredFormatIds.VARCHAR_TYPE_ID:
-							return dvf.getVarcharDataValue(sourceValue);
-					}
+					if(formatId == StoredFormatIds.VARCHAR_TYPE_ID)
+						return dvf.getVarcharDataValue(sourceValue);
 				}
 
 				/*
@@ -1688,20 +1662,8 @@
 					if (sourceValue.charAt(posn) != ' ')
 					{
 						String typeName = null;
-						switch (formatId)
-						{
-							case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-								typeName = TypeId.NATIONAL_CHAR_NAME;
-								break;
-
-							case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-								typeName = TypeId.NATIONAL_VARCHAR_NAME;
-								break;
-
-							case StoredFormatIds.VARCHAR_TYPE_ID:
+						if (formatId == StoredFormatIds.VARCHAR_TYPE_ID)
 								typeName = TypeId.VARCHAR_NAME;
-								break;
-						}
 						throw StandardException.newException(SQLState.LANG_STRING_TRUNCATION, 
 													 typeName,
 													 StringUtil.formatForPrint(sourceValue), 
@@ -1709,25 +1671,12 @@
 					}
 				}
 
-				switch (formatId)
-				{
-					case StoredFormatIds.NATIONAL_CHAR_TYPE_ID:
-						return dvf.getNationalCharDataValue(sourceValue.substring(0, maxWidth));
-
-					case StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID:
-						return dvf.getNationalVarcharDataValue(sourceValue.substring(0, maxWidth));
-
-					case StoredFormatIds.VARCHAR_TYPE_ID:
-						return dvf.getVarcharDataValue(sourceValue.substring(0, maxWidth));
-				}
+				if (formatId == StoredFormatIds.VARCHAR_TYPE_ID)
+					return dvf.getVarcharDataValue(sourceValue.substring(0, maxWidth));
 
 			case StoredFormatIds.LONGVARCHAR_TYPE_ID:
 				//No need to check widths here (unlike varchar), since no max width
 				return dvf.getLongvarcharDataValue(constantValue.getString());
-
-			case StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID:
-				//No need to check widths here (unlike varchar), since no max width
-				return dvf.getNationalLongvarcharDataValue(constantValue.getString());
 
 		}
 	}



Mime
View raw message