Begin;
Initialize;
InitializeSession "TESTDB";
Command "create database TESTDB";
TerminateSession;
InitializeSession "TESTDB";
Command "create table T_1 (col1 decimal(2,0), col2 bigint)";
Command "insert T_1(col1) values (0)";
Command "update T_1 set col2 = col1";
Command "select * from T_1";
Command "update T_1 set col2 = null";
Command "update T_1 set col2 = 0";
Command "select * from T_1";
Command "drop table T_1";
Command "create table T_2 (col1 decimal(19,9), col2 bigint)";
Command "insert T_2(col1) values (-1)";
Command "update T_2 set col2 = col1";
Command "select * from T_2";
Command "update T_2 set col2 = null";
Command "update T_2 set col2 = -1";
Command "select * from T_2";
Command "drop table T_2";
Command "create table T_3 (col1 decimal(36,36), col2 bigint)";
Command "insert T_3(col1) values (0.210987654321098765432109876543210987)";
Command "update T_3 set col2 = col1";
Command "select * from T_3";
Command "update T_3 set col2 = null";
Command "update T_3 set col2 = 0.210987654321098765432109876543210987";
Command "select * from T_3";
Command "drop table T_3";
Command "create table T_4 (col1 decimal(2,1), col2 bigint)";
Command "insert T_4(col1) values (-6.5)";
Command "update T_4 set col2 = col1";
Command "select * from T_4";
Command "update T_4 set col2 = null";
Command "update T_4 set col2 = -6.5";
Command "select * from T_4";
Command "drop table T_4";
Command "create table T_5 (col1 decimal(19,0), col2 bigint)";
Command "insert T_5(col1) values (null)";
Command "update T_5 set col2 = col1";
Command "select * from T_5";
Command "update T_5 set col2 = null";
Command "update T_5 set col2 = null";
Command "select * from T_5";
Command "drop table T_5";
Command "create table T_6 (col1 decimal(36,0), col2 bigint)";
Command "insert T_6(col1) values (9223372036854775807)";
Command "update T_6 set col2 = col1";
Command "select * from T_6";
Command "update T_6 set col2 = null";
Command "update T_6 set col2 = 9223372036854775807";
Command "select * from T_6";
Command "drop table T_6";
Command "create table T_7 (col1 decimal(21,2), col2 bigint)";
Command "insert T_7(col1) values (-9223372036854775808)";
Command "update T_7 set col2 = col1";
Command "select * from T_7";
Command "update T_7 set col2 = null";
Command "update T_7 set col2 = -9223372036854775808";
Command "select * from T_7";
Command "drop table T_7";
Command "create table T_8 (col1 decimal(19,9), col2 bigint)";
Command "insert T_8(col1) values (0)";
Command "update T_8 set col2 = col1";
Command "select * from T_8";
Command "update T_8 set col2 = null";
Command "update T_8 set col2 = 0";
Command "select * from T_8";
Command "drop table T_8";
Command "create table T_9 (col1 decimal(19,0), col2 bigint)";
Command "insert T_9(col1) values (-2109876543210987654)";
Command "update T_9 set col2 = col1";
Command "select * from T_9";
Command "update T_9 set col2 = null";
Command "update T_9 set col2 = -2109876543210987654";
Command "select * from T_9";
Command "drop table T_9";
Command "create table T_10 (col1 decimal(36,18), col2 bigint)";
Command "insert T_10(col1) values (654321098765432109.876543210987654321)";
Command "update T_10 set col2 = col1";
Command "select * from T_10";
Command "update T_10 set col2 = null";
Command "update T_10 set col2 = 654321098765432109.876543210987654321";
Command "select * from T_10";
Command "drop table T_10";
Command "create table T_11 (col1 decimal(36,17), col2 bigint)";
Command "insert T_11(col1) values (9223372036854775807)";
Command "update T_11 set col2 = col1";
Command "select * from T_11";
Command "update T_11 set col2 = null";
Command "update T_11 set col2 = 9223372036854775807";
Command "select * from T_11";
Command "drop table T_11";
Command "create table T_12 (col1 decimal(36,0), col2 bigint)";
Command "insert T_12(col1) values (-9223372036854775808)";
Command "update T_12 set col2 = col1";
Command "select * from T_12";
Command "update T_12 set col2 = null";
Command "update T_12 set col2 = -9223372036854775808";
Command "select * from T_12";
Command "drop table T_12";
Command "create table T_13 (col1 decimal(2,0), col2 bigint)";
Command "insert T_13(col1) values (1)";
Command "update T_13 set col2 = col1";
Command "select * from T_13";
Command "update T_13 set col2 = null";
Command "update T_13 set col2 = 1";
Command "select * from T_13";
Command "drop table T_13";
Command "create table T_14 (col1 decimal(2,1), col2 bigint)";
Command "insert T_14(col1) values (2.1)";
Command "update T_14 set col2 = col1";
Command "select * from T_14";
Command "update T_14 set col2 = null";
Command "update T_14 set col2 = 2.1";
Command "select * from T_14";
Command "drop table T_14";
Command "create table T_15 (col1 decimal(19,19), col2 bigint)";
Command "insert T_15(col1) values (-0.6543210987654321098)";
Command "update T_15 set col2 = col1";
Command "select * from T_15";
Command "update T_15 set col2 = null";
Command "update T_15 set col2 = -0.6543210987654321098";
Command "select * from T_15";
Command "drop table T_15";
Command "create table T_16 (col1 decimal(20,1), col2 bigint)";
Command "insert T_16(col1) values (9223372036854775807)";
Command "update T_16 set col2 = col1";
Command "select * from T_16";
Command "update T_16 set col2 = null";
Command "update T_16 set col2 = 9223372036854775807";
Command "select * from T_16";
Command "drop table T_16";
Command "create table T_17 (col1 decimal(28,9), col2 bigint)";
Command "insert T_17(col1) values (-9223372036854775808)";
Command "update T_17 set col2 = col1";
Command "select * from T_17";
Command "update T_17 set col2 = null";
Command "update T_17 set col2 = -9223372036854775808";
Command "select * from T_17";
Command "drop table T_17";
Command "create table T_18 (col1 decimal(2,0), col2 bigint)";
Command "insert T_18(col1) values (65)";
Command "update T_18 set col2 = col1";
Command "select * from T_18";
Command "update T_18 set col2 = null";
Command "update T_18 set col2 = 65";
Command "select * from T_18";
Command "drop table T_18";
TerminateSession;
InitializeSession "TESTDB";
Command "drop database TESTDB";
TerminateSession;
Terminate;
End;
