1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-17 12:02:09 +03:00

Merge 52.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/mysql-5.0

into 52.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/work-repl-5.0
This commit is contained in:
bell@52.0.168.192.in-addr.arpa
2005-02-23 19:22:52 +02:00
78 changed files with 785 additions and 181 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)