~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-11-26 04:33:51 UTC
  • mto: (1228.4.1 push)
  • mto: This revision was merged to the branch mainline in revision 1234.
  • Revision ID: osullivan.padraig@gmail.com-20091126043351-2ebmuyzrbifxat0q
Removed all remnants of schema_table from the TableList class. This cleans up a bunch of code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2266
2266
 
2267
2267
 
2268
2268
/**
2269
 
  Create field for information schema table.
2270
 
 
2271
 
  @param session                Thread Cursor
2272
 
  @param table          Temporary table
2273
 
  @param item           Item to create a field for
2274
 
 
2275
 
  @retval
2276
 
    0                   on error
2277
 
  @retval
2278
 
    new_created field
2279
 
*/
2280
 
 
2281
 
static Field *create_tmp_field_for_schema(Item *item, Table *table)
2282
 
{
2283
 
  if (item->field_type() == DRIZZLE_TYPE_VARCHAR)
2284
 
  {
2285
 
    Field *field;
2286
 
    if (item->max_length > MAX_FIELD_VARCHARLENGTH)
2287
 
      field= new Field_blob(item->max_length, item->maybe_null,
2288
 
                            item->name, item->collation.collation);
2289
 
    else
2290
 
      field= new Field_varstring(item->max_length, item->maybe_null,
2291
 
                                 item->name,
2292
 
                                 table->s, item->collation.collation);
2293
 
    if (field)
2294
 
      field->init(table);
2295
 
    return field;
2296
 
  }
2297
 
  return item->tmp_table_field_from_field_type(table, 0);
2298
 
}
2299
 
 
2300
 
 
2301
 
/**
2302
2269
  Create a temp table according to a field list.
2303
2270
 
2304
2271
  Given field pointers are changed to point at tmp_table for
2562
2529
        We here distinguish between UNION and multi-table-updates by the fact
2563
2530
        that in the later case group is set to the row pointer.
2564
2531
      */
2565
 
      Field *new_field= (param->schema_table) ?
2566
 
        create_tmp_field_for_schema(item, table) :
 
2532
      Field *new_field= 
2567
2533
        create_tmp_field(session, table, item, type, &copy_func,
2568
2534
                         tmp_from_field, &default_field[fieldnr],
2569
2535
                         group != 0,