Bug #51908 getProcedureColumns()/getFunc. will not obey catalog parameter for 5.4+ servers
Submitted: 10 Mar 2010 12:42 Modified: 12 Mar 2010 16:24
Reporter: Tonci Grgin Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:trunk OS:Any
Assigned to: CPU Architecture:Any

[10 Mar 2010 12:42] Tonci Grgin
Description:
Working on Bug#51904 I spotted the same symptom I described in Bug#51022. Probably should have been more careful fixing that bug and replace all occurrences of faulty code...

=== modified file 'src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java'
--- src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
+++ src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
@@ -1325,6 +1325,8 @@
                        if (this.conn.getNullCatalogMeansCurrent()) {
                                db = this.database;
                        }
+               }  else {
+                       db = catalog;
                }

How to repeat:
See DatabaseMetaDataUsingInfoSchema.java, Line 1325.

Suggested fix:
=== modified file 'src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java'
--- src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
+++ src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
@@ -1325,6 +1325,8 @@
                        if (this.conn.getNullCatalogMeansCurrent()) {
                                db = this.database;
                        }
+               }  else {
+                       db = catalog;
                }
[10 Mar 2010 12:45] Tonci Grgin
Same with getFunctionColumns...

=== modified file
'src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java'
--- src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
+++ src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
@@ -1151,6 +1151,8 @@
                        if (this.conn.getNullCatalogMeansCurrent()) {
                                db = this.database;
                        }
+               }  else {
+                       db = catalog;
                }

This probably got unnoticed due to fact that it executes only for 5.4+ MySQL servers.
[12 Mar 2010 16:25] Tonci Grgin
Pushed up to revision 915.