Bug #34194 Error in ResultSetMetadata.getColumnTypeName()
Submitted: 31 Jan 2008 12:53 Modified: 1 Mar 2008 12:29
Reporter: Alejandro Soto Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.0.8, any OS:Any
Assigned to: CPU Architecture:Any

[31 Jan 2008 12:53] Alejandro Soto
Description:
Error returning de Column Type Name of a Geometry Field. Now Driver returns UNKNOWNK but it should return "GEOMETRY".

How to repeat:
Compile and execute TestResultSetMetadata.java

This .java creates a table called "test_geom2" under the "test" schema and insert only one record.

Suggested fix:
Add in com/mysql/jdbc/ResultSetMetaData.java at getColumnTypeName method:

case MysqlDefs.FIELD_TYPE_GEOMETRY:
      return "GEOMETRY";
[31 Jan 2008 12:57] Alejandro Soto
TestCase and ResultSetMetadata.java

Attachment: bug-data-34194.zip (application/x-zip-compressed, text), 6.72 KiB.

[1 Feb 2008 8:59] Tonci Grgin
Test case

Attachment: TestBug34194.java (text/x-java), 985 bytes.

[1 Feb 2008 9:03] Tonci Grgin
Hi Alejandro and thanks for your report. Truly there seems there's no support for GEOMETRY field type in any version of c/J but I will have to let Mark rule on this one as I don't see it in Java (well except for java.awt class...).

Verified as described with test case attached.
[27 Feb 2008 5:35] 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/43032
[27 Feb 2008 17:12] 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/43086
[1 Mar 2008 12:29] MC Brown
A note has been added to the 5.1.6 changelog: 

When retrieving the column type name of a geometry field, the driver would return UNKNOWN instead of GEOMETRY.