Commit 8d8c456d authored by Jan Lindström's avatar Jan Lindström

MDEV-5621: Server random crash on ALTER TABLE

This is not a real fix, instead try to gather additional information
at the point when dictionary content is not what we expect it to be.
parent c9220483
......@@ -2122,6 +2122,23 @@ dict_load_foreign_cols(
ut_a(!rec_get_deleted_flag(rec, 0));
field = rec_get_nth_field_old(rec, 0, &len);
if (len != id_len || ut_memcmp(id, field, len) != 0) {
char * tmp,*tmp2;
tmp = mem_heap_alloc(foreign->heap, id_len+4);
ut_memcpy(tmp, id, id_len);
tmp[id_len]='\0';
tmp2 = mem_heap_alloc(foreign->heap, len+4);
ut_memcpy(tmp2, id, len);
tmp2[len]='\0';
fprintf(stderr, "InnoDB: Error: len = %lu != id_len %lu\n",
len, id_len);
fprintf(stderr, "InnoDB: Error: id %s != field %s\n",
tmp, tmp2);
}
ut_a(len == id_len);
ut_a(ut_memcmp(id, field, len) == 0);
......
......@@ -2196,6 +2196,23 @@ dict_load_foreign_cols(
ut_a(!rec_get_deleted_flag(rec, 0));
field = rec_get_nth_field_old(rec, 0, &len);
if (len != id_len || ut_memcmp(id, field, len) != 0) {
char * tmp,*tmp2;
tmp = mem_heap_alloc(foreign->heap, id_len+4);
ut_memcpy(tmp, id, id_len);
tmp[id_len]='\0';
tmp2 = mem_heap_alloc(foreign->heap, len+4);
ut_memcpy(tmp2, id, len);
tmp2[len]='\0';
fprintf(stderr, "InnoDB: Error: len = %lu != id_len %lu\n",
len, id_len);
fprintf(stderr, "InnoDB: Error: id %s != field %s\n",
tmp, tmp2);
}
ut_a(len == id_len);
ut_a(ut_memcmp(id, field, len) == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment