Commit 1704a8a9 authored by V Narayanan's avatar V Narayanan

Bug#49521 SHOW CREATE TABLE on IBMDB2I tables has incorrect fk constraint format

The fix inserts newline and comma characters as appropriate
into the constraint reporting code to match the formatting
required by SHOW CREATE TABLE. Additionally, a erroneously
duplicated copy of check_if_incompatible_data() was removed
from db2i_constraints.cc since the correct version is already
in ha_ibmdb2i.cc.
parent 350737bf
......@@ -329,7 +329,7 @@ char* ha_ibmdb2i::get_foreign_key_create_info(void)
/* Process the constraint name. */
info.strncat(STRING_WITH_LEN(" CONSTRAINT "));
info.strncat(STRING_WITH_LEN(",\n CONSTRAINT "));
convNameForCreateInfo(thd, info,
FKCstDef->CstName.Name, FKCstDef->CstName.Len);
......@@ -398,7 +398,6 @@ char* ha_ibmdb2i::get_foreign_key_create_info(void)
if ((i+1) < cstCnt)
{
info.strcat(',');
tempPtr = (char*)cstHdr + cstHdr->CstLen;
cstHdr = (constraint_hdr_t*)(tempPtr);
}
......@@ -671,28 +670,3 @@ uint ha_ibmdb2i::referenced_by_foreign_key(void)
}
DBUG_RETURN(count);
}
bool ha_ibmdb2i::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
{
DBUG_ENTER("ha_ibmdb2i::check_if_incompatible_data");
uint i;
/* Check that auto_increment value and field definitions were
not changed. */
if ((info->used_fields & HA_CREATE_USED_AUTO &&
info->auto_increment_value != 0) ||
table_changes != IS_EQUAL_YES)
DBUG_RETURN(COMPATIBLE_DATA_NO);
/* Check if any fields were renamed. */
for (i= 0; i < table->s->fields; i++)
{
Field *field= table->field[i];
if (field->flags & FIELD_IS_RENAMED)
{
DBUG_PRINT("info", ("Field has been renamed, copy table"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
}
}
DBUG_RETURN(COMPATIBLE_DATA_YES);
}
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