[
https://issues.apache.org/jira/browse/OPENJPA-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106221#comment-18106221
]
Maxim Solodovnik commented on OPENJPA-2960:
-------------------------------------------
[~romain.manni-bucau] I believe this one was fixed with
https://github.com/apache/openjpa/commit/52f4c065d730fd0816a41e70b1bfe6301a5bc94a
Is there anything else need to be done?
> NULLS FIRST/LAST string rewrite breaks on commas, triplicated
> -------------------------------------------------------------
>
> Key: OPENJPA-2960
> URL: https://issues.apache.org/jira/browse/OPENJPA-2960
> Project: OpenJPA
> Issue Type: Sub-task
> Components: jpa
> Affects Versions: 4.2.0
> Reporter: Maxim Solodovnik
> Assignee: Romain Manni-Bucau
> Priority: Major
> Fix For: 4.2.0
>
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3683001538)
> **(high)** The NULLS FIRST/LAST emulation finds the last order term with
> `sql.lastIndexOf(", ", termDirStart)`, so any ORDER BY expression containing
> a comma (e.g. `COALESCE(t0.x, 0) DESC`) is split mid-argument-list and the
> rewrite produces corrupt SQL; duplicating the expression also duplicates `?`
> markers without duplicating bound parameters. The block is triplicated in
> MariaDBDictionary (~575) and SQLServerDictionary (~484) - can it be extracted
> to a shared helper operating on the order term before it is appended to the
> buffer instead of string-parsing it back out?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)