~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Brian Aker
  • Date: 2008-08-19 15:11:04 UTC
  • mfrom: (327.2.6 drizzle-good)
  • Revision ID: brian@gir.tangent.org-20080819151104-uxk5lgoaj0fwgx9z
Merge of Brian's tree to main tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
  virtual bool set_braces(bool value);
366
366
  virtual bool inc_in_sum_expr();
367
367
  virtual uint32_t get_in_sum_expr();
368
 
  virtual TABLE_LIST* get_table_list();
 
368
  virtual TableList* get_table_list();
369
369
  virtual List<Item>* get_item_list();
370
370
  virtual uint32_t get_table_join_options();
371
 
  virtual TABLE_LIST *add_table_to_list(THD *thd, Table_ident *table,
 
371
  virtual TableList *add_table_to_list(THD *thd, Table_ident *table,
372
372
                                        LEX_STRING *alias,
373
373
                                        uint32_t table_options,
374
374
                                        thr_lock_type flags= TL_UNLOCK,
394
394
class select_union;
395
395
class st_select_lex_unit: public st_select_lex_node {
396
396
protected:
397
 
  TABLE_LIST result_table_list;
 
397
  TableList result_table_list;
398
398
  select_union *union_result;
399
399
  Table *table; /* temporary table using for appending UNION results */
400
400
 
498
498
  /* point on lex in which it was created, used in view subquery detection */
499
499
  st_lex *parent_lex;
500
500
  enum olap_type olap;
501
 
  /* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */
 
501
  /* FROM clause - points to the beginning of the TableList::next_local list. */
502
502
  SQL_LIST            table_list;
503
503
  SQL_LIST            group_list; /* GROUP BY clause. */
504
504
  List<Item>          item_list;  /* list of fields & expressions */
511
511
  List<Item_real_func> *ftfunc_list;
512
512
  List<Item_real_func> ftfunc_list_alloc;
513
513
  JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
514
 
  List<TABLE_LIST> top_join_list; /* join list of the top level          */
515
 
  List<TABLE_LIST> *join_list;    /* list for the currently parsed join  */
516
 
  TABLE_LIST *embedding;          /* table embedding to the above list   */
517
 
  List<TABLE_LIST> sj_nests;
 
514
  List<TableList> top_join_list; /* join list of the top level          */
 
515
  List<TableList> *join_list;    /* list for the currently parsed join  */
 
516
  TableList *embedding;          /* table embedding to the above list   */
 
517
  List<TableList> sj_nests;
518
518
  /*
519
519
    Beginning of the list of leaves in a FROM clause, where the leaves
520
520
    inlcude all base tables including view tables. The tables are connected
521
 
    by TABLE_LIST::next_leaf, so leaf_tables points to the left-most leaf.
 
521
    by TableList::next_leaf, so leaf_tables points to the left-most leaf.
522
522
  */
523
 
  TABLE_LIST *leaf_tables;
 
523
  TableList *leaf_tables;
524
524
  const char *type;               /* type of select for EXPLAIN          */
525
525
 
526
526
  SQL_LIST order_list;                /* ORDER clause */
601
601
  /* 
602
602
    This is a copy of the original JOIN USING list that comes from
603
603
    the parser. The parser :
604
 
      1. Sets the natural_join of the second TABLE_LIST in the join
 
604
      1. Sets the natural_join of the second TableList in the join
605
605
         and the st_select_lex::prev_join_using.
606
 
      2. Makes a parent TABLE_LIST and sets its is_natural_join/
 
606
      2. Makes a parent TableList and sets its is_natural_join/
607
607
       join_using_fields members.
608
 
      3. Uses the wrapper TABLE_LIST as a table in the upper level.
 
608
      3. Uses the wrapper TableList as a table in the upper level.
609
609
    We cannot assign directly to join_using_fields in the parser because
610
 
    at stage (1.) the parent TABLE_LIST is not constructed yet and
 
610
    at stage (1.) the parent TableList is not constructed yet and
611
611
    the assignment will override the JOIN USING fields of the lower level
612
612
    joins on the right.
613
613
  */
653
653
  bool add_item_to_list(THD *thd, Item *item);
654
654
  bool add_group_to_list(THD *thd, Item *item, bool asc);
655
655
  bool add_order_to_list(THD *thd, Item *item, bool asc);
656
 
  TABLE_LIST* add_table_to_list(THD *thd, Table_ident *table,
 
656
  TableList* add_table_to_list(THD *thd, Table_ident *table,
657
657
                                LEX_STRING *alias,
658
658
                                uint32_t table_options,
659
659
                                thr_lock_type flags= TL_UNLOCK,
660
660
                                List<Index_hint> *hints= 0,
661
661
                                LEX_STRING *option= 0);
662
 
  TABLE_LIST* get_table_list();
 
662
  TableList* get_table_list();
663
663
  bool init_nested_join(THD *thd);
664
 
  TABLE_LIST *end_nested_join(THD *thd);
665
 
  TABLE_LIST *nest_last_join(THD *thd);
666
 
  void add_joined_table(TABLE_LIST *table);
667
 
  TABLE_LIST *convert_right_join();
 
664
  TableList *end_nested_join(THD *thd);
 
665
  TableList *nest_last_join(THD *thd);
 
666
  void add_joined_table(TableList *table);
 
667
  TableList *convert_right_join();
668
668
  List<Item>* get_item_list();
669
669
  uint32_t get_table_join_options();
670
670
  void set_lock_for_tables(thr_lock_type lock_type);
693
693
  bool setup_ref_array(THD *thd, uint32_t order_group_num);
694
694
  void print(THD *thd, String *str, enum_query_type query_type);
695
695
  static void print_order(String *str,
696
 
                          ORDER *order,
 
696
                          order_st *order,
697
697
                          enum_query_type query_type);
698
698
  void print_limit(THD *thd, String *str, enum_query_type query_type);
699
699
  void fix_prepare_information(THD *thd, Item **conds, Item **having_conds);
838
838
{
839
839
public:
840
840
  /* Global list of all tables used by this statement */
841
 
  TABLE_LIST *query_tables;
 
841
  TableList *query_tables;
842
842
  /* Pointer to next_global member of last element in the previous list. */
843
 
  TABLE_LIST **query_tables_last;
 
843
  TableList **query_tables_last;
844
844
  /*
845
845
    If non-0 then indicates that query requires prelocking and points to
846
846
    next_global member of last own element in query table list (i.e. last
847
847
    table which was not added to it as part of preparation to prelocking).
848
848
    0 - indicates that this query does not need prelocking.
849
849
  */
850
 
  TABLE_LIST **query_tables_own_last;
 
850
  TableList **query_tables_own_last;
851
851
  /*
852
852
    Set of stored routines called by statement.
853
853
    (Note that we use lazy-initialization for this hash).
887
887
    If you are using this function, you must ensure that the table
888
888
    object, in particular table->db member, is initialized.
889
889
  */
890
 
  void add_to_query_tables(TABLE_LIST *table)
 
890
  void add_to_query_tables(TableList *table)
891
891
  {
892
892
    *(table->prev_global= query_tables_last)= table;
893
893
    query_tables_last= &table->next_global;
894
894
  }
895
895
  /* Return pointer to first not-own table in query-tables or 0 */
896
 
  TABLE_LIST* first_not_own_table()
 
896
  TableList* first_not_own_table()
897
897
  {
898
898
    return ( query_tables_own_last ? *query_tables_own_last : 0);
899
899
  }
1401
1401
  const CHARSET_INFO *charset;
1402
1402
  bool text_string_is_7bit;
1403
1403
  /* store original leaf_tables for INSERT SELECT and PS/SP */
1404
 
  TABLE_LIST *leaf_tables_insert;
 
1404
  TableList *leaf_tables_insert;
1405
1405
 
1406
1406
  List<Key_part_spec> col_list;
1407
1407
  List<Key_part_spec> ref_list;
1530
1530
    delete_dynamic(&plugins);
1531
1531
  }
1532
1532
 
1533
 
  TABLE_LIST *unlink_first_table(bool *link_to_local);
1534
 
  void link_first_table_back(TABLE_LIST *first, bool link_to_local);
 
1533
  TableList *unlink_first_table(bool *link_to_local);
 
1534
  void link_first_table_back(TableList *first, bool link_to_local);
1535
1535
  void first_lists_tables_same();
1536
1536
 
1537
1537
  bool can_be_merged();