Possible bug in jooq 3.4

23 views
Skip to first unread message

spiel.c...@gmail.com

unread,
Jun 26, 2014, 8:53:03 AM6/26/14
to jooq...@googlegroups.com
Hello,

I am developing an app using jooq and a SQlite database and I am facing the following problem after updating to jooq 3.4 (from 3.3.2):

Field names with spaces which have been perfectly escaped in queries with quotes in jooq 3.3.2 (and before) are not escaped anymore with jooq 3.4 leading to SQL errors in many queries.

Thanks and best regards

Christian

Lukas Eder

unread,
Jun 26, 2014, 4:42:40 PM6/26/14
to jooq...@googlegroups.com
Hello Christian,

The change is expected. Please refer to the section about backwards-incompatible behavioural changes of the release notes: (http://www.jooq.org/notes)

Behavioural changes (backwards-incompatible)

#3131 Query.getBindValues() should not return inlined bind values
#3132 Quoting identifiers that contain "special characters" may lead to unexpected results when using RenderNameStyle.AS_IS
#3306 Let Record.key() return a "copy record", instead of a view to the original record

As you can see, #3132 was implemented to remove this "clever" automatic quoting of *some* identifiers.

More information about that change here:

Ideally, you would be generally turning on quoting of identifiers using the default RenderNameStyle.QUOTED Setting.

Hope this helps,
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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

spiel.c...@gmail.com

unread,
Jun 27, 2014, 5:37:34 AM6/27/14
to jooq...@googlegroups.com
Dear Lukas,

Thanks for the answer. 
However, using configuration.settings().setRenderNameStyle(RenderNameStyle.QUOTED) for the DSLContext configuration before the query does not change anything (i.e. column names are still unquoted).

Best regards

Christian

Lukas Eder

unread,
Jun 27, 2014, 7:44:48 AM6/27/14
to jooq...@googlegroups.com
Hi Christian,

Hmm, you're right, I'm sorry about the confusion. 

This is due to #2367, due to which we decided to generally omit quoting for SQLite as SQLite sometimes treats quoted identifiers as string literals. Some details here:

I have registered an issue for this, which should be fixed ASAP (and will be merged to 3.4.1):

Thanks a lot for reporting this.

In the mean time, I can see two options:
- Tweak DefaultRenderContext.literal() to handle this correctly for SQLite
- Revert to jOOQ 3.3.x

Best Regards,
Lukas
Reply all
Reply to author
Forward
0 new messages