gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

ExtStats bug for partition table

Open kainwen opened this issue 2 years ago • 0 comments

Bug Report

Greenplum version or build

Master branch, with top commit (a5fa90c9de)

Step to reproduce the behavior

create table rank (id int, rank int, year int, gender
        char(1), count int)
distributed by (id)
partition by range (year)
( start (2006) end (2016) every (1),
          default partition extra );
CREATE TABLE
create or replace function random_between(low int ,high int)
   returns int as
$$
begin
           return floor(random()* (high-low + 1) + low);
end;
$$ language 'plpgsql' strict;
CREATE FUNCTION
insert into rank
select i, i, random_between(2005, 2017), 'g', i
from generate_series(1, 100000)i;
INSERT 0 100000
create statistics st on rank, year from rank;
CREATE STATISTICS
analyze rank;
ANALYZE
select count(1) from (select rank, year, sum(1) from rank group by 1, 2)x;
psql:x.sql:23: FATAL:  Unexpected internal error (assert.c:44)
DETAIL:  FailedAssertion("!(rel->rows > 0 || is_dummy_rel(rel))", File: "allpaths.c", Line: 489)
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:x.sql:23: fatal: connection to server was lost

kainwen avatar Jul 28 '22 12:07 kainwen