Bug #21379 | LAST_INSERT_ID() does not return results | ||
---|---|---|---|
Submitted: | 1 Aug 2006 3:40 | Modified: | 19 Sep 2006 1:48 |
Reporter: | Ronald Bradford | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 5.0.3 | OS: | Linux (Linux FC5) |
Assigned to: | Mark Matthews | CPU Architecture: | Any |
Tags: | Connector/J, LAST_INSERT_ID |
[1 Aug 2006 3:40]
Ronald Bradford
[1 Aug 2006 3:58]
Mark Matthews
Ronald, is there an actualy exception thrown? You wouldn't happen to know if JSTL's taglib uses RSMD.getColumnName() or .getColumnLabel() to generate the keyset, would you (I don't use it, myself).
[1 Aug 2006 4:04]
Mark Matthews
Connector/J 5.0, in a move to be JDBC-compliant, returns the alias name only in RSMD.getColumnLabel() and the original column name for RSMD.getColumnName(), and thus JSTL is getting somewhat confused, since it uses RSMD.getColumnName() to generate the "key" set for your map. We're going to add a backwards-compatible option to revert to the old (but non-spec-compliant) behavior, since (1) MySQL doesn't always return the original column name (in the case of functions) and (2) some frameworks/libraries don't follow the JDBC spec in using column names and labels.
[1 Aug 2006 5:14]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/9869
[1 Aug 2006 5:28]
Ronald Bradford
Thanks for the extremely prompt reply and patch. Will await a nightly build/release. For reference to your first question Re: getColumeName() Using source archive at http://people.apache.org/builds/jakarta-taglibs/nightly/src/jakarta-taglibs-src-20060731.t... getColumnName is used. See Line 70 of jakarta-taglibs/standard-1.0/src/javax/servlet/jsp/jstl/sql/ResultImpl.java 64 ResultSetMetaData rsmd = rs.getMetaData(); 65 int noOfColumns = rsmd.getColumnCount(); 66 67 // Create the column name array 68 columnNames = new String[noOfColumns]; 69 for (int i = 1; i <= noOfColumns; i++) { 70 columnNames[i-1] = rsmd.getColumnName(i); 71 }