OK, thanks for the feedback. In that case, this will get fixed implicitly
when we implement support for custom escaping of apostrophes in strings:
https://github.com/jOOQ/jOOQ/issues/3000

Right now, jOOQ only supports the SQL standard, which is doubling the
apostrophe.

Cheers,
Lukas

2014-09-16 15:37 GMT+02:00 <[email protected]>:

> Hi,
>
> Thanks for looking into my issue. With '' (2x apostrophe), the query works
> in both 3.3 and 3.4.
>
> On Monday, September 15, 2014 7:59:44 AM UTC-4, Lukas Eder wrote:
>>
>> In fact, I wonder why it had worked before. What happens if you replace
>> the various occurrences of \' (backslash, apostrophe) by '' (2x apostrophe)?
>>
>> 2014-09-15 13:57 GMT+02:00 Lukas Eder <[email protected]>:
>>
>>> Hello,
>>>
>>> Thanks for reporting. Interesting - I suspect that currently, the bind
>>> variable parser doesn't correctly handle multiple embedding of string
>>> literals, i.e. string literals within string literals. I'll have to look
>>> into this and will keep you posted.
>>>
>>> I've registered an issue for this:
>>> https://github.com/jOOQ/jOOQ/issues/3630
>>>
>>> Cheers
>>> Lukas
>>>
>>> 2014-09-10 16:27 GMT+02:00 <[email protected]>:
>>>
>>> Hi,
>>>>
>>>> I recently updated to jooq 3.4.2 from jooq 3.3.1. One of the query my
>>>> application make now raise a ArrayOutOfBoundsException in the
>>>> Utils.renderAndBind method. The query worked well with jooq 3.3 and it
>>>> still works when I execute it in directly in the database.
>>>>
>>>> Here is the query. Note that the UNLOAD statement is a functionnality
>>>> of Amazon Redshift and I removed the credentials :
>>>>
>>>> UNLOAD ('select replace("t"."search_id", \'"\', \'""\'),
>>>> replace("t"."source_name", \'"\', \'""\'), replace("t"."collection_name",
>>>> \'"\', \'""\'), replace("t"."system_uri_hash", \'"\', \'""\'),
>>>> "t"."click_rank", "t"."datetime", replace("t"."cause2", \'"\', \'""\'),
>>>> replace("t"."custom_metadata_1", \'"\', \'""\'),
>>>> replace("t"."custom_metadata_2", \'"\', \'""\'),
>>>> replace("t"."custom_metadata_3", \'"\', \'""\'),
>>>> replace("t"."custom_metadata_4", \'"\', \'""\'),
>>>> replace("t"."custom_metadata_5", \'"\', \'""\'),
>>>> replace("t"."custom_datas", \'"\', \'""\') from "c_test1"."clicks" as "t"
>>>> where exists (select 1 as "one" from "c_test1"."clicks" where
>>>> ("c_test1"."clicks"."datetime" between timestamp \'2014-08-10 00:00:00.0\'
>>>> and timestamp \'2014-09-10 23:59:59.0\' and "t"."search_id" =
>>>> "c_test1"."clicks"."search_id"))')
>>>> TO 's3://fictional/location/'
>>>> WITH CREDENTIALS 'aws_access_key_id=****;aws_secret_access_key=****'
>>>> DELIMITER ','
>>>> ADDQUOTES;
>>>>
>>>>
>>>> With jooq 3.4, I get the following stacktrace :
>>>>
>>>> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1069
>>>>  at org.jooq.impl.Utils.renderAndBind(Utils.java:1177) ~[jooq-3.4.1.jar
>>>> :na]
>>>>  at org.jooq.impl.SQLTemplate$SQLTemplateQueryPart.accept(SQLTemplate.
>>>> java:83) ~[jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java
>>>> :445) ~[jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:361) ~[
>>>> jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractContext.visit(AbstractContext.java:136) ~[
>>>> jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.SQLQuery.accept(SQLQuery.java:73) ~[jooq-3.4.1.jar:na
>>>> ]
>>>>  at org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java
>>>> :445) ~[jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:361) ~[
>>>> jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractContext.visit(AbstractContext.java:136) ~[
>>>> jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.DefaultRenderContext.render(DefaultRenderContext.java
>>>> :199) ~[jooq-3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractQuery.getSQL0(AbstractQuery.java:429) ~[jooq-
>>>> 3.4.1.jar:na]
>>>>  at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:292) ~[jooq-
>>>> 3.4.1.jar:na]
>>>>  at org.jooq.impl.DefaultDSLContext.execute(DefaultDSLContext.java:543)
>>>> ~[jooq-3.4.1.jar:na]
>>>>  at com.coveo.ua.data.StarSchemaDal.exportTable(StarSchemaDal.java:650)
>>>> ~[classes/:na]
>>>>  at com.coveo.ua.data.StarSchemaDal.exportClicks(StarSchemaDal.java:674
>>>> ) ~[classes/:na]
>>>>  at com.coveo.ua.core.scheduling.jobs.ExportJob.execute(ExportJob.java:
>>>> 152) ~[classes/:na]
>>>>
>>>> Thanks,
>>>> Jonathan
>>>>
>>>>  --
>>>> 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/d/optout.
>>>>
>>>
>>>
>>  --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to