create schema uint_cast2;
set current_schema to 'uint_cast2';
set dolphin.b_compatibility_mode to on;
drop table if exists t1 ;
NOTICE:  table "t1" does not exist, skipping
create table t1(a uint8);
insert into t1 values(1::text);
insert into t1 values(0::text);
insert into t1 values((-1)::text);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::bool);
insert into t1 values(0::bool);
insert into t1 values((-1)::bool);
insert into t1 values(1.0::float4);
insert into t1 values(0.0::float4);
insert into t1 values((-1.0)::float4);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775807.0::float4);
insert into t1 values(9223372036854775808.0::float4);
insert into t1 values(1.0::float8);
insert into t1 values(0.0::float8);
insert into t1 values((-1.0)::float8);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(18446744073709550515.0::float8);
insert into t1 values(18446744073709550515.0::float8);
insert into t1 values(1::numeric);
insert into t1 values(0::numeric);
insert into t1 values((-1)::numeric);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(18446744073709550515::numeric);
ERROR:  numeric field overflow
DETAIL:  A field with precision 10, scale 0 must round to an absolute value less than 10^10.
CONTEXT:  referenced column: a
insert into t1 values(18446744073709550516::numeric);
ERROR:  numeric field overflow
DETAIL:  A field with precision 10, scale 0 must round to an absolute value less than 10^10.
CONTEXT:  referenced column: a
insert into t1 values(1::int8);
insert into t1 values(0::int8);
insert into t1 values((-1)::int8);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775807::int8);
insert into t1 values(9223372036854775808::int8);
ERROR:  bigint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int4);
insert into t1 values(0::int4);
insert into t1 values((-1)::int4);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483647::int4);
insert into t1 values(2147483648::int4);
ERROR:  integer out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int2);
insert into t1 values(0::int2);
insert into t1 values((-1)::int2);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(32767::int2);
insert into t1 values(32768::int2);
ERROR:  smallint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int1);
insert into t1 values(0::int1);
insert into t1 values((-1)::int1);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(127::int1);
insert into t1 values(256::int1);
ERROR:  tinyint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint4);
insert into t1 values(0::uint4);
insert into t1 values((-1)::uint4);
insert into t1 values(4294967295::uint4);
insert into t1 values(4294967296::uint4);
ERROR:   int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint2);
insert into t1 values(0::uint2);
insert into t1 values((-1)::uint2);
insert into t1 values(65535::uint2);
insert into t1 values(65536::uint2);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint1);
insert into t1 values(0::uint1);
insert into t1 values((-1)::uint1);
insert into t1 values(255::uint1);
insert into t1 values(256::uint1);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1');
ERROR:  value "-1" is out of range for type bigint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
ERROR:  value "-1" is out of range for type bigint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
ERROR:  value "-1" is out of range for type bigint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
ERROR:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
ERROR:  bigint unsigned out of range
CONTEXT:  referenced column: a
set dolphin.sql_mode = '';
delete from t1;
insert into t1 values('-1');
WARNING:  value "-1" is out of range for type bigint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
WARNING:  value "-1" is out of range for type bigint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
WARNING:  value "-1" is out of range for type bigint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
WARNING:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
WARNING:  bigint unsigned out of range
CONTEXT:  referenced column: a
select * from t1;
 a 
---
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
(12 rows)

reset dolphin.sql_mode;
drop table if exists t1 ;
create table t1(a uint4);
insert into t1 values(1::text);
insert into t1 values(0::text);
insert into t1 values((-1)::text);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::bool);
insert into t1 values(0::bool);
insert into t1 values((-1)::bool);
insert into t1 values(1.0::float4);
insert into t1 values(0.0::float4);
insert into t1 values((-1.0)::float4);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::float4);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967296::float4);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1.0::float8);
insert into t1 values(0.0::float8);
insert into t1 values((-1.0)::float8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::float8);
insert into t1 values(4294967296::float8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::numeric);
insert into t1 values(0::numeric);
insert into t1 values((-1)::numeric);
ERROR:  unsigned int out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::numeric);
insert into t1 values(4294967296::numeric);
ERROR:  unsigned int out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int8);
insert into t1 values(0::int8);
insert into t1 values((-1)::int8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775807::int8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775808::int8);
ERROR:  bigint out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::int8);
insert into t1 values(4294967296::int8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int4);
insert into t1 values(0::int4);
insert into t1 values((-1)::int4);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483647::int4);
insert into t1 values(2147483648::int4);
ERROR:  integer out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int2);
insert into t1 values(0::int2);
insert into t1 values((-1)::int2);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(32767::int2);
insert into t1 values(32768::int2);
ERROR:  smallint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int1);
insert into t1 values(0::int1);
insert into t1 values((-1)::int1);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(127::int1);
insert into t1 values(256::int1);
ERROR:  tinyint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint8);
insert into t1 values(0::uint8);
insert into t1 values((-1)::uint8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::uint8);
insert into t1 values(4294967296::uint8);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint2);
insert into t1 values(0::uint2);
insert into t1 values((-1)::uint2);
insert into t1 values(65535::uint2);
insert into t1 values(65536::uint2);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint1);
insert into t1 values(0::uint1);
insert into t1 values((-1)::uint1);
insert into t1 values(255::uint1);
insert into t1 values(256::uint1);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1');
ERROR:  value "-1" is out of range for type int unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
ERROR:  value "-1" is out of range for type int unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
ERROR:  value "-1" is out of range for type int unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
ERROR:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
ERROR:  int unsigned out of range
CONTEXT:  referenced column: a
set dolphin.sql_mode = '';
delete from t1;
insert into t1 values('-1');
WARNING:  value "-1" is out of range for type int unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
WARNING:  value "-1" is out of range for type int unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
WARNING:  value "-1" is out of range for type int unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
WARNING:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
WARNING:  int unsigned out of range
CONTEXT:  referenced column: a
select * from t1;
 a 
