~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to sql/sql_lex.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-02 16:10:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070402161053-zkil9hjq9k5p1uzv
Tags: 5.0.37-0ubuntu1
* New upstream bugfix release.
  - Fixes replication failure with auto-increment and on duplicate key
    update, a regression introduced into 5.0.24. (LP: #95821)
* debian/control: Set Ubuntu maintainer.
* debian/rules: Change comments from 'Debian etch' to 'Ubuntu 7.04'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
 
1
/* Copyright (C) 2000-2006 MySQL AB
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; either version 2 of the License, or
6
 
   (at your option) any later version.
 
5
   the Free Software Foundation; version 2 of the License.
7
6
 
8
7
   This program is distributed in the hope that it will be useful,
9
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
95
94
  SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
96
95
  SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
97
96
  SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
 
97
  SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
 
98
 
 
99
  /*
 
100
    When a command is added here, be sure it's also added in mysqld.cc
 
101
    in "struct show_var_st status_vars[]= {" ...
 
102
  */
98
103
  /* This should be the last !!! */
99
 
 
100
104
  SQLCOM_END
101
105
};
102
106
 
470
474
  void set_thd(THD *thd_arg) { thd= thd_arg; }
471
475
 
472
476
  friend void lex_start(THD *thd, uchar *buf, uint length);
473
 
  friend int subselect_union_engine::exec(bool);
 
477
  friend int subselect_union_engine::exec();
474
478
 
475
479
  List<Item> *get_unit_column_types();
476
480
};
518
522
 
519
523
  SQL_LIST order_list;                /* ORDER clause */
520
524
  List<List_item>     expr_list;
521
 
  List<List_item>     when_list;      /* WHEN clause (expression) */
522
525
  SQL_LIST *gorder_list;
523
526
  Item *select_limit, *offset_limit;  /* LIMIT clause parameters */
524
527
  // Arrays of pointers to top elements of all_fields list
582
585
  bool no_wrap_view_item;
583
586
  /* exclude this select from check of unique_table() */
584
587
  bool exclude_from_table_unique_test;
 
588
  /* List of fields that aren't under an aggregate function */
 
589
  List<Item_field> non_agg_fields;
 
590
  /* index in the select list of the expression currently being fixed */
 
591
  int cur_pos_in_select_list;
585
592
 
586
593
  List<udf_func>     udf_list;                  /* udf function calls stack */
 
594
  /* 
 
595
    This is a copy of the original JOIN USING list that comes from
 
596
    the parser. The parser :
 
597
      1. Sets the natural_join of the second TABLE_LIST in the join
 
598
         and the st_select_lex::prev_join_using.
 
599
      2. Makes a parent TABLE_LIST and sets its is_natural_join/
 
600
       join_using_fields members.
 
601
      3. Uses the wrapper TABLE_LIST as a table in the upper level.
 
602
    We cannot assign directly to join_using_fields in the parser because
 
603
    at stage (1.) the parent TABLE_LIST is not constructed yet and
 
604
    the assignment will override the JOIN USING fields of the lower level
 
605
    joins on the right.
 
606
  */
 
607
  List<String> *prev_join_using;
587
608
 
588
609
  void init_query();
589
610
  void init_select();
688
709
#define ALTER_CONVERT          1024
689
710
#define ALTER_FORCE             2048
690
711
 
691
 
typedef struct st_alter_info
 
712
/**
 
713
  @brief Parsing data for CREATE or ALTER TABLE.
 
714
 
 
715
  This structure contains a list of columns or indexes to be created,
 
716
  altered or dropped.
 
717
*/
 
718
 
 
719
class Alter_info
692
720
{
 
721
public:
693
722
  List<Alter_drop>            drop_list;
694
723
  List<Alter_column>          alter_list;
 
724
  List<Key>                   key_list;
 
725
  List<create_field>          create_list;
695
726
  uint                        flags;
696
727
  enum enum_enable_or_disable keys_onoff;
697
728
  enum tablespace_op_type     tablespace_op;
698
729
 
699
 
  st_alter_info(){clear();}
700
 
  void clear(){keys_onoff= LEAVE_AS_IS;tablespace_op= NO_TABLESPACE_OP;}
701
 
  void reset(){drop_list.empty();alter_list.empty();clear();}
702
 
} ALTER_INFO;
 
730
  Alter_info() :
 
731
    flags(0),
 
732
    keys_onoff(LEAVE_AS_IS),
 
733
    tablespace_op(NO_TABLESPACE_OP)
 
734
  {}
 
735
 
 
736
  void reset()
 
737
  {
 
738
    drop_list.empty();
 
739
    alter_list.empty();
 
740
    key_list.empty();
 
741
    create_list.empty();
 
742
    flags= 0;
 
743
    keys_onoff= LEAVE_AS_IS;
 
744
    tablespace_op= NO_TABLESPACE_OP;
 
745
  }
 
746
  /**
 
747
    Construct a copy of this object to be used for mysql_alter_table
 
748
    and mysql_create_table. Historically, these two functions modify
 
749
    their Alter_info arguments. This behaviour breaks re-execution of
 
750
    prepared statements and stored procedures and is compensated by
 
751
    always supplying a copy of Alter_info to these functions.
 
752
    The constructed copy still shares key Key, Alter_drop, create_field
 
753
    and Alter_column elements of the lists - these structures are not
 
754
    modified and thus are not copied.
 
755
 
 
756
    @note You need to use check thd->is_fatal_error for out
 
757
    of memory condition after calling this function.
 
758
  */
 
759
  Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root);
 
760
private:
 
761
  Alter_info &operator=(const Alter_info &rhs); // not implemented
 
762
  Alter_info(const Alter_info &rhs);            // not implemented
 
763
};
703
764
 
704
765
struct st_sp_chistics
705
766
{
885
946
  List<String>        interval_list;
886
947
  List<LEX_USER>      users_list;
887
948
  List<LEX_COLUMN>    columns;
888
 
  List<Key>           key_list;
889
 
  List<create_field>  create_list;
890
949
  List<Item>          *insert_list,field_list,value_list,update_list;
891
950
  List<List_item>     many_values;
892
951
  List<set_var_base>  var_list;
940
999
  enum enum_var_type option_type;
941
1000
  enum enum_view_create_mode create_view_mode;
942
1001
  enum enum_drop_mode drop_mode;
 
1002
 
 
1003
  uint profile_query_id;
 
1004
  uint profile_options;
943
1005
  uint uint_geom_type;
944
1006
  uint grant, grant_tot_col, which_columns;
945
1007
  uint fk_delete_opt, fk_update_opt, fk_match_option;
979
1041
  bool safe_to_cache_query;
980
1042
  bool subqueries, ignore;
981
1043
  st_parsing_options parsing_options;
982
 
  ALTER_INFO alter_info;
 
1044
  Alter_info alter_info;
983
1045
  /* Prepared statements SQL syntax:*/
984
1046
  LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */
985
1047
  /*