On 06/01/2011 09:19 PM, Sergei Golubchik wrote:
> Hi, Jon!
> On Jun 01, Jon Olav Hauglid wrote:
>> 3142 Jon Olav Hauglid 2011-06-01
>> Bug#12585718 REPLICATION BREAKS WITH LARGE INDEX PREFIX ON UNIQUE INDEX
> What was the problem with the replication?
>> Tentative patch for discussion purposes.
>> Before this patch, creating an index with a prefix longer than the
>> maximum supported length only gave a warning for non-unique indexes
>> but an error for unique indexes.
>> This patch changes the behavior for non-unique indexes so
>> an ER_TOO_LONG_KEY error is reported in this case as well.
> This was the old MySQL behavior.
> Changed later to be a non-fatal error, as an index is only an
> optimization aid, and truncating it does not introduce an error.
> A unique index, on the other hand, is a constraint. DBMS should not
> automatically change it.
> But what does it have to do with replication?
It can be an issue for replication if master and slave have different
configurations wrt index prefix length.
If it's a non-unique index, the slave can truncate the index (with just
a warning) while the master accepts the index without truncation.
We're discussing the issue, which is why I didn't bother with a better
commit message just yet :-)
--- Jon Olav Hauglid