~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/event_parse_data.h

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2000-2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef _EVENT_PARSE_DATA_H_
 
17
#define _EVENT_PARSE_DATA_H_
 
18
 
 
19
#define EVEX_GET_FIELD_FAILED   -2
 
20
#define EVEX_BAD_PARAMS         -5
 
21
#define EVEX_MICROSECOND_UNSUP  -6
 
22
#define EVEX_MAX_INTERVAL_VALUE 1000000000L
 
23
 
 
24
class Event_parse_data : public Sql_alloc
 
25
{
 
26
public:
 
27
  /*
 
28
    ENABLED = feature can function normally (is turned on)
 
29
    SLAVESIDE_DISABLED = feature is turned off on slave
 
30
    DISABLED = feature is turned off
 
31
  */
 
32
  enum enum_status
 
33
  {
 
34
    ENABLED = 1,
 
35
    DISABLED,
 
36
    SLAVESIDE_DISABLED  
 
37
  };
 
38
 
 
39
  enum enum_on_completion
 
40
  {
 
41
    ON_COMPLETION_DROP = 1,
 
42
    ON_COMPLETION_PRESERVE
 
43
  };
 
44
 
 
45
  int on_completion;
 
46
  int status;
 
47
  longlong originator;
 
48
  /*
 
49
    do_not_create will be set if STARTS time is in the past and
 
50
    on_completion == ON_COMPLETION_DROP.
 
51
  */
 
52
  bool do_not_create;
 
53
 
 
54
  bool body_changed;
 
55
 
 
56
  LEX_STRING dbname;
 
57
  LEX_STRING name;
 
58
  LEX_STRING definer;// combination of user and host
 
59
  LEX_STRING comment;
 
60
 
 
61
  Item* item_starts;
 
62
  Item* item_ends;
 
63
  Item* item_execute_at;
 
64
 
 
65
  my_time_t starts;
 
66
  my_time_t ends;
 
67
  my_time_t execute_at;
 
68
  my_bool starts_null;
 
69
  my_bool ends_null;
 
70
  my_bool execute_at_null;
 
71
 
 
72
  sp_name *identifier;
 
73
  Item* item_expression;
 
74
  longlong expression;
 
75
  interval_type interval;
 
76
 
 
77
  static Event_parse_data *
 
78
  new_instance(THD *thd);
 
79
 
 
80
  bool
 
81
  check_parse_data(THD *thd);
 
82
 
 
83
private:
 
84
 
 
85
  void
 
86
  init_definer(THD *thd);
 
87
 
 
88
  void
 
89
  init_name(THD *thd, sp_name *spn);
 
90
 
 
91
  int
 
92
  init_execute_at(THD *thd);
 
93
 
 
94
  int
 
95
  init_interval(THD *thd);
 
96
 
 
97
  int
 
98
  init_starts(THD *thd);
 
99
 
 
100
  int
 
101
  init_ends(THD *thd);
 
102
 
 
103
  Event_parse_data();
 
104
  ~Event_parse_data();
 
105
 
 
106
  void
 
107
  report_bad_value(const char *item_name, Item *bad_item);
 
108
 
 
109
  void
 
110
  check_if_in_the_past(THD *thd, my_time_t ltime_utc);
 
111
 
 
112
  Event_parse_data(const Event_parse_data &);   /* Prevent use of these */
 
113
  void check_originator_id(THD *thd);
 
114
  void operator=(Event_parse_data &);
 
115
};
 
116
#endif