db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1204684 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Mon, 21 Nov 2011 20:20:48 GMT
Author: rhillegas
Date: Mon Nov 21 20:20:47 2011
New Revision: 1204684

URL: http://svn.apache.org/viewvc?rev=1204684&view=rev
Log:
DERBY-5488: Rename SCOPE_CATLOG to SCOPE_CATALOG and add a redundant trailing SCOPE_CATLOG
column to the ResultSet returned by DatabaseMetaData.getColumns().

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/metadata.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ViewsTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=1204684&r1=1204683&r2=1204684&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
Mon Nov 21 20:20:47 2011
@@ -1864,7 +1864,7 @@ public class EmbedDatabaseMetaData exten
      *	<LI><B>IS_NULLABLE</B> String => "NO" means column definitely
      *      does not allow NULL values; "YES" means the column might
      *      allow NULL values.  An empty string means nobody knows.
-     *  <LI><B>SCOPE_CATLOG</B> String => catalog of table that is the
+     *  <LI><B>SCOPE_CATALOG</B> String => catalog of table that is
the
      *  scope of a reference attribute (<code>null</code> if DATA_TYPE
      *  isn't REF)
      *  <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the
@@ -1885,6 +1885,9 @@ public class EmbedDatabaseMetaData exten
      *  <LI> empty string --- if it cannot be determined whether the
      *       column is auto incremented parameter is unknown
      *  </UL>
+     *  <LI><B>SCOPE_CATLOG</B> A redundant copy of SCOPE_CATALOG. The
name
+     *   of this column is deliberately mis-spelled in order to support a typo in the
+     *   javadoc for DatabaseMetaData.getColumns() which was corrected by JDBC 4.1.
      *  </OL>
      *
      * @param catalog a catalog name; "" retrieves those without a

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/metadata.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/metadata.properties?rev=1204684&r1=1204683&r2=1204684&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/metadata.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/metadata.properties Mon Nov
21 20:20:47 2011
@@ -358,7 +358,7 @@ getColumns=\
 		C.COLUMNNUMBER AS ORDINAL_POSITION, \
 		CAST ((CASE WHEN C.COLUMNDATATYPE.isNullable() THEN 'YES' ELSE 'NO' END) AS VARCHAR(128))
\
 		 	AS IS_NULLABLE, \
-                CAST (NULL AS VARCHAR(128)) AS SCOPE_CATLOG, \
+                CAST (NULL AS VARCHAR(128)) AS SCOPE_CATALOG, \
                 CAST (NULL AS VARCHAR(128)) AS SCOPE_SCHEMA, \
                 CAST (NULL AS VARCHAR(128)) AS SCOPE_TABLE, \
                 CAST (NULL AS SMALLINT) AS SOURCE_DATA_TYPE, \
@@ -366,7 +366,8 @@ getColumns=\
 		 	AS IS_AUTOINCREMENT, \
 		CAST ((CASE WHEN (C.COLUMNDEFAULT IS NOT NULL AND C.COLUMNDEFAULT.toString().startsWith(
'GENERATED ALWAYS AS' ) ) THEN 'YES' \
 					ELSE  'NO' END) AS VARCHAR(128)) \
-			AS IS_GENERATEDCOLUMN \										\
+			AS IS_GENERATEDCOLUMN, \										\
+                CAST (NULL AS VARCHAR(128)) AS SCOPE_CATLOG \
 	FROM SYS.SYSSCHEMAS S, \
 			SYS.SYSTABLES T, \
 			SYS.SYSCOLUMNS C \

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java?rev=1204684&r1=1204683&r2=1204684&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Mon Nov 21 20:20:47 2011
@@ -896,7 +896,7 @@ public class DatabaseMetaDataTest extend
                 null, null, "1", "",
                 null, null, null, null,
                 "1", "YES", null, null,
-                null, null, "NO", "NO"
+                null, null, "NO", "NO", null
             },
         };
         JDBC.assertFullResultSet( rs, expectedRows );
@@ -1999,6 +1999,7 @@ public class DatabaseMetaDataTest extend
         }
         
         // SCOPE not supported
+        assertNull("SCOPE_CATALOG", rs.getString("SCOPE_CATALOG"));
         assertNull("SCOPE_CATLOG", rs.getString("SCOPE_CATLOG"));
         assertNull("SCOPE_SCHEMA", rs.getString("SCOPE_SCHEMA"));
         assertNull("SCOPE_TABLE", rs.getString("SCOPE_TABLE"));
@@ -2490,7 +2491,8 @@ public class DatabaseMetaDataTest extend
                 Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.VARCHAR,
                 Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER,
                 Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
