~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Jay Pipes
  • Date: 2009-05-18 17:38:18 UTC
  • mto: This revision was merged to the branch mainline in revision 1027.
  • Revision ID: jpipes@serialcoder-20090518173818-h7ipwl62g8iv7541
Code style cleanup and removal of dead LEX_SERVER_OPTIONS struct

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
typedef List<Item> List_item;
81
81
 
82
 
/* SERVERS CACHE CHANGES */
83
 
typedef struct st_lex_server_options
84
 
{
85
 
  int32_t port;
86
 
  uint32_t server_name_length;
87
 
  char *server_name, *host, *db, *username, *password, *scheme, *owner;
88
 
} LEX_SERVER_OPTIONS;
89
 
 
90
 
 
91
82
enum sub_select_type
92
83
{
93
 
  UNSPECIFIED_TYPE,UNION_TYPE, INTERSECT_TYPE,
94
 
  EXCEPT_TYPE, GLOBAL_OPTIONS_TYPE, DERIVED_TABLE_TYPE, OLAP_TYPE
 
84
  UNSPECIFIED_TYPE
 
85
, UNION_TYPE
 
86
, INTERSECT_TYPE
 
87
, EXCEPT_TYPE
 
88
, GLOBAL_OPTIONS_TYPE
 
89
, DERIVED_TABLE_TYPE
 
90
, OLAP_TYPE
95
91
};
96
92
 
97
93
enum olap_type
98
94
{
99
 
  UNSPECIFIED_OLAP_TYPE, CUBE_TYPE, ROLLUP_TYPE
 
95
  UNSPECIFIED_OLAP_TYPE
 
96
, CUBE_TYPE
 
97
, ROLLUP_TYPE
100
98
};
101
99
 
102
100
enum tablespace_op_type
103
101
{
104
 
  NO_TABLESPACE_OP, DISCARD_TABLESPACE, IMPORT_TABLESPACE
 
102
  NO_TABLESPACE_OP
 
103
, DISCARD_TABLESPACE
 
104
, IMPORT_TABLESPACE
105
105
};
106
106
 
107
107
/*
400
400
public:
401
401
  Name_resolution_context context;
402
402
  char *db;
403
 
  Item *where, *having;                         /* WHERE & HAVING clauses */
 
403
  /* An Item representing the WHERE clause */
 
404
  Item *where;
 
405
  /* An Item representing the HAVING clause */
 
406
  Item *having;
404
407
  /* Saved values of the WHERE and HAVING clauses*/
405
 
  Item::cond_result cond_value, having_value;
 
408
  Item::cond_result cond_value;
 
409
  Item::cond_result having_value;
406
410
  /* point on lex in which it was created, used in view subquery detection */
407
411
  LEX *parent_lex;
408
412
  enum olap_type olap;
409
413
  /* FROM clause - points to the beginning of the TableList::next_local list. */
410
 
  SQL_LIST            table_list;
411
 
  SQL_LIST            group_list; /* GROUP BY clause. */
412
 
  List<Item>          item_list;  /* list of fields & expressions */
413
 
  List<String>        interval_list;
414
 
  bool                is_item_list_lookup;
 
414
  SQL_LIST table_list;
 
415
  SQL_LIST group_list; /* GROUP BY clause. */
 
416
  List<Item> item_list;  /* list of fields & expressions */
 
417
  List<String> interval_list;
 
418
  bool is_item_list_lookup;
415
419
  JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
416
420
  List<TableList> top_join_list; /* join list of the top level          */
417
421
  List<TableList> *join_list;    /* list for the currently parsed join  */
428
432
  SQL_LIST order_list;                /* ORDER clause */
429
433
  SQL_LIST *gorder_list;
430
434
  Item *select_limit, *offset_limit;  /* LIMIT clause parameters */
431
 
  // Arrays of pointers to top elements of all_fields list
 
435
  /* Arrays of pointers to top elements of all_fields list */
432
436
  Item **ref_pointer_array;
433
437
 
434
438
  /*
454
458
  int8_t nest_level;     /* nesting level of select */
455
459
  Item_sum *inner_sum_func_list; /* list of sum func in nested selects */
456
460
  uint32_t with_wild; /* item list contain '*' */
457
 
  bool  braces;         /* SELECT ... UNION (SELECT ... ) <- this braces */
 
461
  bool braces;          /* SELECT ... UNION (SELECT ... ) <- this braces */
458
462
  /* true when having fix field called in processing of this SELECT */
459
463
  bool having_fix_field;
460
464
  /* List of references to fields referenced from inner selects */
512
516
    return (Select_Lex_Unit*) slave;
513
517
  }
514
518
  Select_Lex* outer_select();
515
 
  Select_Lex* next_select() { return (Select_Lex*) next; }
 
519
  Select_Lex* next_select()
 
520
  {
 
521
    return (Select_Lex*) next;
 
522
  }
516
523
  Select_Lex* next_select_in_list()
517
524
  {
518
525
    return (Select_Lex*) link_next;
535
542
  bool add_item_to_list(Session *session, Item *item);
536
543
  bool add_group_to_list(Session *session, Item *item, bool asc);
537
544
  bool add_order_to_list(Session *session, Item *item, bool asc);
538
 
  TableList* add_table_to_list(Session *session, Table_ident *table,
539
 
                                LEX_STRING *alias,
540
 
                                uint32_t table_options,
541
 
                                thr_lock_type flags= TL_UNLOCK,
542
 
                                List<Index_hint> *hints= 0,
543
 
                                LEX_STRING *option= 0);
 
545
  TableList* add_table_to_list(Session *session
 
546
                             , Table_ident *table
 
547
                             , LEX_STRING *alias
 
548
                             , uint32_t table_options
 
549
                             , thr_lock_type flags= TL_UNLOCK
 
550
                             , List<Index_hint> *hints= 0
 
551
                             , LEX_STRING *option= 0);
544
552
  TableList* get_table_list();
545
553
  bool init_nested_join(Session *session);
546
554
  TableList *end_nested_join(Session *session);
562
570
    to LEX (LEX::unit & LEX::select, for other purposes there are
563
571
    Select_Lex_Unit::exclude_level & Select_Lex_Unit::exclude_tree
564
572
  */
565
 
  void cut_subtree() { slave= 0; }
 
573
  void cut_subtree()
 
574
  {
 
575
    slave= 0;
 
576
  }
566
577
  bool test_limit();
567
578
 
568
579
  friend void lex_start(Session *session);
655
666
class Alter_info
656
667
{
657
668
public:
658
 
  List<Alter_drop>              drop_list;
659
 
  List<Alter_column>            alter_list;
660
 
  List<Key>                     key_list;
661
 
  List<Create_field>            create_list;
662
 
  uint32_t                          flags;
663
 
  enum enum_enable_or_disable   keys_onoff;
664
 
  enum tablespace_op_type       tablespace_op;
665
 
  uint32_t                          no_parts;
666
 
  enum ha_build_method          build_method;
667
 
  Create_field                 *datetime_field;
668
 
  bool                          error_if_not_empty;
669
 
 
 
669
  List<Alter_drop> drop_list;
 
670
  List<Alter_column> alter_list;
 
671
  List<Key> key_list;
 
672
  List<Create_field> create_list;
 
673
  uint32_t flags;
 
674
  enum enum_enable_or_disable keys_onoff;
 
675
  enum tablespace_op_type tablespace_op;
 
676
  uint32_t no_parts;
 
677
  enum ha_build_method build_method;
 
678
  Create_field *datetime_field;
 
679
  bool error_if_not_empty;
670
680
 
671
681
  Alter_info() :
672
682
    flags(0),
698
708
  Alter_info(const Alter_info &rhs);            // not implemented
699
709
};
700
710
 
701
 
enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE,
702
 
                      XA_SUSPEND, XA_FOR_MIGRATE};
 
711
enum xa_option_words
 
712
{
 
713
  XA_NONE
 
714
, XA_JOIN
 
715
, XA_RESUME
 
716
, XA_ONE_PHASE
 
717
, XA_SUSPEND
 
718
, XA_FOR_MIGRATE
 
719
};
703
720
 
704
721
extern const LEX_STRING null_lex_str;
705
722
 
706
 
 
707
723
/*
708
724
  Class representing list of all tables used by statement.
709
725
  It also contains information about stored functions used by statement
714
730
  Also used by st_lex::reset_n_backup/restore_backup_query_tables_list()
715
731
  methods to save and restore this information.
716
732
*/
717
 
 
718
733
class Query_tables_list
719
734
{
720
735
public:
766
781
  }
767
782
};
768
783
 
769
 
 
770
784
/*
771
785
  st_parsing_options contains the flags for constructions that are
772
786
  allowed in the current statement.
773
787
*/
774
 
 
775
788
struct st_parsing_options
776
789
{
777
790
  bool allows_select_procedure;
780
793
  void reset();
781
794
};
782
795
 
783
 
 
784
796
/**
785
797
  The state of the lexical parser, when parsing comments.
786
798
*/
807
819
#include "drizzled/lex_input_stream.h"
808
820
 
809
821
/* The state of the lex parsing. This is saved in the Session struct */
810
 
 
811
822
class LEX : public Query_tables_list
812
823
{
813
824
public:
1040
1051
 
1041
1052
extern void lex_start(Session *session);
1042
1053
extern void lex_end(LEX *lex);
1043
 
 
1044
1054
extern void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str);
1045
 
 
1046
1055
extern bool is_lex_native_function(const LEX_STRING *name);
1047
1056
 
1048
1057
/**