[ 
https://issues.apache.org/jira/browse/OPENJPA-2935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18142434#comment-18142434
 ] 

ASF subversion and git services commented on OPENJPA-2935:
----------------------------------------------------------

Commit 4cd498dbb7742a1ebf455d8492a74c045109964f in openjpa's branch 
refs/heads/OPENJPA-3074 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=4cd498dbb ]

Merge remote-tracking branch 'origin/OPENJPA-2935' into OPENJPA-3074

# Conflicts:
#       
openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java


> Timestamp + coalesce + orderBy + Postgres makes Postgres syntax errors
> ----------------------------------------------------------------------
>
>                 Key: OPENJPA-2935
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2935
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 3.1.2
>            Reporter: Pawel Veselov
>            Priority: Major
>
> {code:java}
> public class E {
>   @Column(name = "due")
>   private Timestamp due;
> }
> {code}
>  
> Using criteria API, when querying from E, say:
> Timestamp ts = new Timestamp();
> {{query.orderBy(cb.asc(cb.coalesce(root.get(E_.due), ts)))}}
> Same if using {{cb.literal()}}
>  Results in:
> {noformat}
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: syntax 
> error at or near "11"
>   Position: 77 {prepstmnt 575413488 SELECT t0.X, COALESCE(t0.due,2025-04-08 
> 11:56:02.93), t0.id FROM E t0 ORDER BY  COALESCE(t0.due,2025-04-08 
> 11:56:02.93) ASC, t0.id ASC LIMIT ? [params=(long)
>  1]} [code=0, state=42601]
> {noformat}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to