pingcap/tidb

Feature request: Support CHECKSUM TABLE command

Open

#1.895 geöffnet am 28. Okt. 2016

Auf GitHub ansehen
 (10 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)Go (6.186 Forks)batch import
feature/discussinghelp wantedtype/compatibilitytype/enhancement

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

When importing data into TiDB we want to be sure the data is correct. A convenient command in MySQL is CHECKSUM TABLE and this command is not currently supported by TiDB.

Adding it would make it easy to confirm if the data loaded in from an external source matches or not.

Example I did something like:

$ ssh mysqlhost sudo mysqldump test SomeTable | mysql -h tidbhost -P 4000 -u root -D test

MySQL 5.6:

root@mysqlhost [test]> checksum table SomeTable;
+-----------+------------+
| Table     | Checksum   |
+-----------+------------+
| SomeTable | 2867272629 |
+-----------+------------+
1 row in set (0.01 sec)

TiDB:

root@tidbhost [test]> checksum table SomeTable;
ERROR 1105 (HY000): line 0 column 8 near " table SomeTable"
root@tidbhost [test]> 

So providing some sort of CHECKSUM table command would be great.

Contributor Guide