[HACKERS] Bug in get_partition_for_tuple - Mailing list pgsql-hackers

From Amit Langote
Subject [HACKERS] Bug in get_partition_for_tuple
Date
Msg-id d64f8498-70eb-3c88-b56d-c54fd3b0500f@lab.ntt.co.jp
Whole thread Raw
Responses Re: [HACKERS] Bug in get_partition_for_tuple  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
List pgsql-hackers
Just observed a crash due to thinko in the logic that handles NULL
partition key.  Absence of null-accepting partition in this case should
have caused an error, instead the current code proceeds with comparison
resulting in crash.

create table p (a int, b char) partition by list (b);
create table p1 partition of p for values in ('a');
insert into p values (1);   -- crashes

Attached patch fixes that and adds a test.

Thanks,
Amit

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] on_dsm_detach() callback and parallel tuplesort BufFile resource management
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] amcheck (B-Tree integrity checking tool)