You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Maksim Zhuravkov (Jira)" <ji...@apache.org> on 2023/05/16 08:43:00 UTC
[jira] [Updated] (IGNITE-19481) Sql. Inconsistent behaviour of DML operations introduced by implicit type casts.
[ https://issues.apache.org/jira/browse/IGNITE-19481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maksim Zhuravkov updated IGNITE-19481:
--------------------------------------
Summary: Sql. Inconsistent behaviour of DML operations introduced by implicit type casts. (was: Sql. Inconsistent behaviour of DML operations. VARCHAR column = 1 <lit>)
> Sql. Inconsistent behaviour of DML operations introduced by implicit type casts.
> --------------------------------------------------------------------------------
>
> Key: IGNITE-19481
> URL: https://issues.apache.org/jira/browse/IGNITE-19481
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 3.0.0-beta1
> Reporter: Maksim Zhuravkov
> Priority: Minor
> Labels: ignite-3
>
> INSERT:
> {code:java}
> @Test
> public void testInsertIntToStr() {
> sql("CREATE TABLE t1(int_col INTEGER PRIMARY KEY, str_col VARCHAR)");
> sql("INSERT INTO t1 VALUES(1, 2)");
> }
> {code}
> Result: OK
> UPDATE:
> {code:java}
> @Test
> public void testUpdateIntToStr() {
> sql("CREATE TABLE t1(int_col INTEGER PRIMARY KEY, str_col VARCHAR)");
> sql("INSERT INTO t1 VALUES(1, '11111')");
> sql("UPDATE t1 SET str_col=1");
> }
> {code}
> Error:
> {code:java}
> TraceId:3b57d830-a327-4c77-89ec-a45a1411daf6 class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
> {code}
> *UUID*
> INSERT:
> {code:java}
> @Test
> public void testInsertUuid() {
> sql("CREATE TABLE t1(int_col INTEGER PRIMARY KEY, uuid_col UUID)");
> sql("INSERT INTO t1 VALUES(1, '1111111111')");// UUID
> }
> {code}
> Error:
> {code:java}
> TraceId:0ee739a2-422e-46a2-8186-c1640c35af14 Invalid UUID string: 1111111111
> {code}
> UPDATE:
>
> {code:java}
> @Test
> public void testUpdateUuid() {
> sql("CREATE TABLE t1(int_col INTEGER PRIMARY KEY, uuid_col UUID)");
> sql("INSERT INTO t1 VALUES(1, ?)", new UUID(0, 0));
> sql("UPDATE t1 SET uuid_col=111111");
> }
> {code}
> Error:
> {code:java}
> TraceId:2e4ffdec-1831-4f45-a8e7-6454ae3927f6 storageType is class java.util.UUID value must also be class java.util.UUID but it was: 111111
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)