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

Table column type longtext is converted to AVRO bytes type but should be converted to bytes string type #4454

Closed
keweishang opened this issue Jan 24, 2022 · 2 comments · Fixed by #4704
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@keweishang
Copy link

What did you do?

  1. Create a table called employees. Its description column is enum.
CREATE TABLE employees (
  id int(20) unsigned NOT NULL AUTO_INCREMENT,
  description longtext COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (id)
);
  1. Create TiCDC changefeed
tiup cdc cli changefeed create \
--pd="http://localhost:2379" \
--sink-uri="kafka://localhost:9092/test?protocol=avro&partition-num=1&replication-factor=3" \
--config=./configs/test.toml \
--opts "registry=http://localhost:8081" \
--changefeed-id=test
  1. Insert a row
INSERT INTO employees values (1, 'test');
  1. Check Kafka schema registry's schema.
...
{
    "name" : "description",
    "type" : [ "null", "bytes" ],
    "default" : null
  }
...

What did you expect to see?

The avro type of the description field should be string.

What did you see instead?

The avro type of the description field is bytes.

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

Release Version: v5.3.0
Edition: Community
Git Commit Hash: 4a1b2e9fe5b5afb1068c56de47adb07098d768d6
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-24 13:31:41
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

TiCDC version (execute cdc version):

5.3.0
@keweishang keweishang added area/ticdc Issues or PRs related to TiCDC. type/bug The issue is confirmed as a bug. labels Jan 24, 2022
@dveeden dveeden self-assigned this Jan 24, 2022
@keweishang
Copy link
Author

In addition to longtext, text column type also has the same issue.

@zhangyangyu
Copy link
Member

/remove-label affects-5.3

ti-chi-bot pushed a commit that referenced this issue Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants