~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Monty Taylor
  • Date: 2010-09-28 07:45:44 UTC
  • mto: (1799.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1800.
  • Revision ID: mordred@inaugust.com-20100928074544-s3ujnv6s8wro74l2
Added BSD copying file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
*/
63
63
 
64
64
#ifdef DRIZZLE_SERVER
65
 
/* set_var should change to set_var here ... */
66
 
# include <drizzled/sys_var.h>
 
65
# include <drizzled/set_var.h>
67
66
# include <drizzled/item/func.h>
68
67
# ifdef DRIZZLE_YACC
69
68
#  define LEX_YYSTYPE void *
249
248
      UNCACHEABLE_EXPLAIN
250
249
      UNCACHEABLE_PREPARE
251
250
  */
252
 
  std::bitset<8> uncacheable;
 
251
  uint8_t uncacheable;
253
252
  enum sub_select_type linkage;
254
253
  bool no_table_names_allowed; /* used for global order by */
255
254
  bool no_error; /* suppress error message (convert it to warnings) */
284
283
  virtual uint32_t get_in_sum_expr();
285
284
  virtual TableList* get_table_list();
286
285
  virtual List<Item>* get_item_list();
 
286
  virtual uint32_t get_table_join_options();
287
287
  virtual TableList *add_table_to_list(Session *session, Table_ident *table,
288
 
                                       LEX_STRING *alias,
289
 
                                       const std::bitset<NUM_OF_TABLE_OPTIONS>& table_options,
290
 
                                       thr_lock_type flags= TL_UNLOCK,
291
 
                                       List<Index_hint> *hints= 0,
292
 
                                       LEX_STRING *option= 0);
 
288
                                        LEX_STRING *alias,
 
289
                                        uint32_t table_options,
 
290
                                        thr_lock_type flags= TL_UNLOCK,
 
291
                                        List<Index_hint> *hints= 0,
 
292
                                        LEX_STRING *option= 0);
293
293
  virtual void set_lock_for_tables(thr_lock_type)
294
294
  {}
295
295
 
404
404
class Select_Lex: public Select_Lex_Node
405
405
{
406
406
public:
407
 
 
408
 
  Select_Lex() :
409
 
    context(),
410
 
    db(0),
411
 
    where(0),
412
 
    having(0),
413
 
    cond_value(),
414
 
    having_value(),
415
 
    parent_lex(0),
416
 
    olap(UNSPECIFIED_OLAP_TYPE),
417
 
    table_list(),
418
 
    group_list(),
419
 
    item_list(),
420
 
    interval_list(),
421
 
    is_item_list_lookup(false),
422
 
    join(0),
423
 
    top_join_list(),
424
 
    join_list(0),
425
 
    embedding(0),
426
 
    sj_nests(),
427
 
    leaf_tables(0),
428
 
    type(optimizer::ST_PRIMARY),
429
 
    order_list(),
430
 
    gorder_list(0),
431
 
    select_limit(0),
432
 
    offset_limit(0),
433
 
    ref_pointer_array(0),
434
 
    select_n_having_items(0),
435
 
    cond_count(0),
436
 
    between_count(0),
437
 
    max_equal_elems(0),
438
 
    select_n_where_fields(0),
439
 
    parsing_place(NO_MATTER),
440
 
    with_sum_func(0),
441
 
    in_sum_expr(0),
442
 
    select_number(0),
443
 
    nest_level(0),
444
 
    inner_sum_func_list(0),
445
 
    with_wild(0),
446
 
    braces(0),
447
 
    having_fix_field(0),
448
 
    inner_refs_list(),
449
 
    n_sum_items(0),
450
 
    n_child_sum_items(0),
451
 
    explicit_limit(0),
452
 
    subquery_in_having(0),
453
 
    is_correlated(0),
454
 
    exclude_from_table_unique_test(0),
455
 
    non_agg_fields(),
456
 
    cur_pos_in_select_list(0),
457
 
    prev_join_using(0),
458
 
    full_group_by_flag(),
459
 
    current_index_hint_type(INDEX_HINT_IGNORE),
460
 
    current_index_hint_clause(),
461
 
    index_hints(0)
462
 
  {
463
 
  }
464
 
 
465
407
  Name_resolution_context context;
466
408
  char *db;
467
409
  /* An Item representing the WHERE clause */
516
458
  enum_parsing_place parsing_place; /* where we are parsing expression */
517
459
  bool with_sum_func;   /* sum function indicator */
518
460
 
 
461
  uint32_t table_join_options;
519
462
  uint32_t in_sum_expr;
520
463
  uint32_t select_number; /* number of select (used for EXPLAIN) */
521
464
  int8_t nest_level;     /* nesting level of select */
609
552
  TableList* add_table_to_list(Session *session,
610
553
                               Table_ident *table,
611
554
                               LEX_STRING *alias,
612
 
                               const std::bitset<NUM_OF_TABLE_OPTIONS>& table_options,
 
555
                               uint32_t table_options,
613
556
                               thr_lock_type flags= TL_UNLOCK,
614
557
                               List<Index_hint> *hints= 0,
615
558
                               LEX_STRING *option= 0);
620
563
  void add_joined_table(TableList *table);
621
564
  TableList *convert_right_join();
622
565
  List<Item>* get_item_list();
 
566
  uint32_t get_table_join_options();
623
567
  void set_lock_for_tables(thr_lock_type lock_type);
624
568
  inline void init_order()
625
569
  {
640
584
  bool test_limit();
641
585
 
642
586
  friend void lex_start(Session *session);
 
587
  Select_Lex() : n_sum_items(0), n_child_sum_items(0) {}
643
588
  void make_empty_select()
644
589
  {
645
590
    init_query();
648
593
  bool setup_ref_array(Session *session, uint32_t order_group_num);
649
594
  void print(Session *session, String *str, enum_query_type query_type);
650
595
  static void print_order(String *str,
651
 
                          Order *order,
 
596
                          order_st *order,
652
597
                          enum_query_type query_type);
653
598
  void print_limit(Session *session, String *str, enum_query_type query_type);
654
599
  void fix_prepare_information(Session *session, Item **conds, Item **having_conds);
938
883
  void link_first_table_back(TableList *first, bool link_to_local);
939
884
  void first_lists_tables_same();
940
885
 
 
886
  bool only_view_structure();
 
887
  bool need_correct_ident();
 
888
 
941
889
  void cleanup_after_one_table_open();
942
890
 
943
891
  bool push_context(Name_resolution_context *context)
1006
954
  {
1007
955
    return sum_expr_used;
1008
956
  }
1009
 
 
1010
 
  void start(Session *session);
1011
 
  void end();
1012
 
 
1013
957
private: 
1014
958
  bool cacheable;
1015
959
  bool sum_expr_used;
1016
960
};
1017
961
 
1018
962
extern void lex_start(Session *session);
 
963
extern void lex_end(LEX *lex);
1019
964
extern void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str);
1020
965
extern bool is_lex_native_function(const LEX_STRING *name);
1021
966