blob: 3318523bee796860d3e5f0fdb293c74a48c3a397 [file] [log] [blame]
-- Check if motion layer correctly serialize & deserialize tuples in particular cases
CREATE TYPE incomplete_type;
CREATE FUNCTION incomplete_type_in(cstring)
RETURNS incomplete_type
AS 'textin'
LANGUAGE internal IMMUTABLE STRICT;
NOTICE: return type incomplete_type is only a shell
CREATE FUNCTION incomplete_type_out(incomplete_type)
RETURNS cstring
AS 'textout'
LANGUAGE internal IMMUTABLE STRICT;
NOTICE: argument type incomplete_type is only a shell
CREATE TYPE incomplete_type (
internallength = variable,
input = incomplete_type_in,
output = incomplete_type_out,
alignment = double,
storage = EXTENDED,
default = 'zippo'
);
CREATE TABLE table_with_incomplete_type (id int, incomplete incomplete_type);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Apache Cloudberry data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
INSERT INTO table_with_incomplete_type(id, incomplete) VALUES(1, repeat('abcde', 1000000)::incomplete_type);
-- Turn off output temporarily as the output is quite large
\o /dev/null
SELECT * FROM table_with_incomplete_type;
\o
DROP TABLE table_with_incomplete_type;
DROP TYPE incomplete_type CASCADE;
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to function incomplete_type_in(cstring)
drop cascades to function incomplete_type_out(incomplete_type)