Re: [HACKERS] Declarative partitioning - another take - Mailing list pgsql-hackers

From amul sul
Subject Re: [HACKERS] Declarative partitioning - another take
Date
Msg-id CAAJ_b94XgbqVoXMyxxs63CaqWoMS1o2gpHiU0F7yGnJBnvDc_A@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Declarative partitioning - another take  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] Declarative partitioning - another take  (Keith Fiske <keith@omniti.com>)
Re: [HACKERS] Declarative partitioning - another take  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Hi,

I got server crash due to assert failure at ATTACHing overlap rang
partition, here is test case to reproduce this:

CREATE TABLE test_parent(a int) PARTITION BY RANGE (a);
CREATE TABLE test_parent_part2 PARTITION OF test_parent FOR VALUES
FROM(100) TO(200);
CREATE TABLE test_parent_part1(a int NOT NULL);
ALTER TABLE test_parent ATTACH PARTITION test_parent_part1 FOR VALUES
FROM(1) TO(200);

I think, this bug exists in the following code of check_new_partition_bound():
767                         if (equal || off1 != off2)768                         {769
overlap= true;770                             with = boundinfo->indexes[off2 + 1];771                         }
 

When equal is true array index should not be 'off2 + 1'.

While reading code related to this, I wondered why
partition_bound_bsearch is not immediately returns when cmpval==0?

Apologise if this has been already reported.

Regards,
Amul



pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: [HACKERS] macaddr 64 bit (EUI-64) datatype support
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] merging some features from plpgsql2 project