Table not found in MySQL8


stephane
 
Edited

Hi,

I'm facing some issue to use a fresh new mysql8 server. DN doesn't find the tables because of case sensitivity.

Tables are created in lowercase while DN search for upper case.

Debugging schema introspection:
- First, DN load database options/features: JDBC metadata storesUpperCaseQuotedIdentifiers and supportsMixedCaseIdentifiers returns TRUE which forces DN to upper case tables, columns, ... names (in DatastoreIdentifierImpl)

- Then DN loads database objects (tables, columns, ...) matching these upper case names with lower case names returned by the database (RDBMSSchemaHandler getTableType) and doesn't find any match


There are probably a lot of good reasons to have this algorithm, but on one hand (tables names coming from the mapping) DN forces upper case and on the other hand
 (tables names coming from the database).

Could that makes sense to force the name of database objects (table column, index, ...) in the same way DN forces these names of tables, columns, indexes, ... coming from the mapping
, applying IdentifierFactory.getIdentifierInAdapterCase on rs.getString(3) here in RDBMSSchemaHandler getTableType:

if ((insensitive && tableName.equalsIgnoreCase(rs.getString(3))) ||
(!insensitive && tableName.equals(rs.getString(3))))

thanks,

I haven't seen so far any settings to override this behavior to force lower case or force upper case or just leave names unchanged ?

I uses DN 5.2.1, MySQL 8.0.23 and tested the 2 drivers JDBC 5.1.40 and 8.0.23. The connection pool is HikaryCP.

--
Stephane

Join main@datanucleus.groups.io to automatically receive all group messages.