---
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
(12 rows)

reset dolphin.sql_mode;
drop table if exists t1 ;
create table t1(a uint2);
insert into t1 values(1::text);
insert into t1 values(0::text);
insert into t1 values((-1)::text);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::bool);
insert into t1 values(0::bool);
insert into t1 values((-1)::bool);
insert into t1 values(1.0::float4);
insert into t1 values(0.0::float4);
insert into t1 values((-1.0)::float4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::float4);
insert into t1 values(65536::float4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1.0::float8);
insert into t1 values(0.0::float8);
insert into t1 values((-1.0)::float8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::float8);
insert into t1 values(65536::float8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::numeric);
insert into t1 values(0::numeric);
insert into t1 values((-1)::numeric);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::numeric);
insert into t1 values(65536::numeric);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int8);
insert into t1 values(0::int8);
insert into t1 values((-1)::int8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775807::int8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775808::int8);
ERROR:  bigint out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::int8);
insert into t1 values(65536::int8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int4);
insert into t1 values(0::int4);
insert into t1 values((-1)::int4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483647::int4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483648::int4);
ERROR:  integer out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::int4);
insert into t1 values(65536::int4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int2);
insert into t1 values(0::int2);
insert into t1 values((-1)::int2);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(32767::int2);
insert into t1 values(32768::int2);
ERROR:  smallint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int1);
insert into t1 values(0::int1);
insert into t1 values((-1)::int1);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(127::int1);
insert into t1 values(256::int1);
ERROR:  tinyint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint8);
insert into t1 values(0::uint8);
insert into t1 values((-1)::uint8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::uint8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967296::uint8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::uint8);
insert into t1 values(65536::uint8);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint4);
insert into t1 values(0::uint4);
insert into t1 values((-1)::uint4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::uint4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967296::uint4);
ERROR:   int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(65535::uint4);
insert into t1 values(65536::uint4);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint1);
insert into t1 values(0::uint1);
insert into t1 values((-1)::uint1);
insert into t1 values(255::uint1);
insert into t1 values(256::uint1);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1');
ERROR:  value "-1" is out of range for type smallint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
ERROR:  value "-1" is out of range for type smallint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
ERROR:  value "-1" is out of range for type smallint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
ERROR:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
ERROR:  smallint unsigned out of range
CONTEXT:  referenced column: a
set dolphin.sql_mode = '';
delete from t1;
insert into t1 values('-1');
WARNING:  value "-1" is out of range for type smallint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
WARNING:  value "-1" is out of range for type smallint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
WARNING:  value "-1" is out of range for type smallint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
WARNING:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
WARNING:  smallint unsigned out of range
CONTEXT:  referenced column: a
select * from t1;
 a 
---
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
(12 rows)

