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

diff: collation should not be applied on non-string columns #760

Open
kennytm opened this issue Dec 27, 2023 · 1 comment
Open

diff: collation should not be applied on non-string columns #760

kennytm opened this issue Dec 27, 2023 · 1 comment
Labels

Comments

@kennytm
Copy link
Contributor

kennytm commented Dec 27, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
-- mysql @ 172.17.0.2:3306
create table u (a int primary key);
insert into u values (1), (2);

-- tidb @ 127.0.0.1:4000
create table u (a int primary key);
insert into u values (1), (2);
[data-sources.src1]
host = '172.17.0.2'
port = 3306
user = 'root'
password = '111'

[data-sources.src2]
host = '127.0.0.1'
port = 4000
user = 'root'
password = ''

[task]
output-dir = './output'
source-instances = ['src1']
target-instance = 'src2'
target-check-tables = ['test.u']
target-configs = ['cfg1']

[table-configs.cfg1]
target-tables = ['*.*']
collation = 'utf8mb4_general_ci'
chunk-size = 1
bin/sync_diff_inspector -C cfg.toml
  1. What did you expect to see?

The two test.u tables are equivalent

  1. What did you see instead?

Fatal error.

[2023/12/28 01:37:05.737 +08:00] [FATAL] [main.go:139] ["failed to check data difference"] [error="Error 1253 (42000): COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'binary'"] 

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

7.3.0

  1. which tool are you using?

sync-diff-inspector 7.1.3 (master version 8811722)

  1. what versionof tool are you using (pump -V or tidb-lightning -V or syncer -V)?
@kennytm
Copy link
Contributor Author

kennytm commented Dec 27, 2023

This is caused by pingcap/tidb#34349.

sync-diff-inspector should check if the column has a string type before attaching the collate clause to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant