pingcap / pingcap/tidb

Failed to add a vector column with default value(even by error message prompt)

Open
#57,022 4 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/vector type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

Related pr: https://github.com/pingcap/tidb/pull/56286

```
create table t(embedding VECTOR DEFAULT (VEC_FROM_TEXT('[1,2,3]')));

tidb> alter table t add column vec_col VECTOR(3) default '[1,2.1,3.2]';
ERROR 1105 (HY000): VECTOR column 'vec_col' can't have a literal default. Use expression default instead: ((VEC_FROM_TEXT('...')))

alter table t add column vec_col VECTOR(3) default ((VEC_FROM_TEXT('[1,2,3]')));
```

### 2. What did you expect to see? (Required)
Execute successfully.

### 3. What did you see instead (Required)
```
ERROR 1674 (HY000): Statement is unsafe because it uses a system function that may return a different value on the slave
```

### 4. What is your TiDB version? (Required)

master

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.