pull/4618/head
Hadi Moshayedi 2021-02-01 16:20:53 -08:00
parent 877d87e372
commit bcb162976f
3 changed files with 37 additions and 1 deletions

View File

@ -164,7 +164,7 @@ columnar_beginscan(Relation relation, Snapshot snapshot,
parallel_scan,
flags, attr_needed, NULL);
pfree(attr_needed);
bms_free(attr_needed);
return scandesc;
}

View File

@ -1067,5 +1067,31 @@ SELECT 1 FROM master_remove_node('localhost', :master_port);
1
(1 row)
-- verify reference table with no columns can be created
-- https://github.com/citusdata/citus/issues/4608
CREATE TABLE zero_col() USING columnar;
SELECT create_reference_table('zero_col');
create_reference_table
---------------------------------------------------------------------
(1 row)
select result from run_command_on_placements('zero_col', 'select count(*) from %s');
result
---------------------------------------------------------------------
0
0
(2 rows)
-- add a column so we can ad some data
ALTER TABLE zero_col ADD COLUMN a int;
INSERT INTO zero_col SELECT i FROM generate_series(1, 10) i;
select result from run_command_on_placements('zero_col', 'select count(*) from %s');
result
---------------------------------------------------------------------
10
10
(2 rows)
SET client_min_messages TO WARNING;
DROP SCHEMA columnar_citus_integration CASCADE;

View File

@ -403,5 +403,15 @@ SELECT compression FROM columnar.options WHERE regclass = 'table_option_citus_lo
DROP TABLE table_option_citus_local, table_option_citus_local_2;
SELECT 1 FROM master_remove_node('localhost', :master_port);
-- verify reference table with no columns can be created
-- https://github.com/citusdata/citus/issues/4608
CREATE TABLE zero_col() USING columnar;
SELECT create_reference_table('zero_col');
select result from run_command_on_placements('zero_col', 'select count(*) from %s');
-- add a column so we can ad some data
ALTER TABLE zero_col ADD COLUMN a int;
INSERT INTO zero_col SELECT i FROM generate_series(1, 10) i;
select result from run_command_on_placements('zero_col', 'select count(*) from %s');
SET client_min_messages TO WARNING;
DROP SCHEMA columnar_citus_integration CASCADE;