pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.29k stars 5.85k forks source link

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

Open zimulala opened 2 weeks ago

zimulala commented 2 weeks ago

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

kolafish commented 2 weeks ago

/severity minor

ti-chi-bot[bot] commented 2 weeks ago

@kolafish: These labels are not set on the issue: severity/moderate.

In response to [this](https://github.com/pingcap/tidb/issues/57022#issuecomment-2456143829): >/remove-severity moderate Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.
kolafish commented 2 weeks ago

/severity moderate

ti-chi-bot[bot] commented 2 weeks ago

@kolafish: These labels are not set on the issue: severity/minor.

In response to [this](https://github.com/pingcap/tidb/issues/57022#issuecomment-2456144804): >/remove-severity minor Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.