List:Commits« Previous MessageNext Message »
From:mmatthews Date:February 23 2007 10:43pm
Subject:Connector/J commit: r6320 - branches/branch_5_0/connector-j branches/branch_5_0/connector-j/src/com/mysql/jdbc trunk/connector-j trunk/connector-j/src...
View as plain text  
Modified:
   branches/branch_5_0/connector-j/CHANGES
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
   trunk/connector-j/CHANGES
   trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
Log:
When extracting foreign key information from "SHOW CREATE TABLE " in 
	  DatabaseMetaData, ignore exceptions relating to tables being missing
	  (which could happen for cross-reference or imported-key requests, as 
	  the list of tables is generated first, then iterated).

Modified: branches/branch_5_0/connector-j/CHANGES
===================================================================
--- branches/branch_5_0/connector-j/CHANGES	2007-02-13 22:13:27 UTC (rev 6319)
+++ branches/branch_5_0/connector-j/CHANGES	2007-02-23 21:43:01 UTC (rev 6320)
@@ -155,7 +155,19 @@
 	  
     - Fixed BUG#22628 - Driver.getPropertyInfo() throws NullPointerException for 
       URL that only specifies host and/or port.
-      	  
+
+	- Fixed BUG#21267, ParameterMetaData throws NullPointerException when 
+	  prepared SQL actually has a syntax error. Added 
+	  "generateSimpleParameterMetadata" configuration property, which when set
+	  to "true" will generate metadata reflecting VARCHAR for every parameter
+	  (the default is "false", which will cause an exception to be thrown if no
+	  parameter metadata for the statement is actually available).
+
+	- When extracting foreign key information from "SHOW CREATE TABLE " in 
+	  DatabaseMetaData, ignore exceptions relating to tables being missing
+	  (which could happen for cross-reference or imported-key requests, as 
+	  the list of tables is generated first, then iterated).
+	  
 10-20-06 - Version 5.0.4
 
     - Fixed BUG#21379 - column names don't match metadata in cases 

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-02-13
22:13:27 UTC (rev 6319)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-02-23
21:43:01 UTC (rev 6320)
@@ -1137,7 +1137,17 @@
 						quoteChar).append(catalog).append(quoteChar)
 						.append(".").append(quoteChar).append(tableToExtract)
 						.append(quoteChar).toString();
-				rs = stmt.executeQuery(query);
+				try {
+					rs = stmt.executeQuery(query);
+				} catch (SQLException sqlEx) {
+					// Table might've disappeared on us, not really an error
+					String sqlState = sqlEx.getSQLState();
+					
+					if (!"42S02".equals(sqlState) && 
+							sqlEx.getErrorCode() != MysqlErrorNumbers.ER_NO_SUCH_TABLE) {
+						throw sqlEx;
+					}
+				}
 
 				while (rs.next()) {
 					extractForeignKeyForTable(rows, rs, catalog);

Modified: trunk/connector-j/CHANGES
===================================================================
--- trunk/connector-j/CHANGES	2007-02-13 22:13:27 UTC (rev 6319)
+++ trunk/connector-j/CHANGES	2007-02-23 21:43:01 UTC (rev 6320)
@@ -155,7 +155,12 @@
 
     - Fixed BUG#22628 - Driver.getPropertyInfo() throws NullPointerException for 
       URL that only specifies host and/or port.
-      
+
+	- When extracting foreign key information from "SHOW CREATE TABLE " in 
+	  DatabaseMetaData, ignore exceptions relating to tables being missing
+	  (which could happen for cross-reference or imported-key requests, as 
+	  the list of tables is generated first, then iterated).
+	       
 10-20-06 - Version 5.0.4
 
     - Fixed BUG#21379 - column names don't match metadata in cases 

Modified: trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-02-13 22:13:27 UTC
(rev 6319)
+++ trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-02-23 21:43:01 UTC
(rev 6320)
@@ -1118,7 +1118,18 @@
 						quoteChar).append(catalog).append(quoteChar)
 						.append(".").append(quoteChar).append(tableToExtract)
 						.append(quoteChar).toString();
-				rs = stmt.executeQuery(query);
+				
+				try {
+					rs = stmt.executeQuery(query);
+				} catch (SQLException sqlEx) {
+					// Table might've disappeared on us, not really an error
+					String sqlState = sqlEx.getSQLState();
+					
+					if (!"42S02".equals(sqlState) && 
+							sqlEx.getErrorCode() != MysqlErrorNumbers.ER_NO_SUCH_TABLE) {
+						throw sqlEx;
+					}
+				}
 
 				while (rs.next()) {
 					extractForeignKeyForTable(rows, rs, catalog);

Thread
Connector/J commit: r6320 - branches/branch_5_0/connector-j branches/branch_5_0/connector-j/src/com/mysql/jdbc trunk/connector-j trunk/connector-j/src...mmatthews23 Feb