events_priv.h 2.39 KB
Newer Older
1 2 3
#ifndef _EVENT_PRIV_H_
#define _EVENT_PRIV_H_
/* Copyright (C) 2004-2006 MySQL AB
unknown's avatar
unknown committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

19 20 21 22
#define EVENT_EXEC_STARTED      0
#define EVENT_EXEC_ALREADY_EXEC 1
#define EVENT_EXEC_CANT_FORK    2

unknown's avatar
unknown committed
23 24
#define EVEX_DB_FIELD_LEN 64
#define EVEX_NAME_FIELD_LEN 64
25
#define EVEX_MAX_INTERVAL_VALUE 2147483647L
unknown's avatar
unknown committed
26

27
class Event_timed;
unknown's avatar
WL#1034  
unknown committed
28

unknown's avatar
WL#1034  
unknown committed
29
int
30 31 32
evex_db_find_event_by_name(THD *thd, const LEX_STRING dbname,
                          const LEX_STRING ev_name,
                          TABLE *table);
33

34 35 36 37
int
db_drop_event(THD *thd, Event_timed *et, bool drop_if_exists,
              uint *rows_affected);
int
38 39
db_find_event(THD *thd, sp_name *name, Event_timed **ett, TABLE *tbl,
              MEM_ROOT *root);
unknown's avatar
unknown committed
40

41 42 43
int
db_create_event(THD *thd, Event_timed *et, my_bool create_if_not,
                uint *rows_affected);
unknown's avatar
unknown committed
44

45 46
int
db_drop_events_from_table(THD *thd, LEX_STRING *db);
unknown's avatar
unknown committed
47

48 49
int
sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
unknown's avatar
unknown committed
50

51 52 53
/* Compares only the name part of the identifier */
bool
event_timed_name_equal(Event_timed *et, LEX_STRING *name);
unknown's avatar
unknown committed
54

55 56 57
/* Compares only the schema part of the identifier */
bool
event_timed_db_equal(Event_timed *et, LEX_STRING *db);
unknown's avatar
unknown committed
58

59 60 61 62 63 64
/*
  Compares only the definer part of the identifier. Use during DROP USER
  to drop user's events. (Still not implemented)
*/
bool
event_timed_definer_equal(Event_timed *et, LEX_STRING *definer);
unknown's avatar
unknown committed
65

66 67 68
/* Compares the whole identifier*/
bool
event_timed_identifier_equal(Event_timed *a, Event_timed *b);
unknown's avatar
unknown committed
69 70


71 72 73 74
bool
change_security_context(THD *thd, LEX_STRING user, LEX_STRING host,
                        LEX_STRING db, Security_context *s_ctx,
                        Security_context **backup);
unknown's avatar
unknown committed
75

76 77
void
restore_security_context(THD *thd, Security_context *backup);
unknown's avatar
unknown committed
78

unknown's avatar
unknown committed
79
#endif /* _EVENT_PRIV_H_ */