1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for bug #7217: information_schema: columns are varbinary() instead of timestamp &

bug #7215: information_schema: columns are longtext instead of varchar
This commit is contained in:
gluh@gluh.mysql.r18.ru
2005-02-23 15:15:36 +03:00
parent eac72d405f
commit 3e9bf3af34
7 changed files with 72 additions and 10 deletions

View File

@@ -7676,6 +7676,36 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
return new_field;
}
/*
Create field for information schema table
SYNOPSIS
create_tmp_field_for_schema()
thd Thread handler
table Temporary table
item Item to create a field for
RETURN
0 on error
new_created field
*/
Field *create_tmp_field_for_schema(THD *thd, Item *item, TABLE *table)
{
if (item->field_type() == MYSQL_TYPE_VARCHAR)
{
if (item->max_length > MAX_FIELD_VARCHARLENGTH /
item->collation.collation->mbmaxlen)
return new Field_blob(item->max_length, item->maybe_null,
item->name, table, item->collation.collation);
return new Field_varstring(item->max_length, item->maybe_null, item->name,
table, item->collation.collation);
}
return item->tmp_table_field_from_field_type(table);
}
/*
Create field for temporary table
@@ -7978,10 +8008,13 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
We here distinguish between UNION and multi-table-updates by the fact
that in the later case group is set to the row pointer.
*/
Field *new_field= create_tmp_field(thd, table, item, type, &copy_func,
tmp_from_field, group != 0,
not_all_columns || group !=0,
param->convert_blob_length);
Field *new_field= (param->schema_table) ?
create_tmp_field_for_schema(thd, item, table) :
create_tmp_field(thd, table, item, type, &copy_func,
tmp_from_field, group != 0,
not_all_columns || group !=0,
param->convert_blob_length);
if (!new_field)
{
if (thd->is_fatal_error)