Great, thank you! -SB
On Thu, Aug 1, 2013 at 9:22 AM, Lukas Eder <[email protected]> wrote: > Huh, I've just noticed that the issue appears also for regular bind > values. That's just how MySQL works. So jOOQ shouldn't fix this and you > should either: > > 1. Escape string values yourself > 2. (better in my opinion) turn off backslash escaping > > http://stackoverflow.com/a/9428285/521799 > > Hope this helps > Lukas > > > 2013/8/1 Lukas Eder <[email protected]> > >> For the record, the documentation is here: >> >> http://dev.mysql.com/doc/refman/5.7/en/string-literals.html#character-escape-sequences >> >> >> 2013/8/1 Lukas Eder <[email protected]> >> >>> Hmm, that's surprising to me. I wasn't aware that MySQL uses backslashes >>> for escaping. The same queries in MySQL and Oracle: >>> >>> MySQL: http://sqlfiddle.com/#!2/af671 >>> Oracle: http://sqlfiddle.com/#!4/7ca18 >>> >>> Thanks for reporting this. This needs to be fixed! >>> https://github.com/jOOQ/jOOQ/issues/2669 >>> >>> The other question here is why the value is inlined...? Did you >>> explicitly use inlined bind values or did you set the relevant Settings >>> flag? You wouldn't have this problem if you were using PreparedStatements >>> >>> Cheers >>> Lukas >>> >>> >>> 2013/8/1 SB <[email protected]> >>> >>>> Hello, >>>> >>>> I have the following value that I need to insert: >>>> >>>> car\ >>>> >>>> Note the backslash at the end. It seems like JOOQ is generating an >>>> insert statement for MySQL that looks like this: >>>> >>>> insert into `database`.`TABLE` (`column1`) value ('car\') >>>> >>>> This causes the following exception to be thrown. Do I need to escape >>>> backslashes before inserting using JOOQ? >>>> >>>> Exception in thread "main" org.jooq.exception.DataAccessException: SQL >>>> [null]; You have an error in your SQL syntax; check the manual that >>>> corresponds to your MySQL server version for the right syntax to use near >>>> .... >>>> >>>> Thanks, >>>> -SB >>>> >>>> -- >>>> 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 [email protected]. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "jOOQ User Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/jooq-user/JdU_Qaap94E/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
