Github user selvaganesang commented on a diff in the pull request: https://github.com/apache/trafodion/pull/1481#discussion_r176110128 --- Diff: core/sql/regress/seabase/EXPECTED020 --- @@ -3945,4 +3945,35 @@ AAAA ? 2 --- 1 row(s) selected. >> +>>obey TEST020(trafodion_2335); +>>--create seqence test020_seq; +>>create table test020t45(a largeint not null default unix_timestamp(), ++> b char(36) not null default uuid(), ++> c varchar(10) default to_char(sysdate,'YYYYMMDD'), ++> --support sequence as default in next check-in ++> --d int not null default testi020_seq.nextval, ++> e int ); + +--- SQL operation complete. +>>insert into test020t45(e) values(1),(2),(3); + +--- 3 row(s) inserted. +>>select count(*) from test020t45 where c = to_char(sysdate,'YYYYMMDD'); + +(EXPR) +-------------------- + + 3 + +--- 1 row(s) selected. +>>--negative tests +>>--the function is not variable-free, so should fail +>>create table test020t45(a largeint not null default unix_timestamp(), ++> b varchar(10) default to_char(test020t45.c,'YYYYMMDD'), ++> e int ); + +*** ERROR[1084] An invalid default value was specified for column B. + +*** ERROR[8822] The statement was not prepared. + --- End diff -- @traflm Thank for adding the test for upsert. This test just ensures that the upsert command worked. But, it doesn't check if the added default values are correct. You can take some cue from earlier tests in the same test file seabase/TEST020. Search for cqd traf_upsert_mode
---