~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  {
64
64
    /* create_myisam_from_heap will generate error if needed */
65
65
    if (table->file->is_fatal_error(error, HA_CHECK_DUP) &&
66
 
        create_myisam_from_heap(session, table, tmp_table_param.start_recinfo, 
 
66
        create_myisam_from_heap(session, table, tmp_table_param.start_recinfo,
67
67
                                &tmp_table_param.recinfo, error, 1))
68
68
      return 1;
69
69
  }
160
160
*/
161
161
 
162
162
void
163
 
st_select_lex_unit::init_prepare_fake_select_lex(Session *session_arg) 
 
163
st_select_lex_unit::init_prepare_fake_select_lex(Session *session_arg)
164
164
{
165
165
  session_arg->lex->current_select= fake_select_lex;
166
166
  fake_select_lex->table_list.link_in_list((unsigned char *)&result_table_list,
167
167
                                           (unsigned char **)
168
168
                                           &result_table_list.next_local);
169
 
  fake_select_lex->context.table_list= 
170
 
    fake_select_lex->context.first_name_resolution_table= 
 
169
  fake_select_lex->context.table_list=
 
170
    fake_select_lex->context.first_name_resolution_table=
171
171
    fake_select_lex->get_table_list();
172
172
 
173
173
  for (order_st *order= (order_st *) global_parameters->order_list.first;
224
224
  }
225
225
  prepared= 1;
226
226
  saved_error= false;
227
 
  
 
227
 
228
228
  session_arg->lex->current_select= sl= first_sl;
229
229
  found_rows_for_union= first_sl->options & OPTION_FOUND_ROWS;
230
230
  is_union_select= is_union() || fake_select_lex;
247
247
  {
248
248
    bool can_skip_order_by;
249
249
    sl->options|=  SELECT_NO_UNLOCK;
250
 
    JOIN *join= new JOIN(session_arg, sl->item_list, 
 
250
    JOIN *join= new JOIN(session_arg, sl->item_list,
251
251
                         sl->options | session_arg->options | additional_options,
252
252
                         tmp_result);
253
253
    /*
320
320
        goto err;
321
321
      }
322
322
      List_iterator_fast<Item> it(sl->item_list);
323
 
      List_iterator_fast<Item> tp(types);       
 
323
      List_iterator_fast<Item> tp(types);
324
324
      Item *type, *item_tmp;
325
325
      while ((type= tp++, item_tmp= it++))
326
326
      {
349
349
        goto err;
350
350
      }
351
351
    }
352
 
    
 
352
 
353
353
    create_options= (first_sl->options | session_arg->options |
354
354
                     TMP_TABLE_ALL_COLUMNS);
355
355
 
398
398
  if (executed && !uncacheable && !describe)
399
399
    return(false);
400
400
  executed= 1;
401
 
  
 
401
 
402
402
  if (uncacheable || !item || !item->assigned() || describe)
403
403
  {
404
404
    if (item)
443
443
          we don't calculate found_rows() per union part.
444
444
          Otherwise, SQL_CALC_FOUND_ROWS should be done on all sub parts.
445
445
        */
446
 
        sl->join->select_options= 
 
446
        sl->join->select_options=
447
447
          (select_limit_cnt == HA_POS_ERROR || sl->braces) ?
448
448
          sl->options & ~OPTION_FOUND_ROWS : sl->options | found_rows_for_union;
449
449
 
490
490
        table->file->print_error(error, MYF(0));
491
491
        return(1);
492
492
      }
493
 
      if (found_rows_for_union && !sl->braces && 
 
493
      if (found_rows_for_union && !sl->braces &&
494
494
          select_limit_cnt != HA_POS_ERROR)
495
495
      {
496
496
        /*
556
556
             - 1st time is a real evaluation to get the subquery value
557
557
             - 2nd time is to produce EXPLAIN output rows.
558
558
            1st execution sets certain members (e.g. select_result) to perform
559
 
            subquery execution rather than EXPLAIN line production. In order 
 
559
            subquery execution rather than EXPLAIN line production. In order
560
560
            to reset them back, we re-do all of the actions (yes it is ugly):
561
561
          */
562
562
          join->init(session, item_list, fake_select_lex->options, result);