~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 20:05:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622200558-oq3jb987di9yj70r
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <drizzled/session.h>
30
30
#include <drizzled/item/subselect.h>
31
31
 
32
 
namespace drizzled
33
 
{
 
32
namespace drizzled {
34
33
 
35
34
bool drizzle_union(Session *session, LEX *, select_result *result,
36
35
                   Select_Lex_Unit *unit, uint64_t setup_tables_done_option)
37
36
{
38
 
  bool res;
39
 
  if (!(res= unit->prepare(session, result, SELECT_NO_UNLOCK |
40
 
                           setup_tables_done_option)))
 
37
  bool res= unit->prepare(session, result, SELECT_NO_UNLOCK | setup_tables_done_option);
 
38
  if (!res)
41
39
    res= unit->exec();
42
40
  if (res)
43
41
    res|= unit->cleanup();
44
 
  return(res);
 
42
  return res;
45
43
}
46
44
 
47
45
 
225
223
        offset_limit_cnt= 0;
226
224
        if (result->prepare(sl->join->fields_list, this))
227
225
        {
228
 
          return(true);
 
226
          return true;
229
227
        }
230
228
        sl->join->select_options|= SELECT_DESCRIBE;
231
229
        sl->join->reinit();
232
230
      }
233
231
    }
234
 
    return(false);
 
232
    return false;
235
233
  }
236
234
  prepared= 1;
237
235
  saved_error= false;
333
331
      while ((type= tp++, item_tmp= it++))
334
332
      {
335
333
        if (((Item_type_holder*)type)->join_types(session_arg, item_tmp))
336
 
          return(true);
 
334
          return true;
337
335
      }
338
336
    }
339
337
  }
389
387
 
390
388
err:
391
389
  session_arg->lex().current_select= lex_select_save;
392
 
  return(true);
 
390
  return true;
393
391
}
394
392
 
395
393
 
461
459
        if (sl == union_distinct)
462
460
        {
463
461
          if (table->cursor->ha_disable_indexes(HA_KEY_SWITCH_ALL))
464
 
            return(true);
 
462
            return true;
465
463
          table->no_keyread=1;
466
464
        }
467
465
        saved_error= sl->join->error;
528
526
                                              fake_select_lex->options, result)))
529
527
        {
530
528
          fake_select_lex->table_list.clear();
531
 
          return(true);
 
529
          return true;
532
530
        }
533
531
        fake_select_lex->join->no_const_tables= true;
534
532
 
600
598
 
601
599
  if (cleaned)
602
600
  {
603
 
    return(false);
 
601
    return false;
604
602
  }
605
603
  cleaned= 1;
606
604