MySQL 8.3.0
Source Code Documentation
trigger.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, Oracle and/or its affiliates.
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, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef DD__TRIGGER_INCLUDED
24#define DD__TRIGGER_INCLUDED
25
26#include <time.h>
27
28#ifdef _WIN32
29#include <winsock2.h> // timeval
30#endif
31
32#include "my_inttypes.h"
33#include "my_time_t.h"
34#include "sql/dd/sdi_fwd.h" // dd::Sdi_wcontext
35#include "sql/dd/types/entity_object.h" // dd::Entity_object
36
37struct MDL_key;
38struct CHARSET_INFO;
39
40namespace dd {
41
42///////////////////////////////////////////////////////////////////////////
43
44class Trigger_impl;
45
46namespace tables {
47class Triggers;
48}
49
50///////////////////////////////////////////////////////////////////////////
51
52/// Class representing a Trigger in DD framework.
53class Trigger : virtual public Entity_object {
54 public:
57
58 public:
60
62
63 public:
64 ~Trigger() override = default;
65
66 /////////////////////////////////////////////////////////////////////////
67 // schema.
68 /////////////////////////////////////////////////////////////////////////
69
70 virtual Object_id schema_id() const = 0;
71
72 /////////////////////////////////////////////////////////////////////////
73 // table.
74 /////////////////////////////////////////////////////////////////////////
75
76 virtual Object_id table_id() const = 0;
77
78 /////////////////////////////////////////////////////////////////////////
79 // Trigger type.
80 /////////////////////////////////////////////////////////////////////////
81
82 virtual enum_event_type event_type() const = 0;
84
85 /////////////////////////////////////////////////////////////////////////
86 // action_timing.
87 /////////////////////////////////////////////////////////////////////////
88
89 virtual enum_action_timing action_timing() const = 0;
91
92 /////////////////////////////////////////////////////////////////////////
93 // action_order.
94 /////////////////////////////////////////////////////////////////////////
95
96 virtual uint action_order() const = 0;
97 virtual void set_action_order(uint action_order) = 0;
98
99 /////////////////////////////////////////////////////////////////////////
100 // action_statement
101 /////////////////////////////////////////////////////////////////////////
102
103 virtual const String_type &action_statement() const = 0;
105
106 virtual const String_type &action_statement_utf8() const = 0;
109
110 /////////////////////////////////////////////////////////////////////////
111 // created.
112 /////////////////////////////////////////////////////////////////////////
113
114 virtual my_timeval created() const = 0;
115 virtual void set_created(my_timeval created) = 0;
116
117 /////////////////////////////////////////////////////////////////////////
118 // last altered.
119 /////////////////////////////////////////////////////////////////////////
120
121 virtual my_timeval last_altered() const = 0;
123
124 /////////////////////////////////////////////////////////////////////////
125 // sql_mode
126 /////////////////////////////////////////////////////////////////////////
127
128 virtual ulonglong sql_mode() const = 0;
129 virtual void set_sql_mode(ulonglong sql_mode) = 0;
130
131 /////////////////////////////////////////////////////////////////////////
132 // definer.
133 /////////////////////////////////////////////////////////////////////////
134
135 virtual const String_type &definer_user() const = 0;
136 virtual const String_type &definer_host() const = 0;
137 virtual void set_definer(const String_type &username,
138 const String_type &hostname) = 0;
139
140 /////////////////////////////////////////////////////////////////////////
141 // collations.
142 /////////////////////////////////////////////////////////////////////////
143
144 virtual Object_id client_collation_id() const = 0;
146
150
151 virtual Object_id schema_collation_id() const = 0;
153
154 static void create_mdl_key(const String_type &schema_name,
155 const String_type &name, MDL_key *key);
156 static const CHARSET_INFO *name_collation();
157};
158
159///////////////////////////////////////////////////////////////////////////
160
161} // namespace dd
162
163#endif // DD__TRIGGER_INCLUDED
Base class for dictionary objects which has single column integer primary key.
Definition: entity_object.h:47
virtual const String_type & name() const =0
Definition: trigger_impl.h:53
Class representing a Trigger in DD framework.
Definition: trigger.h:53
virtual uint action_order() const =0
enum_event_type
Definition: trigger.h:59
virtual void set_last_altered(my_timeval last_altered)=0
virtual void set_action_statement(const String_type &action_statement)=0
virtual void set_schema_collation_id(Object_id schema_collation_id)=0
virtual void set_created(my_timeval created)=0
virtual void set_action_order(uint action_order)=0
virtual Object_id schema_collation_id() const =0
tables::Triggers DD_table
Definition: trigger.h:56
virtual void set_connection_collation_id(Object_id connection_collation_id)=0
static void create_mdl_key(const String_type &schema_name, const String_type &name, MDL_key *key)
Definition: trigger_impl.cc:237
~Trigger() override=default
Trigger_impl Impl
Definition: trigger.h:55
virtual Object_id connection_collation_id() const =0
virtual void set_sql_mode(ulonglong sql_mode)=0
static const CHARSET_INFO * name_collation()
Definition: trigger_impl.cc:260
virtual void set_event_type(enum_event_type event_type)=0
virtual void set_definer(const String_type &username, const String_type &hostname)=0
virtual const String_type & definer_host() const =0
virtual Object_id client_collation_id() const =0
virtual void set_client_collation_id(Object_id client_collation_id)=0
virtual my_timeval created() const =0
virtual Object_id schema_id() const =0
virtual ulonglong sql_mode() const =0
virtual enum_action_timing action_timing() const =0
virtual const String_type & action_statement() const =0
virtual const String_type & action_statement_utf8() const =0
virtual my_timeval last_altered() const =0
virtual void set_action_timing(enum_action_timing type)=0
virtual void set_action_statement_utf8(const String_type &action_statement_utf8)=0
enum_action_timing
Definition: trigger.h:61
virtual enum_event_type event_type() const =0
virtual const String_type & definer_user() const =0
virtual Object_id table_id() const =0
Definition: triggers.h:48
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
unsigned long long Object_id
Definition: object_id.h:30
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
required string key
Definition: replication_asynchronous_connection_failover.proto:59
required string type
Definition: replication_group_member_actions.proto:33
This header provides Rapidjson Type Aliases.
Definition: m_ctype.h:422
Metadata lock object key.
Definition: mdl.h:364
Replacement of system's struct timeval to ensure we can carry 64 bit values even on a platform which ...
Definition: my_time_t.h:44
Include file for Sun RPC to compile out of the box.