Hi, I've been struggling with an issue regarding JOOQ, Drizzle JDBC and MySQL.
Drizzle JDBC is a BSD licensed JDBC driver:
http://www.drizzle.org/content/downloadWhile attempting to call context.meta().getTables() I've been getting exceptions like this:
java.lang.ArrayIndexOutOfBoundsException: -1
at org.jooq.impl.AbstractRecord.getValue0(AbstractRecord.java:271)
at org.jooq.impl.AbstractRecord.getValue0(AbstractRecord.java:275)
at org.jooq.impl.AbstractRecord.getValue(AbstractRecord.java:169)
at org.jooq.impl.Utils.setValue(Utils.java:1121)
at org.jooq.impl.ResultImpl.intoGroups(ResultImpl.java:915)
at org.jooq.impl.MetaImpl$MetaSchema.getColumns(MetaImpl.java:262)
at org.jooq.impl.MetaImpl$MetaSchema.getTables(MetaImpl.java:238)
at org.jooq.impl.MetaImpl.getTables(MetaImpl.java:151)
After some digging around in the source, and perusing some searches I believe it has to do with the way Drizzle lower cases all column names when it returns results. From what I've read the lower casing of column names is intended in Drizzle ( ref:
https://lists.launchpad.net/drizzle-discuss/msg06133.html ).
As for JOOQ. These two lines are hard coded in MetaImpl.java
Field<String> tableSchem = fieldByName(String.class, "TABLE_SCHEM");
Field<String> tableName = fieldByName(String.class, "TABLE_NAME");
and Fields.field(Field<T>) and most Field.equals() implementations do comparisons based on the 'name' of the column, but does so using a case sensitive string equals(). I am unsure if this is a specific design choice or not.
As a temporary solution switching to the MariaDB JDBC connector (
https://downloads.mariadb.org/client-java/+releases/ ) is a viable workaround however I'd prefer to keep using Drizzle if possible.