Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb 语法兼容性一问
To improve efficiency, please provide the following information. Clear problem descriptions can be resolved faster:
【TiDB Usage Environment】Production, Testing, Research
【TiDB Version】tidb v6.1
【Encountered Problem】tidb syntax not supported
【Reproduction Path】What operations were performed that caused the problem
(root@127.1) [test] 11:49:56> CREATE TABLE word
-> (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> text VARCHAR(64),
-> topic_id INT NOT NULL REFERENCES topic (id),
-> published DATE,
-> length INT NOT NULL DEFAULT LENGTH(text),
-> UNIQUE KEY word_topic_text (topic_id, text),
-> UNIQUE KEY word_topic_published_length_uk (topic_id, published, length)
-> ) ;
ERROR 3770 (HY000): Default value expression of column 'length' contains a disallowed function: `LENGTH`.
(root@127.1) [test] 11:50:01>
【Problem Phenomenon and Impact】
In MariaDB, the syntax DEFAULT LENGTH(text),
is supported.
【Attachments】
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.