Yaroslav Molochkov created IGNITE-14214:
-------------------------------------------

             Summary: Incorrect merge query when using oracle dialect
                 Key: IGNITE-14214
                 URL: https://issues.apache.org/jira/browse/IGNITE-14214
             Project: Ignite
          Issue Type: Bug
            Reporter: Yaroslav Molochkov
            Assignee: Yaroslav Molochkov


If table contains only keys (e.g. relationship table) then returned query 
contains empty update fields and resulting syntax is incorrect. 

Consider the following example:

org.apache.ignite.cache.store.jdbc.dialect.OracleDialect#mergeQuery accepts key 
and val collections. The problem is relevant if val collection is empty.
{code:java}
return String.format("MERGE INTO %s t" +
    " USING (SELECT %s FROM dual) v" +
    "  ON %s" +
    " WHEN MATCHED THEN" +
    "  UPDATE SET %s" +
    " WHEN NOT MATCHED THEN" +
    "  INSERT (%s) VALUES (%s)", fullTblName, selCols, match, setCols, colsLst, 
valuesCols);
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to