db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From be...@apache.org
Subject svn commit: r548251 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
Date Mon, 18 Jun 2007 07:54:20 GMT
Author: bernt
Date: Mon Jun 18 00:54:19 2007
New Revision: 548251

URL: http://svn.apache.org/viewvc?view=rev&rev=548251
Log:
DERBY-2607 DatabaseMetaData is not consistent about throwing SqlException when tablename=null

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java?view=diff&rev=548251&r1=548250&r2=548251
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java Mon Jun
18 00:54:19 2007
@@ -1769,6 +1769,11 @@
                                        String table) throws SqlException {
         checkForClosedConnectionX();
 
+        // validate the table name       
+        if (table == null) {
+            throw new SqlException(agent_.logWriter_,
+                new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL)); 
+        }
         PreparedStatement cs = prepareMetaDataQuery("SYSIBM.SQLFOREIGNKEYS(?,?,?,?,?,?,?)");
 
         cs.setStringX(1, "");
@@ -1821,6 +1826,11 @@
         checkForClosedConnectionX();
         ;
 
+        // validate the table name
+        if (table == null) {
+            throw new SqlException(agent_.logWriter_,
+                new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL)); 
+        }        
         PreparedStatement cs = prepareMetaDataQuery("SYSIBM.SQLFOREIGNKEYS(?,?,?,?,?,?,?)");
 
         cs.setStringX(1, catalog);



Mime
View raw message