Bug #11575 DatabaseMetaData.storesMixedCaseIdentifiers() incorrect on Windows
Submitted: 25 Jun 2005 19:23 Modified: 17 Oct 2005 19:42
Reporter: Andy Jefferson Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:3.1 OS:Microsoft Windows (Windows NT)
Assigned to: Mark Matthews CPU Architecture:Any

[25 Jun 2005 19:23] Andy Jefferson
Description:
On a Windows NT platform the JDBC driver (connected to a MySQL server running on the same machine) returns true to DatabaseMetaData.storesMixedCaseIdentifiers() and false to DatabaseMetaData.storesLowerCaseIdentifiers(). However in the server the identifiers are all stored in lower case (presumably down to Windows not knowing what to do with case).

On Unix it works fine because the server on Unix does store identifiers in mixed case.

MySQL Connector/J should return true to storesLowerCaseIdentifiers() for Windows MySQL servers, and false to storesMixedCaseIdentifiers(). There is software that relies on these methods and their behaviour is deficient because of this.

[If I create a table specifying the table name in UPPERCASE (using the same JDBC adapter), and then call DatabaseMetaData.getColumns() passing in null for the table name I get the table name back in lowercase. When a user logs in to the server using the "mysql" command line, and create the table it is also stored in lowercase.]

See also the Forum thread http://forums.mysql.com/read.php?39,31201,31201#msg-31201

How to repeat:
Call DatabaseMetaData.storesMixedCaseIdentifiers() and you get true always regardless of the platform seemingly. 

Suggested fix:
Return the correct value for these storesXXXCaseIdentifiers() methods when (the server is) on Windows
[25 Jun 2005 20:03] Aleksey Kishkin
tested against 3.1.6 and 3.1.10. Testcase attached in FILES section
[25 Jun 2005 20:04] Aleksey Kishkin
test case

Attachment: bug11575.java (application/octet-stream, text), 845 bytes.