MySQL 8.2.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, 2023, 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 also distributed 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 included with MySQL.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26*/
27
28#include "lex_string.h"
29#include "my_inttypes.h"
30#include "my_time_t.h" // my_time_t
31class Event_basic;
33class THD;
34
35namespace dd {
36class Schema;
37}
38
39/*
40 Fields in mysql.event table in 5.7. This enum is used to
41 read and update mysql.events dictionary table during upgrade
42 scenario.
43
44 Note: This enum should not be used for other purpose
45 as it will be removed eventually.
46*/
71};
72
73/**
74 @addtogroup Event_Scheduler
75 @{
76
77 @file event_db_repository.h
78
79 Data Dictionary related operations of Event Scheduler.
80
81 This is a private header file of Events module. Please do not include it
82 directly. All public declarations of Events module should be stored in
83 events.h and event_data_objects.h.
84*/
85
88
89 public:
90 static bool create_event(THD *thd, Event_parse_data *parse_data,
91 bool create_if_not, bool *event_already_exists);
92
93 static bool update_event(THD *thd, Event_parse_data *parse_data,
94 const LEX_CSTRING *new_dbname,
95 const LEX_CSTRING *new_name);
96
97 static bool drop_event(THD *thd, LEX_CSTRING db, LEX_CSTRING name,
98 bool drop_if_exists, bool *event_exists);
99
100 static bool drop_schema_events(THD *thd, const dd::Schema &schema);
101
102 static bool load_named_event(THD *thd, LEX_CSTRING dbname, LEX_CSTRING name,
103 Event_basic *et);
104
105 static bool update_timing_fields_for_event(THD *thd,
106 LEX_CSTRING event_db_name,
107 LEX_CSTRING event_name,
108 my_time_t last_executed,
110
111 // Disallow copy construction and assignment.
114};
115
116/**
117 @} (End of group Event_Scheduler)
118*/
119#endif /* _EVENT_DB_REPOSITORY_H_ */
Definition: event_data_objects.h:79
Definition: event_db_repository.h:86
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:35
Definition: schema.h:62
enum_events_table_field
Definition: event_db_repository.h:47
@ ET_FIELD_STARTS
Definition: event_db_repository.h:58
@ ET_FIELD_TIME_ZONE
Definition: event_db_repository.h:65
@ ET_FIELD_DB
Definition: event_db_repository.h:48
@ ET_FIELD_EXECUTE_AT
Definition: event_db_repository.h:52
@ ET_FIELD_COUNT
Definition: event_db_repository.h:70
@ ET_FIELD_TRANSIENT_INTERVAL
Definition: event_db_repository.h:54
@ ET_FIELD_LAST_EXECUTED
Definition: event_db_repository.h:57
@ ET_FIELD_BODY_UTF8
Definition: event_db_repository.h:69
@ ET_FIELD_STATUS
Definition: event_db_repository.h:60
@ ET_FIELD_CREATED
Definition: event_db_repository.h:55
@ ET_FIELD_BODY
Definition: event_db_repository.h:50
@ ET_FIELD_SQL_MODE
Definition: event_db_repository.h:62
@ ET_FIELD_DB_COLLATION
Definition: event_db_repository.h:68
@ ET_FIELD_MODIFIED
Definition: event_db_repository.h:56
@ ET_FIELD_CHARACTER_SET_CLIENT
Definition: event_db_repository.h:66
@ ET_FIELD_DEFINER
Definition: event_db_repository.h:51
@ ET_FIELD_ORIGINATOR
Definition: event_db_repository.h:64
@ ET_FIELD_NAME
Definition: event_db_repository.h:49
@ ET_FIELD_INTERVAL_EXPR
Definition: event_db_repository.h:53
@ ET_FIELD_ON_COMPLETION
Definition: event_db_repository.h:61
@ ET_FIELD_COLLATION_CONNECTION
Definition: event_db_repository.h:67
@ ET_FIELD_ENDS
Definition: event_db_repository.h:59
@ ET_FIELD_COMMENT
Definition: event_db_repository.h:63
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:205
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:121
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:294
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:326
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:69
static bool drop_schema_events(THD *thd, const dd::Schema &schema)
Drops all events in the selected database.
Definition: event_db_repository.cc:259
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
int64_t my_time_t
Portable time_t replacement.
Definition: my_time_t.h:31
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:42
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:60
case opt name
Definition: sslopt-case.h:32
Definition: mysql_lex_string.h:39