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

Pavel Kuznetsov commented on IGNITE-11511:
------------------------------------------

Implemented tests for the parameters.

Currently there is no bug. 

Let's see the example:
if we got update query: 
{code:sql}
UPDATE PARAMS SET VAL1 = ?, VAL2 = ? WHERE ID = ?
{code}

it is internally transformed to: 
{code:sql}
UPDATE PUBLIC.PARAMS
SET
VAL1 = ?1,
    VAL2 = ?2
WHERE ID = ?3
{code}

and we generate select statement for it:
{code:sql}
SELECT
_KEY,
_VAL,
?1 AS """_upd_VAL1""",
?2 AS """_upd_VAL2"""
FROM PUBLIC.PARAMS
WHERE ID = ?3
{code}

> SQL: Possible bug with parameters passing for complex DML queries
> -----------------------------------------------------------------
>
>                 Key: IGNITE-11511
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11511
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Vladimir Ozerov
>            Assignee: Pavel Kuznetsov
>            Priority: Major
>             Fix For: 2.8
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> See methods {{IgniteH2Indexing.executeSelectLocal}} and 
> {{IgniteH2Indexing.executeSelectForDml}}. They both could be invoked for 
> {{SELECT}} statements extracted from DML. 
> But notice how parameters are passed: it seems that we may pass parameters 
> from DML statement unchanged, which is illegal. E.g. consider the following 
> DML:
> {code}
> UPDATE table SET x=? WHERE x=?
> {code}
> In this case SELECT statement should get only the second parameter.
> Need to create tests to confirm that this is the case and make necessary 
> fixes if needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to