From: Date: January 9 2007 11:49pm Subject: Connector/J commit: r6278 - branches/branch_5_0/connector-j/src/com/mysql/jdbc trunk/connector-j/src/com/mysql/jdbc List-Archive: http://lists.mysql.com/commits/17817 X-Bug: 24065 Message-Id: <200701092249.l09Mn2qf008957@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java Log: Fixed BUG#24065 - Better error message when server doesn't return enough information to determine stored procedure/function parameter types, the underlying bug is with the server itself, see http://bugs.mysql.com/bug.php?id=20235 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-01-09 22:47:30 UTC (rev 6277) +++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java 2007-01-09 22:49:01 UTC (rev 6278) @@ -1304,6 +1304,13 @@ .getString("Create Function") : paramRetrievalRs .getString("Create Procedure"); + if (procedureDef == null || procedureDef.length() == 0) { + throw SQLError.createSQLException("User does not have access to metadata required to determine " + + "stored procedure parameter types. If rights can not be granted, configure connection with \"noAccessToProcedureBodies=true\" " + + "to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.", + SQLError.SQL_STATE_GENERAL_ERROR); + } + int openParenIndex = StringUtils .indexOfIgnoreCaseRespectQuotes(0, procedureDef, "(", quoteChar.charAt(0), !this.conn Modified: trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java =================================================================== --- trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java 2007-01-09 22:47:30 UTC (rev 6277) +++ trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java 2007-01-09 22:49:01 UTC (rev 6278) @@ -1359,7 +1359,14 @@ String procedureDef = parsingFunction ? paramRetrievalRs .getString("Create Function") : paramRetrievalRs .getString("Create Procedure"); - + + if (procedureDef == null || procedureDef.length() == 0) { + throw SQLError.createSQLException("User does not have access to metadata required to determine " + + "stored procedure parameter types. If rights can not be granted, configure connection with \"noAccessToProcedureBodies=true\" " + + "to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.", + SQLError.SQL_STATE_GENERAL_ERROR); + } + int openParenIndex = StringUtils .indexOfIgnoreCaseRespectQuotes(0, procedureDef, "(", quoteChar.charAt(0), !this.conn