Bug #1914 | Add support for {fn CONVERT | ||
---|---|---|---|
Submitted: | 21 Nov 2003 15:50 | Modified: | 2 Dec 2003 11:40 |
Reporter: | Kevin Grittner | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S4 (Feature request) |
Version: | 3.0.9-stable | OS: | |
Assigned to: | CPU Architecture: | Any |
[21 Nov 2003 15:50]
Kevin Grittner
[2 Dec 2003 11:40]
Mark Matthews
This is fixed for 3.0.10, and will be in the nightly snapshot builds of 3.0 after 00:00 GMT tomorrow, however, the types that are supported depend on the version of MySQL you are using (full JDBC-compliant support is offered for MySQL > 4.0.2), and currently the only types supported are ones specified by the JDBC spec, which according to my copy is: BIGINT, BINARY, BIT, CHAR, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGVARBINARY, LONGVARCHAR, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, VARBINARY, and VARCHAR. (JDBC 1.1. spec, page 36) I haven't been able to find where the JDBC 1.1 spec talks about prefacing these tokens with a 'SQL_', or any revisions to this in any newer spec. If you could point out where this is specified, I can look at implementing the SQL_ style of these tokens. The JDBC spec also seems to be unclear as to whether DatabaseMetaData.supportsConvert() relates to the {fn convert ...} escape sequence, from the JDBC-3.0 spec: "14.2.3.1 Data Type Conversions The recommended ResultSet getter method for each JDBC type is shown in TABLE B-6 on page B-182. This table also shows all of the possible conversions that a JDBC driver may support. The method DataBaseMetaData.supportsConvert(int fromType, int toType) returns true if the driver supports the given conversion." Which appears to me that the Connector/J's current version of supportsConvert() is correct (i.e not tied to escape codes). I will ask for clarification on this issue with the JDBC spec lead, however if you have evidence that this is not the case, please let me know!