Bug #51022 conn.getMetaData().getProcedures returns all SP's regardless of catalog

Submitted: 9 Feb 2010 12:04 Modified: 12 Feb 2010 10:49
Reporter: Tonci Grgin Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1 trunk OS:Any
Assigned to: Tony Bedford CPU Architecture:Any

[9 Feb 2010 12:04] Tonci Grgin
Description:
this.rs = conn1.getMetaData().getProcedures(conn1.getCatalog(),null,"%");
this.rs = conn1.getMetaData().getProcedures("test",null,"%");
this.rs = conn1.getMetaData().getProcedures("jshop",null,"%");

all return same data:
jshop, proctree
jshop, proctree1
test, b51013

General query log shows wildcard in schema fields:
WHERE ROUTINE_SCHEMA LIKE '%' AND ROUTINE_NAME LIKE '%'

How to repeat:
See Bug#51013 and Bug#49578. This was previously reported in Bug#7026.

Suggested fix:
-
[9 Feb 2010 12:06] Tonci Grgin
Workaround would be to have different names for SP's in different databases and to use SP name filter.
[9 Feb 2010 16:20] Tonci Grgin
This might need a bit more checking from the server side before any fixes are made.
[10 Feb 2010 16:32] Tonci Grgin
Patch committed as rev 898.

=== modified file 'src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java'
--- src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java     2010-01-28 23:59
:15 +0000
+++ src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java     2010-02-10 16:11
:07 +0000
@@ -978,6 +978,8 @@
                        if (this.conn.getNullCatalogMeansCurrent()) {
                                db = this.database;
                        }
+               }  else {
+                       db = catalog;
                }
[12 Feb 2010 10:49] Tony Bedford
An entry has been added to the 5.1.12 changelog:

The catalog parameter was ignored in the DatabaseMetaData.getProcedure() method. It returned all procedures in all databases.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.