MySQL  8.0.19
Source Code Documentation
trigger_creation_ctx.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License, version 2.0,
6  as published by the Free Software Foundation.
7 
8  This program is also distributed with certain software (including
9  but not limited to OpenSSL) that is licensed under separate terms,
10  as designated in a particular file or component or in included license
11  documentation. The authors of MySQL hereby grant you an additional
12  permission to link the program and your derivative works with the
13  separately licensed software that they have included with MySQL.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License, version 2.0, for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23 
24 #ifndef TRIGGER_CREATION_CTX_H_INCLUDED
25 #define TRIGGER_CREATION_CTX_H_INCLUDED
26 
27 ///////////////////////////////////////////////////////////////////////////
28 
29 #include "lex_string.h"
30 #include "sql/sp_head.h" // Stored_program_creation_ctx
31 
33 class THD;
34 struct CHARSET_INFO;
35 struct MEM_ROOT;
36 
37 /**
38  Trigger_creation_ctx -- creation context of triggers.
39 */
40 
42  public:
43  static Trigger_creation_ctx *create(THD *thd, const LEX_CSTRING &db_name,
44  const LEX_CSTRING &table_name,
45  const LEX_CSTRING &client_cs_name,
46  const LEX_CSTRING &connection_cl_name,
47  const LEX_CSTRING &db_cl_name);
48 
49  public:
51 
52  protected:
53  Object_creation_ctx *create_backup_ctx(THD *thd) const override;
54 
55  void delete_backup_ctx() override;
56 
57  private:
59 
61  const CHARSET_INFO *connection_cl,
62  const CHARSET_INFO *db_cl)
63  : Stored_program_creation_ctx(client_cs, connection_cl, db_cl) {}
64 };
65 
66 ///////////////////////////////////////////////////////////////////////////
67 
68 #endif // TRIGGER_CREATION_CTX_H_INCLUDED
MYSQL_LEX_CSTRING
Definition: mysql_lex_string.h:39
THD
Definition: sql_class.h:764
rules_table_service::table_name
const char * table_name
Definition: rules_table_service.cc:55
Trigger_creation_ctx::Trigger_creation_ctx
Trigger_creation_ctx(const CHARSET_INFO *client_cs, const CHARSET_INFO *connection_cl, const CHARSET_INFO *db_cl)
Definition: trigger_creation_ctx.h:60
CHARSET_INFO
Definition: m_ctype.h:354
mem_root
static MEM_ROOT mem_root
Definition: client_plugin.cc:109
Trigger_creation_ctx
Trigger_creation_ctx – creation context of triggers.
Definition: trigger_creation_ctx.h:41
Trigger_creation_ctx::delete_backup_ctx
void delete_backup_ctx() override
Definition: trigger_creation_ctx.cc:112
Object_creation_ctx
Object_creation_ctx – interface for creation context of database objects (views, stored routines,...
Definition: table.h:193
Trigger_creation_ctx::clone
Stored_program_creation_ctx * clone(MEM_ROOT *mem_root) override
Definition: trigger_creation_ctx.cc:103
Trigger_creation_ctx::create
static Trigger_creation_ctx * create(THD *thd, const LEX_CSTRING &db_name, const LEX_CSTRING &table_name, const LEX_CSTRING &client_cs_name, const LEX_CSTRING &connection_cl_name, const LEX_CSTRING &db_cl_name)
Definition: trigger_creation_ctx.cc:44
MEM_ROOT
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:77
lex_string.h
sp_head.h
Trigger_creation_ctx::create_backup_ctx
Object_creation_ctx * create_backup_ctx(THD *thd) const override
Definition: trigger_creation_ctx.cc:108
rules_table_service::db_name
const char * db_name
Definition: rules_table_service.cc:54
Trigger_creation_ctx::Trigger_creation_ctx
Trigger_creation_ctx(THD *thd)
Definition: trigger_creation_ctx.h:58
Stored_program_creation_ctx
Stored_program_creation_ctx – base class for creation context of stored programs (stored routines,...
Definition: sp_head.h:88