1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#26881 - Large MERGE tables report incorrect specification when no

differences in tables
Certain merge tables were wrongly reported as having incorrect definition:
- Some fields that are 1 byte long (e.g. TINYINT, CHAR(1)), might
  be internally casted (in certain cases) to a different type on a
  storage engine layer. (affects 4.1 and up)
- If tables in a merge (and a MERGE table itself) had short VARCHAR column (less
  than 4 bytes) and at least one (but not all) tables were ALTER'ed (even to an
  identical table: ALTER TABLE xxx ENGINE=yyy), table definitions went ouf of
  sync. (affects 4.1 only)

This is fixed by relaxing a check for underlying conformance and setting
field type to FIELD_TYPE_STRING in case varchar is shorter than 4
when a table is created.
This commit is contained in:
svoj@mysql.com/april.(none)
2007-03-13 18:02:06 +04:00
parent 576db4f44c
commit cb132bea8f
5 changed files with 77 additions and 2 deletions

View File

@ -4653,8 +4653,14 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
new_field->length++;
}
break;
case FIELD_TYPE_STRING:
case FIELD_TYPE_VAR_STRING:
if (new_field->length < 4)
{
new_field->sql_type= FIELD_TYPE_STRING;
break;
}
/* fall through */
case FIELD_TYPE_STRING:
if (new_field->length <= MAX_FIELD_CHARLENGTH || default_value)
break;
/* Convert long CHAR() and VARCHAR columns to TEXT or BLOB */