MySQL Insert Incorrect CRC32 hash -


i have mysql table products, has url , url_crc fields. have incorrect crc32 calculating @ time of insert.

insert products (url, url_crc) values ('http://www.zappos.com/product/7859366/color/106', crc32('http://www.zappos.com/product/7859366/color/106'))

result is: http://www.zappos.com/product/7859366/color/106, 2147483647

but when this:

select crc32('http://www.zappos.com/product/7859366/color/106')

result is: 2838206275

why happen ? 2838206275 != 2147483647.

triggers didn't help. result same.

the maximum value of 32 bit signed integer 2^31-1.

2838206275 greater that.

(2147483647 conveniently 2^31-1).

in other words, use larger data type (bigint).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -