~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Brian Aker
  • Date: 2010-12-17 00:08:06 UTC
  • mfrom: (2002.1.4 clean)
  • Revision ID: brian@tangent.org-20101217000806-fa6kmggjnhsl4q85
Rollup for field encapsulation, monty fix for bzrignore, and Andrew bug
fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
25
25
*/
26
26
#include <drizzled/message/table.pb.h>
27
27
 
28
 
#include <drizzled/plugin/function.h>
29
 
#include <drizzled/name_resolution_context.h>
30
 
#include <drizzled/item/subselect.h>
31
 
#include <drizzled/table_list.h>
32
 
#include <drizzled/function/math/real.h>
33
 
#include <drizzled/alter_drop.h>
34
 
#include <drizzled/alter_column.h>
35
 
#include <drizzled/alter_info.h>
36
 
#include <drizzled/key_part_spec.h>
37
 
#include <drizzled/index_hint.h>
38
 
#include <drizzled/statement.h>
39
 
#include <drizzled/optimizer/explain_plan.h>
 
28
#include "drizzled/plugin/function.h"
 
29
#include "drizzled/name_resolution_context.h"
 
30
#include "drizzled/item/subselect.h"
 
31
#include "drizzled/table_list.h"
 
32
#include "drizzled/function/math/real.h"
 
33
#include "drizzled/alter_drop.h"
 
34
#include "drizzled/alter_column.h"
 
35
#include "drizzled/alter_info.h"
 
36
#include "drizzled/key_part_spec.h"
 
37
#include "drizzled/index_hint.h"
 
38
#include "drizzled/statement.h"
 
39
#include "drizzled/optimizer/explain_plan.h"
40
40
 
41
41
#include <bitset>
42
42
#include <string>
44
44
namespace drizzled
45
45
{
46
46
 
47
 
class st_lex_symbol;
48
47
class select_result_interceptor;
49
48
 
50
49
/* YACC and LEX Definitions */
295
294
  {}
296
295
 
297
296
  friend class Select_Lex_Unit;
298
 
  friend bool new_select(LEX *lex, bool move_down);
 
297
  friend bool mysql_new_select(LEX *lex, bool move_down);
299
298
private:
300
299
  void fast_exclude();
301
300
};
450
449
    n_sum_items(0),
451
450
    n_child_sum_items(0),
452
451
    explicit_limit(0),
453
 
    is_cross(false),
454
452
    subquery_in_having(0),
455
453
    is_correlated(0),
456
454
    exclude_from_table_unique_test(0),
535
533
 
536
534
  /* explicit LIMIT clause was used */
537
535
  bool explicit_limit;
538
 
 
539
 
  /* explicit CROSS JOIN was used */
540
 
  bool is_cross;
541
 
 
542
536
  /*
543
537
    there are subquery in HAVING clause => we can't close tables before
544
538
    query processing end even if we use temporary table
634
628
    order_list.next= (unsigned char**) &order_list.first;
635
629
  }
636
630
  /*
637
 
    This method created for reiniting LEX in admin_table() and can be
 
631
    This method created for reiniting LEX in mysql_admin_table() and can be
638
632
    used only if you are going remove all Select_Lex & units except belonger
639
633
    to LEX (LEX::unit & LEX::select, for other purposes there are
640
634
    Select_Lex_Unit::exclude_level & Select_Lex_Unit::exclude_tree
801
795
 
802
796
} /* namespace drizzled */
803
797
 
804
 
#include <drizzled/lex_input_stream.h>
 
798
#include "drizzled/lex_input_stream.h"
805
799
 
806
800
namespace drizzled
807
801
{
856
850
  List<Lex_Column>    columns;
857
851
  List<Item>          *insert_list,field_list,value_list,update_list;
858
852
  List<List_item>     many_values;
859
 
  SetVarVector  var_list;
 
853
  List<set_var_base>  var_list;
860
854
  /*
861
855
    A stack of name resolution contexts for the query. This stack is used
862
856
    at parse time to set local name resolution contexts for various parts
936
930
     statement in a session. It's re-used by doing lex_end, lex_start
937
931
     in sql_lex.cc
938
932
  */
939
 
  virtual ~LEX();
 
933
  virtual ~LEX()
 
934
  {
 
935
  }
940
936
 
941
937
  TableList *unlink_first_table(bool *link_to_local);
942
938
  void link_first_table_back(TableList *first, bool link_to_local);
960
956
  {
961
957
    return context_stack.head();
962
958
  }
 
959
  /*
 
960
    Restore the LEX and Session in case of a parse error.
 
961
  */
 
962
  static void cleanup_lex_after_parse_error(Session *session);
963
963
 
964
964
  /**
965
965
    @brief check if the statement is a single-level join
995
995
  void reset()
996
996
  {
997
997
    sum_expr_used= false;
998
 
    _exists= false;
999
998
  }
1000
999
 
1001
1000
  void setSumExprUsed()
1011
1010
  void start(Session *session);
1012
1011
  void end();
1013
1012
 
1014
 
  message::Table *table()
1015
 
  {
1016
 
    if (not _create_table)
1017
 
      _create_table= new message::Table;
1018
 
 
1019
 
    return _create_table;
1020
 
  }
1021
 
 
1022
 
  message::Table::Field *field()
1023
 
  {
1024
 
    return _create_field;
1025
 
  }
1026
 
 
1027
 
  void setField(message::Table::Field *arg)
1028
 
  {
1029
 
    _create_field= arg;
1030
 
  }
1031
 
 
1032
 
  void setExists()
1033
 
  {
1034
 
    _exists= true;
1035
 
  }
1036
 
 
1037
 
  bool exists() const
1038
 
  {
1039
 
    return _exists;
1040
 
  }
1041
 
 
1042
1013
private: 
1043
1014
  bool cacheable;
1044
1015
  bool sum_expr_used;
1045
 
  message::Table *_create_table;
1046
 
  message::Table::Field *_create_field;
1047
 
  bool _exists;
1048
1016
};
1049
1017
 
1050
1018
extern void lex_start(Session *session);
1051
1019
extern void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str);
1052
1020
extern bool is_lex_native_function(const LEX_STRING *name);
1053
1021
 
1054
 
bool check_for_sql_keyword(drizzled::st_lex_symbol const&);
1055
 
bool check_for_sql_keyword(drizzled::lex_string_t const&);
1056
 
 
1057
1022
/**
1058
1023
  @} (End of group Semantic_Analysis)
1059
1024
*/