reset dolphin.sql_mode;
drop table if exists t1 ;
create table t1(a uint1);
insert into t1 values(1::text);
insert into t1 values(0::text);
insert into t1 values((-1)::text);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int8);
insert into t1 values(0::int8);
insert into t1 values((-1)::int8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775807::int8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(9223372036854775808::int8);
ERROR:  bigint out of range
CONTEXT:  referenced column: a
insert into t1 values(255::int8);
insert into t1 values(256::int8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::bool);
insert into t1 values(0::bool);
insert into t1 values((-1)::bool);
insert into t1 values(1.0::float4);
insert into t1 values(0.0::float4);
insert into t1 values((-1.0)::float4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(255::float4);
insert into t1 values(256::float4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1.0::float8);
insert into t1 values(0.0::float8);
insert into t1 values((-1.0)::float8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(255::float8);
insert into t1 values(256::float8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::numeric);
insert into t1 values(0::numeric);
insert into t1 values((-1)::numeric);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(255::numeric);
insert into t1 values(256::numeric);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int4);
insert into t1 values(0::int4);
insert into t1 values((-1)::int4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483647::int4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(2147483648::int4);
ERROR:  integer out of range
CONTEXT:  referenced column: a
insert into t1 values(255::int4);
insert into t1 values(256::int4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int2);
insert into t1 values(0::int2);
insert into t1 values((-1)::int2);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(32767::int2);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(32768::int2);
ERROR:  smallint out of range
CONTEXT:  referenced column: a
insert into t1 values(255::int4);
insert into t1 values(256::int4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::int1);
insert into t1 values(0::int1);
insert into t1 values((-1)::int1);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(127::int1);
insert into t1 values(256::int1);
ERROR:  tinyint out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint8);
insert into t1 values(0::uint8);
insert into t1 values((-1)::uint8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::uint8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967296::uint8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(255::uint8);
insert into t1 values(256::uint8);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint4);
insert into t1 values(0::uint4);
insert into t1 values((-1)::uint4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967295::uint4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(4294967296::uint4);
ERROR:   int unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(255::uint4);
insert into t1 values(256::uint4);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values(1::uint1);
insert into t1 values(0::uint1);
insert into t1 values((-1)::uint1);
insert into t1 values(255::uint1);
insert into t1 values(256::uint1);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1');
ERROR:  value "-1" is out of range for type tinyint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
ERROR:  value "-1" is out of range for type tinyint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
ERROR:  value "-1" is out of range for type tinyint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
ERROR:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
ERROR:  tinyint unsigned out of range
CONTEXT:  referenced column: a
set dolphin.sql_mode = '';
delete from t1;
insert into t1 values('-1');
WARNING:  value "-1" is out of range for type tinyint unsigned
LINE 1: insert into t1 values('-1');
                              ^
CONTEXT:  referenced column: a
insert into t1 values('-1'::time);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::text);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::char(10));
WARNING:  value "-1" is out of range for type tinyint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::varchar(10));
WARNING:  value "-1" is out of range for type tinyint unsigned
CONTEXT:  referenced column: a
insert into t1 values('-1'::binary(10));
WARNING:  Data truncated for input data: "-1"
CONTEXT:  referenced column: a
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::varbinary(10));
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::tinyblob);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::blob);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::mediumblob);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::longblob);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
insert into t1 values('-1'::json);
WARNING:  tinyint unsigned out of range
CONTEXT:  referenced column: a
select * from t1;
 a 
---
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
(12 rows)

reset dolphin.sql_mode;
drop table if exists t1;
--test for db core
select varlena_cast_ui1(1);
 varlena_cast_ui1 
------------------
 1
(1 row)

select varlena_cast_ui2(1);
 varlena_cast_ui2 
------------------
 1
(1 row)

select varlena_cast_ui4(1);
 varlena_cast_ui4 
------------------
 1
(1 row)

select varlena_cast_ui8(1);
 varlena_cast_ui8 
------------------
 1
(1 row)

select varlena_cast_int8(1);
 varlena_cast_int8 
-------------------
                 1
(1 row)

select varlena2float8(1);
 varlena2float8 
----------------
              1
(1 row)

select varlena2numeric(1);
 varlena2numeric 
-----------------
               1
(1 row)

select Varlena2Bpchar(1);
 varlena2bpchar 
----------------
 1
(1 row)

select Varlena2Varchar(1);
 varlena2varchar 
-----------------
 1
(1 row)

select Varlena2Text(1);
 varlena2text 
--------------
 1
(1 row)

select varlena2bit(1,10);
 varlena2bit 
-------------
 0000110001
(1 row)

set b_format_behavior_compat_options = 'enable_multi_charset';
create OR REPLACE procedure t_p(out ret varchar) as
begin
select '{"a":"b"}'::json into ret;
end;
/
select t_p();
ERROR:  multi character set for datatype 'json' is not supported
CONTEXT:  PL/pgSQL function t_p() line 2 at SQL statement
referenced column: t_p
drop procedure t_p;
set b_format_behavior_compat_options = '';
create OR REPLACE procedure t_p(out ret varchar) as
begin
select '{"a":"b"}'::json into ret;
end;
/
select t_p();
    t_p    
-----------
 {"a":"b"}
(1 row)

drop procedure t_p;
drop schema uint_cast2 cascade;
reset current_schema;