[Bug] AO column table can't process zero-column table
- Dominant language
- C
- Stars
- 1.4k
- Forks
- 247
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 39
Description
### Apache Cloudberry version
main branch, with cassert
### What happened
```sql
set default_table_access_method = ao_column;
create table t1();
create index on t1 using btree ((1)); -- assert fail
insert into t1 default values;
select * from t1;
delete from t1;
select * from t1;
insert into t1 default values;
select * from t1;
```
The above query will crash.
### What you think should happen instead
The above query should has the same behavior as heap tables.
### How to reproduce
```sql
set default_table_access_method = ao_column;
create table t1();
create index on t1 using btree ((1)); -- assert fail
insert into t1 default values;
select * from t1;
delete from t1;
select * from t1;
insert into t1 default values;
select * from t1;
```
### Operating System
no spec
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes, I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
Contributor guide
Research direction
Start by running the provided SQL reproduction on the main branch with cassert enabled, then compare the ao_column results with heap tables. Trace the zero-column table, index creation, insert, and delete paths; done means the assertion no longer occurs and the queries behave like heap tables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100