-                Types.VARCHAR, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR
+                Types.VARCHAR, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR,
+                Types.VARCHAR
                 };
         boolean[]   nullability =
         {
@@ -2499,7 +2501,8 @@ public class DatabaseMetaDataTest extend
             true,   true,   true,  false,
             true,   true,   true,   true,
             false,  false,  true,   true,
-            true,   true,   false,  false
+            true,   true,   false,  false,
+            true
         };
         if (odbc == 1)
         {
@@ -2519,8 +2522,9 @@ public class DatabaseMetaDataTest extend
                  "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH",
                  "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS",
                  "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
-                 "ORDINAL_POSITION", "IS_NULLABLE", "SCOPE_CATLOG", "SCOPE_SCHEMA",
-                 "SCOPE_TABLE", "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT", "IS_GENERATEDCOLUMN"
+                 "ORDINAL_POSITION", "IS_NULLABLE", "SCOPE_CATALOG", "SCOPE_SCHEMA",
+                 "SCOPE_TABLE", "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT", "IS_GENERATEDCOLUMN",
+                 "SCOPE_CATLOG"
              },
              columnTypes,
              nullability
@@ -4954,7 +4958,8 @@ public class DatabaseMetaDataTest extend
                 "0", "10", "1", "",
                 null, null, null, null,
                 "1", "YES", null, null,
-                null, null, "NO", "NO"
+                null, null, "NO", "NO",
+                null
             },
             {
                 "", "APP", "T_JDBC41", "B",
@@ -4962,7 +4967,8 @@ public class DatabaseMetaDataTest extend
                 "0", "10", "1", "",
                 null, null, null, null,
                 "2", "YES", null, null,
-                null, null, "NO", "NO"
+                null, null, "NO", "NO",
+                null
             },
             {
                 "", "APP", "T_JDBC41", "C",
@@ -4970,7 +4976,8 @@ public class DatabaseMetaDataTest extend
                 "0", "10", "1", "",
                 "GENERATED ALWAYS AS ( -a )", null, null, null,
                 "3", "YES", null, null,
-                null, null, "NO", "YES"
+                null, null, "NO", "YES",
+                null
             },
         };
         JDBC.assertFullResultSet( rs2, expectedRows );

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ViewsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ViewsTest.java?rev=1204684&r1=1204683&r2=1204684&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ViewsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ViewsTest.java
Mon Nov 21 20:20:47 2011
@@ -828,8 +828,8 @@ public final class ViewsTest extends Bas
         DatabaseMetaData dmd = getConnection().getMetaData();
         ResultSet columns = dmd.getColumns(null, null, "V", null);
         String[][] expectedDBMetaRows = new String[][] {{"","APP","V","DATA","12","VARCHAR","20",null,null,null,"1","",null,null,null
-            ,"40","1","YES",null,null,null,null,"NO","NO"},
-            {"","APP","V","NUM","4","INTEGER","10",null,"0","10","1","",null,null,null,null,"2","YES",null,null,null,null,"NO","NO"}};
 
+            ,"40","1","YES",null,null,null,null,"NO","NO",null},
+            {"","APP","V","NUM","4","INTEGER","10",null,"0","10","1","",null,null,null,null,"2","YES",null,null,null,null,"NO","NO",null}};
 
         JDBC.assertFullResultSet(columns,expectedDBMetaRows);
         // Make sure ResultSetMetaData is right when selecting from view.
         // This wasn't a problem with DERBY-4230, but checking for good measure.
@@ -874,19 +874,19 @@ public final class ViewsTest extends Bas
 
         String[][] expectedDBMetaRows = new String[][]
             {{"","APP","V1","J","4","INTEGER","10",null,"0","10","1","",
-              null,null,null,null,"1","YES",null,null,null,null,"NO","NO"},
+              null,null,null,null,"1","YES",null,null,null,null,"NO","NO",null},
              {"","APP","V1","I","4","INTEGER","10",null,"0","10","1","",
-              null,null,null,null,"2","YES",null,null,null,null,"NO","NO"}};
+              null,null,null,null,"2","YES",null,null,null,null,"NO","NO",null}};
 
         JDBC.assertFullResultSet(columns,expectedDBMetaRows);
 
         expectedDBMetaRows = new String[][]
             {{"","APP","V2","X","4","INTEGER","10",null,"0","10","1","",
-              null,null,null,null,"1","YES",null,null,null,null,"NO","NO"},
+              null,null,null,null,"1","YES",null,null,null,null,"NO","NO",null},
              {"","APP","V2","Y","4","INTEGER","10",null,"0","10","1","",
-              null,null,null,null,"2","YES",null,null,null,null,"NO","NO"},
+              null,null,null,null,"2","YES",null,null,null,null,"NO","NO",null},
              {"","APP","V2","Z","4","INTEGER","10",null,"0","10","1","",
-              null,null,null,null,"3","YES",null,null,null,null,"NO","NO"}};
+              null,null,null,null,"3","YES",null,null,null,null,"NO","NO",null}};
 
         columns = dmd.getColumns(null, null, "V2", null);
         JDBC.assertFullResultSet(columns,expectedDBMetaRows);



Mime
View raw message