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

ticdc: add a faq about generated column #19035

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ticdc/ticdc-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,11 @@ TiDB 有事务超时的机制,当事务运行超过 [`max-txn-ttl`](/tidb-conf
}
]
```

## DML 中的生成列会发生什么行为?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## DML 中的生成列会发生什么行为
## TiCDC 会同步 DML 操作中的生成列吗


生成列包括存储生成列和虚拟生成列。TICDC 会忽略虚拟生成列,而仅复制存储生成列到下游。当下游是 MySQL 数据库或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
生成列包括存储生成列和虚拟生成列。TICDC 会忽略虚拟生成列,而仅复制存储生成列到下游。当下游是 MySQL 数据库或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。
生成列包括虚拟生成列和存储生成列。TiCDC 会忽略虚拟生成列,而仅同步存储生成列到下游。当下游是 MySQL 或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。


> **Note:**
>
> 当复制存储生成列到 Kafka 或存储服务后,再写回 MySQL 时,可能会发生错误 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed`。您可以使用[Open Protocol](https://docs.pingcap.com/zh/tidb/stable/ticdc-open-protocol#ticdc-open-protocol)来避免此错误,因为该协议携带 column flag, 可以区分是否为生成列。
Comment on lines +331 to +333
Copy link
Collaborator

@qiancai qiancai Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **Note:**
>
> 当复制存储生成列到 Kafka 或存储服务后,再写回 MySQL 时,可能会发生错误 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed`。您可以使用[Open Protocol]https://docs.pingcap.com/zh/tidb/stable/ticdc-open-protocol#ticdc-open-protocol)来避免此错误,因为该协议携带 column flag, 可以区分是否为生成列。
> **注意:**
>
> 当同步存储生成列到 Kafka 或存储服务后,再将其写回 MySQL 时,可能会遇到 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed` 错误。为避免该错误,你可以使用 [Open Protocol](/ticdc/ticdc-open-protocol.md#ticdc-open-protocol) 进行同步。该协议的输出包含[列的 flag](/ticdc/ticdc-open-protocol.md#列标志位)可以区分是否为生成列。