Bug #14162 Bug reading column metadata
Submitted: 20 Oct 2005 0:22 Modified: 3 Sep 2007 15:29
Reporter: Gili Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.1.11 OS:Any
Assigned to: CPU Architecture:Any

[20 Oct 2005 0:22] Gili
Description:
Please see http://jira.atlassian.com/browse/JRA-8231?page=comments#action_43779 for more information.

How to repeat:
Run JIRA, check the output log
[20 Oct 2005 5:39] Gili
Please note Connector/J 3.1.10 seems to work fine so the breakage is caused by some change between 3.1.10 and 3.1.11.
[20 Oct 2005 7:03] Vasily Kishkin
Could you please say me where I can read about JIRA and download it ?
[20 Oct 2005 7:08] Gili
Vasily,

Please see http://www.atlassian.com/software/jira/
[27 Oct 2005 11:44] Vasily Kishkin
It is very difficult to understand from log where bug is. I need some test case on Java. Could you please create and attach some test case ?
[27 Oct 2005 16:00] Gili
Sorry, this is beyond my abilities :( I've posted a comment at http://jira.atlassian.com/browse/JRA-8231?page=comments#action_43779 asking for someone on the JIRA team to help you, but there are no guarantees.
[28 Oct 2005 3:11] Jeff Turner
Vasily,

3.1.10 works fine. 3.1.11 breaks. 3.2-alpha works again.

We can try to create a sample .java file demonstrating the problem, but would like to know if there is any point, since it is fixed in 3.2.  Is there an intention of creating a 3.1.12 release, or will 3.2 be the next release regardless of bugs found in 3.1.11?
[2 Nov 2005 17:20] Mark Matthews
Jeff,

Connector/J 3.2 will not be released, the next version of Connector/J will be 5.0.0 (as a beta), which is 3.1.x with XA from 3.2 backported into it.

Can you test with the nightlies of 5.0 to see if this bug is still present when used with your application? See http://downloads.mysql.com/snapshots.php#connector-j
[3 Nov 2005 0:13] Jeff Turner
Interesting - it worked with 3.2.0-alpha but fails with the same error as 3.1.11 when using 5.0-nightly-20051102:

java.lang.NullPointerException
	at java.util.TreeMap.compare(TreeMap.java:1093)
	at java.util.TreeMap.getEntry(TreeMap.java:347)
	at java.util.TreeMap.containsKey(TreeMap.java:204)
	at java.util.TreeSet.contains(TreeSet.java:196)
	at org.ofbiz.core.entity.jdbc.DatabaseUtil.getColumnInfo(DatabaseUtil.java:897)
	at org.ofbiz.core.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:86)
	at org.ofbiz.core.entity.GenericDAO.checkDb(GenericDAO.java:1295)
        ...

I'll see about providing a testcase to reproduce this.
[8 Nov 2005 5:42] Anton Mazkovoi
Hi,

Please find a test case that reproduces the problem here:
http://repository.atlassian.com/mysql/MySQLMetaDataReader.java

The actual problem is that the ResultSet from making the connection.getMetaData().getColumns(null, null, null, null) call has the "TABLE_NAME" column set to null instead of the actual table name.

To run the test case please:
1. Create a MySQL database
2. Create  a table with at least on column in the database
3. Modify MySQLMetaDataReader.java to provide connection details to the database
4. Compile MySQLMetaDataReader.java
5. Run

The test case will print:
Table's name: null

This happens with the mysql-connector-java-5.0-nightly-20051107-bin.jar driver on MySQL 3.23.58 and 4.1.7 

The code works fine (returns the actual table name instead of null) if the mysql-connector-java-3.0.11-stable-bin.jar or mysql-connector-java-3.1.8-bin.jar drivers are used with MySQL 3.23.58 or 4.1.7.

Please let us know if you would like more information.

Thanks,
Anton
[8 Nov 2005 10:06] Vasily Kishkin
To Anton:
Thanks for the test case. But I don't have packet com.atlassian. Where I can download it ?
[8 Nov 2005 10:09] Vasily Kishkin
To Anton:
Sorry... I made mistake. I tested on 3.1.11 and table's name is null.
[8 Nov 2005 21:42] Anton Mazkovoi
Guys,

Just noticed that the status of this issue is "Need Feedback". Is there something else we can provide to help with this?

Cheers,
Anton
[2 Dec 2005 2:44] Chris Wood
This appears to have been fixed with http://bugs.mysql.com/bug.php?id=14815 ,  the problem is not evident in 3.1.12
[8 Dec 2005 2:27] Jeff Turner
Thanks, I can confirm that it's fixed in 3.1.12
[9 Dec 2005 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[3 Sep 2007 15:29] Tonci Grgin
Closed as per comment by reporter:

 [8 Dec 2005 3:27] Jeff Turner

Thanks, I can confirm that it's fixed in 3.1.12