~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.cc

  • Committer: Brian Aker
  • Date: 2010-02-09 21:18:30 UTC
  • mfrom: (1273.2.42)
  • Revision ID: brian@gaz-20100209211830-7vf91n0yasi0r28y
Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                         duplicates on insert
105
105
      options            create options
106
106
      table_alias        name of the temporary table
107
 
      bit_fields_as_long convert bit fields to uint64_t
108
107
 
109
108
  DESCRIPTION
110
109
    Create a temporary table that is used to store the result of a UNION,
118
117
bool
119
118
select_union::create_result_table(Session *session_arg, List<Item> *column_types,
120
119
                                  bool is_union_distinct, uint64_t options,
121
 
                                  const char *table_alias,
122
 
                                  bool bit_fields_as_long)
 
120
                                  const char *table_alias)
123
121
{
124
 
  assert(table == 0);
 
122
  assert(table == NULL);
125
123
  tmp_table_param.init();
126
124
  tmp_table_param.field_count= column_types->elements;
127
 
  tmp_table_param.bit_fields_as_long= bit_fields_as_long;
128
125
 
129
126
  if (! (table= create_tmp_table(session_arg, &tmp_table_param, *column_types,
130
 
                                 (order_st*) 0, is_union_distinct, 1,
 
127
                                 (order_st*) NULL, is_union_distinct, 1,
131
128
                                 options, HA_POS_ERROR, (char*) table_alias)))
132
129
    return true;
133
130
  table->cursor->extra(HA_EXTRA_WRITE_CACHE);
276
273
                                sl->order_list.elements) +
277
274
                               sl->group_list.elements,
278
275
                               can_skip_order_by ?
279
 
                               (order_st*) 0 : (order_st *)sl->order_list.first,
 
276
                               (order_st*) NULL : (order_st *)sl->order_list.first,
280
277
                               (order_st*) sl->group_list.first,
281
278
                               sl->having,
282
279
                               sl, this);
356
353
                     TMP_TABLE_ALL_COLUMNS);
357
354
 
358
355
    if (union_result->create_result_table(session, &types, test(union_distinct),
359
 
                                          create_options, "", false))
 
356
                                          create_options, ""))
360
357
      goto err;
361
358
    memset(&result_table_list, 0, sizeof(result_table_list));
362
359
    result_table_list.db= (char*) "";
434
431
        {
435
432
          offset_limit_cnt= 0;
436
433
          /*
437
 
            We can't use LIMIT at this stage if we are using order_st BY for the
 
434
            We can't use LIMIT at this stage if we are using ORDER BY for the
438
435
            whole query
439
436
          */
440
437
          if (sl->order_list.first || describe)