Skip to content

Commit 152ebe7

Browse files
committed
Fix: pax object access hook assert false
When cbdb using `alter table` with PAX table, the `PaxObjectAccessHook` will be call. Then sub_id will not be 0, because `attrnum` is not 0.
1 parent f029c39 commit 152ebe7

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

contrib/pax_storage/expected/ddl.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ drop table pax_test.t1;
6565
drop table pax_test.t2;
6666
-- alter column with options
6767
create table pax_test.t3 (v1 numeric(100,1)) with(compresstype=zstd, compresslevel=1);
68-
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'v1' as the Cloudberry Database data distribution key for this table.
69-
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
7068
alter table pax_test.t3 alter column v1 type numeric;
7169
drop table pax_test.t3;
70+
-- add column with options
71+
create table pax_test.t4 (v1 text) with(compresstype=zstd, compresslevel=1);
72+
alter table pax_test.t4 add column v2 text;
73+
drop table pax_test.t4;

contrib/pax_storage/sql/ddl.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ drop table pax_test.t2;
4545
create table pax_test.t3 (v1 numeric(100,1)) with(compresstype=zstd, compresslevel=1);
4646
alter table pax_test.t3 alter column v1 type numeric;
4747
drop table pax_test.t3;
48+
-- add column with options
49+
create table pax_test.t4 (v1 text) with(compresstype=zstd, compresslevel=1);
50+
alter table pax_test.t4 add column v2 text;
51+
drop table pax_test.t4;

contrib/pax_storage/src/cpp/access/pax_access_handle.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,6 @@ static void PaxObjectAccessHook(ObjectAccessType access, Oid class_id,
11081108
rel->rd_options && RelationIsPAX(rel));
11091109
if (!ok) goto out;
11101110

1111-
Assert(sub_id == 0);
1112-
11131111
options = reinterpret_cast<paxc::PaxOptions *>(rel->rd_options);
11141112
if (!options->partition_by()) {
11151113
if (options->partition_ranges()) {

0 commit comments

Comments
 (0)