Possible bug in DatabaseMetaData when using MySQL compatibility mode

83 views
Skip to first unread message

Thomas

unread,
Aug 20, 2012, 12:28:00 PM8/20/12
to h2-da...@googlegroups.com
Hello,

when starting H2 in "MySQL Mode" (using MODE=MySQL in the connection URL), the documentation says: "Meta data calls return identifiers in lower case."

Unfortunatelyl DatabaseMetaData.storesUpperCaseIdentifiers() still returns true in that case and DatabaseMetaData.storesLowerCaseIdentifiers() still returns fals.

If those methods are used to determine whether a table named test needs to be quoted (because it's stored in a non-default case) the test fails because of.

I would expect DatabaseMetaData.storesLowerCaseIdentifiers() to return true and DatabaseMetaData.storesLowerCaseIdentifiers() to return false in MySQL mode - or am I missing something?

Thomas

unread,
Sep 8, 2012, 6:12:51 AM9/8/12
to h2-da...@googlegroups.com
Any thoughts on this?

Thomas Mueller

unread,
Sep 20, 2012, 2:14:43 PM9/20/12
to h2-da...@googlegroups.com
Hi,

It's true, in MySQL mode the database should return a different value. It's a bit hard to support those features, but it should be possible. I don't know if some applications call those methods a lot, so I guess it's best if the value is only read from the database once per connection (lazily) and from them on the same value is returned (for the given connection). Patches are welcome of course ;-)

Regards,
Thomas



--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/YwsPnuzJJKsJ.

To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Message has been deleted

Thomas Mueller

unread,
Feb 23, 2013, 11:24:17 AM2/23/13
to H2 Google Group
Hi,

I have now added support for this: "Improved compatiblity with MySQL in the MySQL mode: now the methods DatabaseMetaData methods stores*Case*Identifiers return the same as MySQL when using the MySQL mode.".

Could you check if this is now working for you? You will need to build H2 yourself (the change is in the trunk).

Regards,
Thomas
Reply all
Reply to author
Forward
0 new messages