Bug #15065 The usage advisor sometimes reports a referenced column as unreferenced
| Submitted: | 19 Nov 2005 9:22 | Modified: | 23 Nov 2005 5:15 |
|---|---|---|---|
| Reporter: | Yuan WANG | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / J | Severity: | S3 (Non-critical) |
| Version: | 3.1.11 | OS: | Windows (WinXP) |
| Assigned to: | Mark Matthews | CPU Architecture: | Any |
[20 Nov 2005 9:01]
Vasily Kishkin
Thanks for the bug report. I was able to reproduce the bug. I would like to notice that I had java.lang.NullPointerException with any query. My test case is attached.
[20 Nov 2005 9:01]
Vasily Kishkin
Test case
Attachment: Bug15065.java (text/java), 1002 bytes.
[23 Nov 2005 5:15]
Mark Matthews
Fixed for 3.1.12 and 5.0.0. See nightly snapshot from http://downloads.mysql.com/snapshots.php#connector-j after 00:00 GMT Nov 24th, or subversion repository at http://svn.mysql.com/svnpublic/connector-j/branches/branch_3_1 immediately (i.e. build from source) for the fix. Thanks for the bug report.
[25 Oct 2006 18:21]
Robert DiFalco
I still see this sometimes with 5.0.4. I cannot create a reproducible test case.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 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.
Description: I set the usage advisor flag of the JDBC connection to find out unreferenced columns return by queries in my application. However, I find that the usage advisor sometimes makes false statements that some columns have not been referenced, even through they' re indeed. Here is a simple test. ((com.mysql.jdbc.Connection)conn).setUseUsageAdvisor(true); java.sql.Statement stmt = conn.createStatement(); java.sql.ResultSet rs = stmt.executeQuery("select count(*) from t1 limit 1"); rs.next(); System.out.println("T1 has " + rs.getInt(1) + " rows"); rs.close(); Where "conn" is the connection to the database and "t1" can be any table. While runing the test above, the JDBC driver will report "The following columns were part of the SELECT statement for this result set, but were never referenced: .count(*)". This is simply wrong. How to repeat: Connection to any database and execute the following. ((com.mysql.jdbc.Connection)conn).setUseUsageAdvisor(true); java.sql.Statement stmt = conn.createStatement(); java.sql.ResultSet rs = stmt.executeQuery("select count(*) from t1 limit 1"); rs.next(); System.out.println("T1 has " + rs.getInt(1) + " rows"); rs.close(); Where "conn" is the connection to the database and "t1" can be any table.