1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Cleanups during review stage

Added auto-correct of field length for enum/set tables for ALTER TABLE
This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE
This commit is contained in:
monty@mysql.com
2004-12-02 14:43:51 +02:00
parent facaf4f7a0
commit d1a666d59a
9 changed files with 85 additions and 42 deletions

View File

@@ -814,8 +814,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(-1);
}
}
else
if (key_info->algorithm == HA_KEY_ALG_RTREE)
else if (key_info->algorithm == HA_KEY_ALG_RTREE)
{
#ifdef HAVE_RTREE_KEYS
if ((key_info->key_parts & 1) == 1)
@@ -839,6 +838,8 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
CHARSET_INFO *ft_key_charset=0; // for FULLTEXT
for (uint column_nr=0 ; (column=cols++) ; column_nr++)
{
key_part_spec *dup_column;
it.rewind();
field=0;
while ((sql_field=it++) &&
@@ -853,9 +854,8 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
column->field_name);
DBUG_RETURN(-1);
}
for (uint dup_nr= 0; dup_nr < column_nr; dup_nr++)
while ((dup_column= cols2++) != column)
{
key_part_spec *dup_column= cols2++;
if (!my_strcasecmp(system_charset_info,
column->field_name, dup_column->field_name))
{
@@ -866,12 +866,6 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
}
}
cols2.rewind();
/* for fulltext keys keyseg length is 1 for blobs (it's ignored in
ft code anyway, and 0 (set to column width later) for char's.
it has to be correct col width for char's, as char data are not
prefixed with length (unlike blobs, where ft code takes data length
from a data prefix, ignoring column->length).
*/
if (key->type == Key::FULLTEXT)
{
if ((sql_field->sql_type != FIELD_TYPE_STRING &&