The world's most popular open source database
00001 #ifndef _EVENT_H_ 00002 #define _EVENT_H_ 00003 /* Copyright (C) 2004-2006 MySQL AB 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00018 00019 00020 class Event_timed; 00021 00022 class Events 00023 { 00024 public: 00025 static ulong opt_event_scheduler; 00026 static TYPELIB opt_typelib; 00027 00028 enum enum_table_field 00029 { 00030 FIELD_DB = 0, 00031 FIELD_NAME, 00032 FIELD_BODY, 00033 FIELD_DEFINER, 00034 FIELD_EXECUTE_AT, 00035 FIELD_INTERVAL_EXPR, 00036 FIELD_TRANSIENT_INTERVAL, 00037 FIELD_CREATED, 00038 FIELD_MODIFIED, 00039 FIELD_LAST_EXECUTED, 00040 FIELD_STARTS, 00041 FIELD_ENDS, 00042 FIELD_STATUS, 00043 FIELD_ON_COMPLETION, 00044 FIELD_SQL_MODE, 00045 FIELD_COMMENT, 00046 FIELD_COUNT /* a cool trick to count the number of fields :) */ 00047 }; 00048 00049 static int 00050 create_event(THD *thd, Event_timed *et, uint create_options, 00051 uint *rows_affected); 00052 00053 static int 00054 update_event(THD *thd, Event_timed *et, sp_name *new_name, 00055 uint *rows_affected); 00056 00057 static int 00058 drop_event(THD *thd, Event_timed *et, bool drop_if_exists, 00059 uint *rows_affected); 00060 00061 static int 00062 open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table); 00063 00064 static int 00065 show_create_event(THD *thd, sp_name *spn); 00066 00067 static int 00068 reconstruct_interval_expression(String *buf, interval_type interval, 00069 longlong expression); 00070 00071 static int 00072 drop_schema_events(THD *thd, char *db); 00073 00074 static int 00075 dump_internal_status(THD *thd); 00076 00077 static int 00078 init(); 00079 00080 static void 00081 shutdown(); 00082 00083 static void 00084 init_mutexes(); 00085 00086 static void 00087 destroy_mutexes(); 00088 00089 00090 private: 00091 /* Prevent use of these */ 00092 Events(const Events &); 00093 void operator=(Events &); 00094 }; 00095 00096 00097 #endif /* _EVENT_H_ */
1.4.7

