toSql() generates Ansi quotes for MySQL

9 views
Skip to first unread message

Aram Mirzadeh

unread,
Mar 15, 2018, 7:09:42 AM3/15/18
to jOOQ User Group

Hi, 

This is using jOOQ 3.10.5, Java 8 in eclipse.

It's been a great while since I have had to use toSql to diagnose a jOOQ rendering issue so this may be a moot question if it was done intentionally.  And it makes no real difference it isn't a valid MySQL command unless you have ANSIQUOTES set in your mysql startup which isn't recommended (I'm sort of guessing at that one since I remember reading it but now I cannot find the original source).

I'm using this on my test bench: 

    private static DSLContext db(Connection connection) {
        return DSL.using(connection, SQLDialect.MYSQL, getSettings());
    }

    private static Settings getSettings() {
        return new Settings().withRenderSchema(Boolean.TRUE)
                             .withRenderNameStyle(RenderNameStyle.UPPER)
                             .withRenderKeywordStyle(RenderKeywordStyle.UPPER)
                             .withRenderFormatted(Boolean.TRUE)
                             .withParamType(ParamType.NAMED)
                             .withStatementType(StatementType.PREPARED_STATEMENT)
                             .withExecuteLogging(Boolean.TRUE)
                             .withFetchWarnings(Boolean.TRUE)
                             .withUpdatablePrimaryKeys(Boolean.FALSE);
    }

.toSql() is using ANSI quotes (") rather than (`)?


Lukas Eder

unread,
Mar 15, 2018, 7:19:38 AM3/15/18
to jooq...@googlegroups.com
Hi Aram,

We haven't switched from using ` to " in MySQL. What are you calling toSql() on? Are you sure that object is configured with your settings?

Cheers,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aram Mirzadeh

unread,
Mar 15, 2018, 7:32:11 AM3/15/18
to jOOQ User Group

Sorry ignore the question .... turned out to be a rogue driver in my classpath.  I guess the "or else" condition is to use ANSI quotes.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages