Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB中更新虚拟列引用列后,虚拟列没有更新
[Overview] Scenario + Problem Summary
When conducting compatibility tests between MySQL and TiDB, there is a virtual column C in the table. Virtual column C references virtual column B, and virtual column B references field A. When updating field A, the virtual column C in TiDB does not update, but it does update in MySQL.
[Background] Operations performed
I conducted the following tests in both MySQL and TiDB:
TiDB:
MySQL:
[Problem] Current issue encountered
I also found during testing that if there is no virtual column C, meaning the address directly references the value in field A, the update works correctly.
Is it a misuse on my part or a bug?
[TiDB Version]
V5.4.0
I tried to reproduce it in version 6.1, and it might be a bug. Currently, virtual columns are still an experimental feature and are not recommended for use in a production environment.
It should be a bug in TiDB. However, if TiDB is not used as the write end but as the downstream of DM synchronization, you might consider directly changing the field to a regular varchar or json type on the TiDB side.
I tested it, and the values of virtual columns are also written into the BINLOG.
Mark, we do use virtual columns in our MySQL.
We also use virtual columns in MySQL, but currently, JSON in TiDB is still an experimental feature.
However, virtual columns are indeed not very compatible, and our downstream big data CDH cannot synchronize virtual columns.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.