And so that to set UNIQUE for it?
views:
17answers:
1
+1
A:
Use BINARY(16)
and store the MD5
hash of the content there:
CREATE TABLE t_content (id INT NOT NULL PRIMARY KEY, content TEXT NOT NULL, hash BINARY(16) NOT NULL, UNIQUE KEY ux_content_hash (hash));
INSERT
INTO t_content
VALUES (@content, UNHEX(MD5(@content)));
Quassnoi
2010-03-04 14:18:10