pingcap / tidb-tools

tidb-tools are some useful tool collections for TiDB.
Apache License 2.0
286 stars 191 forks source link

sync_diff: failed to initialize the diff process with downstream MySQL and hidden column. #717

Closed 3AceShowHand closed 3 months ago

3AceShowHand commented 1 year ago

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.
    
    set character_set_connection=utf8;

CREATE TABLE t ( pk bigint(20) NOT NULL AUTO_INCREMENT, j json DEFAULT NULL, i int(11) DEFAULT NULL, c char(64) DEFAULT NULL, PRIMARY KEY (pk) /T![clustered_index] CLUSTERED / ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001;

alter table t add index j((cast(j->'$.number[*]' as signed array)));


2. What did you expect to see?

sync diff runs normally

3. What did you see instead?

[FATAL] [main.go:120] ["failed to initialize diff process"] [error="get table test.t's information error line 7 column 56 near \"'$.number[*]') as signed array)))\n) ENGINE=InnoDB AUTO_INCREMENT=30001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\"


[sync_diff.log](https://github.com/pingcap/tidb-tools/files/11176594/sync_diff.log)

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

5. which tool are you using?
sync-diff

7. what versionof tool are you using (`pump -V` or `tidb-lightning -V` or `syncer -V`)?
dveeden commented 3 months ago

@3AceShowHand this isn't a hidden column, but a generated column, right?

dveeden commented 3 months ago

I have created #802 for hidden columns

dveeden commented 3 months ago

Looks like you reported this for v7.0.0-1-g640ac78, but I can't reproduce this anymore on v8.1.0-1-g17af326

dveeden commented 3 months ago

I can reproduce this on v7.0.0, so this was fixed somewhere after that release.