Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions allowed in generated functions that should have been blocked #58299

Closed
dveeden opened this issue Dec 16, 2024 · 0 comments · Fixed by #58308
Closed

Functions allowed in generated functions that should have been blocked #58299

dveeden opened this issue Dec 16, 2024 · 0 comments · Fixed by #58308
Assignees
Labels
component/expression severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Dec 16, 2024

Bug Report

Some functions like TIDB_VERSION() are allowed in generated columns, while they should have been blocked.

1. Minimal reproduce step (Required)

CREATE TABLE t1(id int auto_increment primary key, c1 varchar(255) as (version()));
CREATE TABLE t1(id int auto_increment primary key, c1 varchar(255) as (tidb_version()));

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

Error 3102 for both statements.

3. What did you see instead (Required)

mysql-8.0.11-TiDB-v8.4.0> CREATE TABLE t1(id int auto_increment primary key, c1 varchar(255) as (version()));
ERROR 3102 (HY000): Expression of generated column 'c1' contains a disallowed function.
mysql-8.0.11-TiDB-v8.4.0> CREATE TABLE t1(id int auto_increment primary key, c1 varchar(255) as (tidb_version()));
Query OK, 0 rows affected (0.52 sec)

4. What is your TiDB version? (Required)

v8.4.0

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants