db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r557716 - in /db/derby/code/branches/10.3/java: engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/impl/store/access/btree/index/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Thu, 19 Jul 2007 18:13:11 GMT
Author: mamta
Date: Thu Jul 19 11:13:10 2007
New Revision: 557716

URL: http://svn.apache.org/viewvc?view=rev&rev=557716
Log:
Merging 557693 from main into 10.3 codeline. Commit comments for main were as follows

This commit has 2 simple fixes (DERBY-2951 which gives assert failure and DERBY-2656 The table
will have collation type UCS_BASIC which is different than the collation of the schema TERRITORY_BASED
hence this operation is not supported.)

The failure in DERBY-2951 is because in store, we were not using correct format id and hence
collation information was not getting written out and read from disk. Added a test case for
this in CollationTest.

The failure in DERBY-2656 was because of the bug that we were comparing collation type for
non-character types. Collation is only applicable to character types and hence we should check
for character types before comparing the collation info. Added a test case for this one too.


Modified:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java?view=diff&rev=557716&r1=557715&r2=557716
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
Thu Jul 19 11:13:10 2007
@@ -330,7 +330,8 @@
 				//has collation of territory based. This is not supported and
 				//hence we will throw an exception below for the query above in
 				//a territory based database. 
-				if (dtd.getCollationType() != schemaCollationType)
+				if (dtd.getTypeId().isStringTypeId() && 
+						dtd.getCollationType() != schemaCollationType)
 				{
 					String schemaCollationName =
 			        	(schemaCollationType == 

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java?view=diff&rev=557716&r1=557715&r2=557716
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
Thu Jul 19 11:13:10 2007
@@ -996,7 +996,7 @@
 	*/
 	public int getTypeFormatId() 
     {
-		return StoredFormatIds.ACCESS_B2I_V3_ID;
+		return StoredFormatIds.ACCESS_B2I_V4_ID;
 	}
 
 

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?view=diff&rev=557716&r1=557715&r2=557716
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
(original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Thu Jul 19 11:13:10 2007
@@ -946,6 +946,21 @@
     //territory based
     assertStatementError("42ZA3", s, "CREATE TABLE T AS SELECT TABLENAME " +
     		" FROM SYS.SYSTABLES WITH NO DATA");
+    //But following will work because there is no character string type
+    //involved.
+    s.executeUpdate("CREATE TABLE T AS SELECT COLUMNNUMBER FROM " +
+    		" SYS.SYSCOLUMNS WITH NO DATA");
+    
+    //DERBY-2951
+    //Following was giving Assert failure in store code because we were not
+    //writing and reading the collation information from the disk.
+    s.execute("create table assoc (x char(10) not null primary key, "+
+    		" y char(100))");
+    s.execute("create table assocout(x char(10))");
+    ps = conn.prepareStatement("insert into assoc values (?, 'hello')");
+    ps.setString(1, new Integer(10).toString());
+    ps.executeUpdate();     
+
 }
 
 private void setUpTable(Statement s) throws SQLException {



Mime
View raw message