I need generate a single hash over some data in a table
CREATE TABLE Table1
(
F1 INT UNSIGNED NOT NULL AUTO_INCREMENT,
F2 INT default NULL,
F3 Varchar(50) default NULL,
..
FN INT default NULL,
PRIMARY KEY (F1)
);
i.e. F1, F3,FN where F2=10
SELECT md5(CONCAT_WS('#',F1,F3,FN)) FROM Tabe1 WHERE F2=10
Gives a Hash for each row in the table.
QUESTIONS
1) How do get a single hash over the whole table?
2) What is the fasts hashing algorithm to use MD5, SHA1, SHA or any other?
EDIT:
Mysql 4.1 is been used - and it does NOT have Trigger Support
Altough this thread is old, maybe this is what you need: http://dev.mysql.com/doc/refman/5.0/en/checksum-table.html
See BIT_XOR: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html "Returns the bitwise XOR of all bits in expr. The calculation is performed with 64-bit (BIGINT) precision. This function returns 0 if there were no matching rows." For an example of usage, check pt-table-sync.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With