MySQL 9.0.0
Source Code Documentation
event_db_repository.h
Go to the documentation of this file.
1#ifndef _EVENT_DB_REPOSITORY_H_
2#define _EVENT_DB_REPOSITORY_H_
3
4/*
5 Copyright (c) 2006, 2024, Oracle and/or its affiliates.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License, version 2.0,
9 as published by the Free Software Foundation.
10
11 This program is designed to work with certain software (including
12 but not limited to OpenSSL) that is licensed under separate terms,
13 as designated in a particular file or component or in included license
14 documentation. The authors of MySQL hereby grant you an additional
15 permission to link the program and your derivative works with the
16 separately licensed software that they have either included with
17 the program or referenced in the documentation.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License, version 2.0, for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27*/
28
29#include "lex_string.h"
30#include "my_inttypes.h"
31#include "my_time_t.h" // my_time_t
32class Event_basic;
34class THD;
35
36namespace dd {
37class Schema;
38}
39
40/*
41 Fields in mysql.event table in 5.7. This enum is used to
42 read and update mysql.events dictionary table during upgrade
43 scenario.
44
45 Note: This enum should not be used for other purpose
46 as it will be removed eventually.
47*/
72};
73
74/**
75 @addtogroup Event_Scheduler
76 @{
77
78 @file event_db_repository.h
79
80 Data Dictionary related operations of Event Scheduler.
81
82 This is a private header file of Events module. Please do not include it
83 directly. All public declarations of Events module should be stored in
84 events.h and event_data_objects.h.
85*/
86
89
90 public:
91 static bool create_event(THD *thd, Event_parse_data *parse_data,
92 bool create_if_not, bool *event_already_exists);
93
94 static bool update_event(THD *thd, Event_parse_data *parse_data,
95 const LEX_CSTRING *new_dbname,
96 const LEX_CSTRING *new_name);
97
98 static bool drop_event(THD *thd, LEX_CSTRING db, LEX_CSTRING name,
99 bool drop_if_exists, bool *event_exists);
100
101 static bool drop_schema_events(THD *thd, const dd::Schema &schema);
102
103 static bool load_named_event(THD *thd, LEX_CSTRING dbname, LEX_CSTRING name,
104 Event_basic *et);
105
106 static bool update_timing_fields_for_event(THD *thd,
107 LEX_CSTRING event_db_name,
108 LEX_CSTRING event_name,
109 my_time_t last_executed,
111
112 // Disallow copy construction and assignment.
115};
116
117/**
118 @} (End of group Event_Scheduler)
119*/
120#endif /* _EVENT_DB_REPOSITORY_H_ */
Definition: event_data_objects.h:80
Definition: event_db_repository.h:87
Event_db_repository(const Event_db_repository &)=delete
Event_db_repository()=default
void operator=(Event_db_repository &)=delete
Definition: event_parse_data.h:43
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: schema.h:63
enum_events_table_field
Definition: event_db_repository.h:48
@ ET_FIELD_STARTS
Definition: event_db_repository.h:59
@ ET_FIELD_TIME_ZONE
Definition: event_db_repository.h:66
@ ET_FIELD_DB
Definition: event_db_repository.h:49
@ ET_FIELD_EXECUTE_AT
Definition: event_db_repository.h:53
@ ET_FIELD_COUNT
Definition: event_db_repository.h:71
@ ET_FIELD_TRANSIENT_INTERVAL
Definition: event_db_repository.h:55
@ ET_FIELD_LAST_EXECUTED
Definition: event_db_repository.h:58
@ ET_FIELD_BODY_UTF8
Definition: event_db_repository.h:70
@ ET_FIELD_STATUS
Definition: event_db_repository.h:61
@ ET_FIELD_CREATED
Definition: event_db_repository.h:56
@ ET_FIELD_BODY
Definition: event_db_repository.h:51
@ ET_FIELD_SQL_MODE
Definition: event_db_repository.h:63
@ ET_FIELD_DB_COLLATION
Definition: event_db_repository.h:69
@ ET_FIELD_MODIFIED
Definition: event_db_repository.h:57
@ ET_FIELD_CHARACTER_SET_CLIENT
Definition: event_db_repository.h:67
@ ET_FIELD_DEFINER
Definition: event_db_repository.h:52
@ ET_FIELD_ORIGINATOR
Definition: event_db_repository.h:65
@ ET_FIELD_NAME
Definition: event_db_repository.h:50
@ ET_FIELD_INTERVAL_EXPR
Definition: event_db_repository.h:54
@ ET_FIELD_ON_COMPLETION
Definition: event_db_repository.h:62
@ ET_FIELD_COLLATION_CONNECTION
Definition: event_db_repository.h:68
@ ET_FIELD_ENDS
Definition: event_db_repository.h:60
@ ET_FIELD_COMMENT
Definition: event_db_repository.h:64
static bool drop_event(THD *thd, LEX_CSTRING db, LEX_CSTRING name, bool drop_if_exists, bool *event_exists)
Delete event.
Definition: event_db_repository.cc:212
static bool update_event(THD *thd, Event_parse_data *parse_data, const LEX_CSTRING *new_dbname, const LEX_CSTRING *new_name)
Used to execute ALTER EVENT.
Definition: event_db_repository.cc:123
static bool load_named_event(THD *thd, LEX_CSTRING dbname, LEX_CSTRING name, Event_basic *et)
Looks for a named event in the Data Dictionary and load it.
Definition: event_db_repository.cc:301
static bool update_timing_fields_for_event(THD *thd, LEX_CSTRING event_db_name, LEX_CSTRING event_name, my_time_t last_executed, ulonglong status)
Update the event in Data Dictionary with changed status and/or last execution time.
Definition: event_db_repository.cc:333
static bool create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not, bool *event_already_exists)
Creates an event object and persist to Data Dictionary.
Definition: event_db_repository.cc:70
static bool drop_schema_events(THD *thd, const dd::Schema &schema)
Drops all events in the selected database.
Definition: event_db_repository.cc:266
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
int64_t my_time_t
Portable time_t replacement.
Definition: my_time_t.h:32
borrowable::session_track::Schema< true > Schema
Definition: classic_protocol_session_track.h:288
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
case opt name
Definition: sslopt-case.h:29
Definition: mysql_lex_string.h:40