V
V
vegarulez2016-05-04 18:36:13
MySQL
vegarulez, 2016-05-04 18:36:13

Why is the hash not equal when select md5(xml)?

Friends, tell me what's the matter, I've already broken my head ...
There are two plates type MyIsam comparison cp_1251_general_ci
and in one and in the other there is an xml field of the longtext type in which there is a large xml. And so here an essence of the task, I want to check on md5 if xml in one plate exchanged - that to update other plates where it yuzatsya. The question is why, with the same xml in both md5 labels, the hash is different when checking?
those. I throw without changes xml from one plate to another i.e. from t2 to t1:

UPDATE `table1` t1
    JOIN `table2` t2 ON t2.id =53
    SET t1.xml_data = t2.xml_data
    WHERE t1.id_t =1999

then I check the hashes using md5:
SELECT 
md5(t1.xml_data) as `md5(t1)`,
md5(t2.xml_data) as `md5(t2)` 
FROM `table1` as t1,`table2` as t2
WHERE  t1.`id_t`=1999 and t2.id=53

but the hashes are different, why so???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Selivanov, 2016-05-04
@selivanov_pavel

show create table t1;
show create table t2;

do they have the same character set and collation ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question