~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2011-01-25 23:29:53 UTC
  • mto: (2115.1.2 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2116.
  • Revision ID: brian@tangent.org-20110125232953-pi24x5cgp0atbjq2
Encapsulate the condition we use to being a per-session case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#define DRIZZLE_LEX 1
19
19
 
 
20
#include "drizzled/item/num.h"
20
21
#include "drizzled/abort_exception.h"
21
22
#include <drizzled/my_hash.h>
22
23
#include <drizzled/error.h>
258
259
  /* If commit fails, we should be able to reset the OK status. */
259
260
  session->main_da.can_overwrite_status= true;
260
261
  TransactionServices &transaction_services= TransactionServices::singleton();
261
 
  transaction_services.autocommitOrRollback(session, session->is_error());
 
262
  transaction_services.autocommitOrRollback(*session, session->is_error());
262
263
  session->main_da.can_overwrite_status= false;
263
264
 
264
265
  session->transaction.stmt.reset();
608
609
  Session *session= lex->session;
609
610
 
610
611
  if (!(select_lex= new (session->mem_root) Select_Lex()))
611
 
    return(1);
 
612
    return true;
 
613
 
612
614
  select_lex->select_number= ++session->select_number;
613
615
  select_lex->parent_lex= lex; /* Used in init_query. */
614
616
  select_lex->init_query();
615
617
  select_lex->init_select();
616
618
  lex->nest_level++;
 
619
 
617
620
  if (lex->nest_level > (int) MAX_SELECT_NESTING)
618
621
  {
619
622
    my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
620
623
    return(1);
621
624
  }
 
625
 
622
626
  select_lex->nest_level= lex->nest_level;
623
627
  if (move_down)
624
628
  {
646
650
    if (lex->current_select->order_list.first && !lex->current_select->braces)
647
651
    {
648
652
      my_error(ER_WRONG_USAGE, MYF(0), "UNION", "order_st BY");
649
 
      return(1);
 
653
      return true;
650
654
    }
 
655
 
651
656
    select_lex->include_neighbour(lex->current_select);
652
657
    Select_Lex_Unit *unit= select_lex->master_unit();
653
 
    if (!unit->fake_select_lex && unit->add_fake_select_lex(lex->session))
654
 
      return(1);
 
658
 
 
659
    if (not unit->fake_select_lex && unit->add_fake_select_lex(lex->session))
 
660
      return true;
 
661
 
655
662
    select_lex->context.outer_context=
656
663
                unit->first_select()->context.outer_context;
657
664
  }
664
671
    list
665
672
  */
666
673
  select_lex->context.resolve_in_select_list= true;
667
 
  return(0);
 
674
 
 
675
  return false;
668
676
}
669
677
 
670
678
/**
895
903
*/
896
904
 
897
905
TableList *Select_Lex::add_table_to_list(Session *session,
898
 
                                                             Table_ident *table,
899
 
                                                             LEX_STRING *alias,
900
 
                                                             const bitset<NUM_OF_TABLE_OPTIONS>& table_options,
901
 
                                                             thr_lock_type lock_type,
902
 
                                                             List<Index_hint> *index_hints_arg,
 
906
                                         Table_ident *table,
 
907
                                         LEX_STRING *alias,
 
908
                                         const bitset<NUM_OF_TABLE_OPTIONS>& table_options,
 
909
                                         thr_lock_type lock_type,
 
910
                                         List<Index_hint> *index_hints_arg,
903
911
                                         LEX_STRING *option)
904
912
{
905
913
  TableList *ptr;