Andrey Khitrin created IGNITE-23073:
---------------------------------------

             Summary: Sql. Constant default value is not implemented for UUID 
data type
                 Key: IGNITE-23073
                 URL: https://issues.apache.org/jira/browse/IGNITE-23073
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 3.0.0-beta2
            Reporter: Andrey Khitrin


In SQL, it's possible to define default values for some columns. These values 
would be used on insertion when explicit values are omitted. For example:
{code:sql}
sql-cli> create table def_time(key INTEGER not null, val TIME not null default 
'12:12:12', primary key (key));
sql-cli> insert into def_time (key) values (1);
sql-cli> select * from def_time;
╔═════╤══════════╗
║ KEY │ VAL      ║
╠═════╪══════════╣
║ 1   │ 12:12:12 ║
╚═════╧══════════╝
{code}

But it's not true for *UUID* data type. It's possible to "define" default value 
for this type, but it's not actually applied as default:
{code:sql}
sql-cli> create table def_uuid(key INTEGER not null, val UUID not null default 
'4a2f1859-c73b-4eec-a29c-629ec68d8735', primary key (key));
sql-cli> insert into def_uuid(key) values (1);
Unknown error
null
{code}

Only explicit UUID values are currently supported:
{code:sql}
sql-cli> insert into def_uuid values (2, 
'46e438c5-4722-4806-8614-e5aa15b9ded8');
Updated 1 rows.
sql-cli> select * from def_uuid;
╔═════╤══════════════════════════════════════╗
║ KEY │ VAL                                  ║
╠═════╪══════════════════════════════════════╣
║ 2   │ 46e438c5-4722-4806-8614-e5aa15b9ded8 ║
╚═════╧══════════════════════════════════════╝
{code}

Found on `06f62ebd7abb76f9c24d171cf03bad26f21436ca`.

Probably, it's simply a non-implemented-yet feature (as UUID-related epic is 
not completely finished yet). In that case, feel free to trasnform this ticket 
from bug into a feature request.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to