You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ma...@apache.org on 2011/11/14 23:35:50 UTC

svn commit: r1201945 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java

Author: mamta
Date: Mon Nov 14 22:35:50 2011
New Revision: 1201945

URL: http://svn.apache.org/viewvc?rev=1201945&view=rev
Log:
DERBY-5244 DERBY-5244 DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns meta for a SYNONYM. This is because for

Adding test case for views. The test comments for table, views and synonym is as follows

     * DERBY-5244 DatabaseMetaData.getColumns(null, null, tableName, null) 
     * 	does not return the columns meta for a SYNONYM. This is because for
     *  synonyms, we do not add any rows in SYSCOLUMNS. But the metadata query 
     *  for DatabaseMetaData.getColumns() looks at SYSCOLUMNS to get the 
     *  resultset. Views and Tables do not have problems because we do keep
     *  their columns information in SYSCOLUMNS.



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java?rev=1201945&r1=1201944&r2=1201945&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SynonymTest.java Mon Nov 14 22:35:50 2011
@@ -75,7 +75,11 @@ public class SynonymTest extends BaseJDB
 
     /**
      * DERBY-5244 DatabaseMetaData.getColumns(null, null, tableName, null) 
-     * 	does not return the columns meta for a SYNONYM
+     * 	does not return the columns meta for a SYNONYM. This is because for
+     *  synonyms, we do not add any rows in SYSCOLUMNS. But the metadata query 
+     *  for DatabaseMetaData.getColumns() looks at SYSCOLUMNS to get the 
+     *  resultset. Views and Tables do not have problems because we do keep
+     *  their columns information in SYSCOLUMNS.
      * 
      * Test DatabaseMetaData.getColumns call on synonyms
      *
@@ -89,6 +93,7 @@ public class SynonymTest extends BaseJDB
             		"( c11 int not null, c12 char(2) )");
             //Create a synonym on table t1Derby5422
             st.executeUpdate("create synonym s1Derby5422 for t1Derby5422");
+            st.executeUpdate("create view v1Derby5422 as select * from t1Derby5422");
             
             //Verify that the synonym has been created successfully by
             // doing a select from it
@@ -98,6 +103,9 @@ public class SynonymTest extends BaseJDB
             //Derby can find metadata info for the base table
             rs = dbmd.getColumns(null, null, "T1DERBY5422", null);
             JDBC.assertDrainResultsHasData(rs);
+            //Derby can find metadata info for the view
+            rs = dbmd.getColumns(null, null, "V1DERBY5422", null);
+            JDBC.assertDrainResultsHasData(rs);
             //But Derby does not locate the metadata info for synonym
             rs = dbmd.getColumns(null, null, "S1DERBY5422", null);
             JDBC.assertEmpty(rs);