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

Aleksey Plekhanov commented on IGNITE-13142:
--------------------------------------------

[~skalashnikov], looks good to me. Thanks for the contribution!

Merged to master, cherry-picked to 2.9.

> SQL constraint not null added on key prevents correct inserts
> -------------------------------------------------------------
>
>                 Key: IGNITE-13142
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13142
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Kalashnikov
>            Assignee: Sergey Kalashnikov
>            Priority: Major
>             Fix For: 2.9
>
>         Attachments: SqlNotNullKeyFielfTest.java
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> It is possible to configure {{QueryEntity}} so that subsequent inserts would 
> fail.
> - lowercase {{keyFieldName}}
> - not null constraint on {{keyFieldName}}
> {code:java}
> new QueryEntity()
>     .setTableName("Person")
>     .setKeyFieldName("id")
>     .setKeyType("java.lang.Integer")
>     .setValueType("Person")
>     .setFields(new LinkedHashMap<>(
>             F.asMap("id", "java.lang.Integer",
>                     "name", "java.lang.String",
>                     "age", "java.lang.Integer")))
>     .setNotNullFields(F.asSet("id", "name", "age"))))
> {code}
> The following SQL produces error: Null value is not allowed for column 'ID'
> {code}
> insert into Person (id, name, age) values (1, 'John Doe', 30)
> {code}



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

Reply via email to