matrixorigin / matrixorigin/matrixone
[Bug]: INSERT into LIST COLUMNS partition table panics
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 311
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 768
Description
## Summary
On latest `main` (`560808cbb`), inserting into a `LIST COLUMNS(varchar)` partition table panics with a nil pointer dereference in `vector.(*Vector).Length`. MySQL 8.0.45 accepts the same DDL and DML.
This was found while cross-testing partition tables with primary keys, secondary indexes, and window functions. The failure happens before any window query, during the first `INSERT` into the list-partitioned table.
## Duplicate check
Searched before filing:
- `LIST COLUMNS insert panic Vector Length`
- `list partition insert nil pointer`
No matching MatrixOne issue was found. Search only returned unrelated closed issue #949.
## Minimal reproduce
```sql
DROP DATABASE IF EXISTS mysql_compat_list_partition_insert_min;
CREATE DATABASE mysql_compat_list_partition_insert_min;
USE mysql_compat_list_partition_insert_min;
CREATE TABLE list_simple (
region varchar(8) not null,
id int not null,
v int not null,
primary key(region, id)
)
PARTITION BY LIST COLUMNS(region) (
PARTITION pe VALUES IN ('east'),
PARTITION pw VALUES IN ('west')
);
INSERT INTO list_simple VALUES ('east',1,10);
```
## MySQL 8.0.45 result
```text
Query OK
```
## MatrixOne result
```text
ERROR 20101 (HY000): internal error: panic runtime error: invalid memory address or nil pointer dereference
runtime.panicmem
runtime.sigpanic
github.com/matrixorigin/matrixone/pkg/container/vector.(*Vector).Length
pkg/container/vector/vector.go:171
```
## Expected behavior
MatrixOne should insert the row into the correct list partition or return a normal unsupported-feature error. It should not panic.
## Additional information
A wider table with composite primary key, unique key, and secondary index also reproduces the same panic on the first insert into a `LIST COLUMNS(region)` table.
Contributor guide
Assessment
This issue has not been assessed yet.