I'm trying to understand how MSQL's Duplicate Entry works.
What I do understand is when saving
title='aaaaaccccc'
twice and the title field is unique you will get the error: Duplicate entry.
Does MySQL truncates a string with length = 200 to 64 chars and then check if the 64 chars long string is unique?
UPDATE:
When I save 2 records (titles) MySQL complains about violation of a unique constraint when saving the second title. The titles are the same for the first, lets say, 100 chars. After that it differs. Wy does MySQL throws a duplicate key error anyway.
It depends on the data type: varchar columns will be trimmed, but char columns not (they are padded out to the specified column length).
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