MySQL 9.1.0
Source Code Documentation
routines.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
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 DD_TABLES__ROUTINES_INCLUDED
25#define DD_TABLES__ROUTINES_INCLUDED
26
27#include <string>
28
30#include "sql/dd/impl/types/entity_object_table_impl.h" // dd::Dictionary_obj...
31#include "sql/dd/object_id.h"
32#include "sql/dd/string_type.h"
33#include "sql/dd/types/routine.h" // dd::Routine
34
35struct CHARSET_INFO;
36
37namespace dd {
38class Object_key;
39class Routine_name_key;
40
41namespace tables {
42
43///////////////////////////////////////////////////////////////////////////
44
46 public:
47 static const Routines &instance();
48
49 static const CHARSET_INFO *name_collation();
50
81 NUMBER_OF_FIELDS // Always keep this entry at the end of the enum
82 };
83
85 INDEX_PK_ID = static_cast<uint>(Common_index::PK_ID),
92 };
93
100 };
101
102 Routines();
103
104 Routine *create_entity_object(const Raw_record &) const override;
105
106 static bool update_object_key(Routine_name_key *key, Object_id schema_id,
108 const String_type &routine_name);
109
111
112 /**
113 Create a key to find all routines for a given definer.
114
115 @param definer Name of the definer.
116
117 @returns Pointer to Object_key.
118 */
119 static Object_key *create_key_by_definer(const String_type &definer);
120};
121
122///////////////////////////////////////////////////////////////////////////
123
124} // namespace tables
125} // namespace dd
126
127#endif // DD_TABLES__ROUTINES_INCLUDED
Definition: entity_object_table_impl.h:46
Definition: object_key.h:38
Definition: raw_record.h:46
Definition: object_keys.h:434
Abstract base class for functions and procedures.
Definition: routine.h:61
enum_routine_type
Definition: routine.h:88
Definition: routines.h:45
Routines()
Definition: routines.cc:54
static const CHARSET_INFO * name_collation()
Definition: routines.cc:48
static Object_key * create_key_by_schema_id(Object_id schema_id)
Definition: routines.cc:203
static const Routines & instance()
Definition: routines.cc:41
enum_indexes
Definition: routines.h:84
@ INDEX_UK_SCHEMA_ID_TYPE_NAME
Definition: routines.h:86
@ INDEX_K_SCHEMA_COLLATION_ID
Definition: routines.h:90
@ INDEX_K_RESULT_COLLATION_ID
Definition: routines.h:87
@ INDEX_K_DEFINER
Definition: routines.h:91
@ INDEX_K_CLIENT_COLLATION_ID
Definition: routines.h:88
@ INDEX_PK_ID
Definition: routines.h:85
@ INDEX_K_CONNECTION_COLLATION_ID
Definition: routines.h:89
Routine * create_entity_object(const Raw_record &) const override
Definition: routines.cc:180
static Object_key * create_key_by_definer(const String_type &definer)
Create a key to find all routines for a given definer.
Definition: routines.cc:210
enum_fields
Definition: routines.h:51
@ FIELD_SCHEMA_COLLATION_ID
Definition: routines.h:75
@ FIELD_SQL_DATA_ACCESS
Definition: routines.h:69
@ FIELD_PARAMETER_STR
Definition: routines.h:67
@ FIELD_CREATED
Definition: routines.h:76
@ FIELD_RESULT_IS_ZEROFILL
Definition: routines.h:58
@ FIELD_RESULT_DATA_TYPE
Definition: routines.h:56
@ FIELD_DEFINITION_UTF8
Definition: routines.h:66
@ FIELD_LAST_ALTERED
Definition: routines.h:77
@ FIELD_ID
Definition: routines.h:52
@ FIELD_RESULT_NUMERIC_PRECISION
Definition: routines.h:61
@ FIELD_SECURITY_TYPE
Definition: routines.h:70
@ FIELD_RESULT_NUMERIC_SCALE
Definition: routines.h:62
@ FIELD_RESULT_CHAR_LENGTH
Definition: routines.h:60
@ FIELD_SCHEMA_ID
Definition: routines.h:53
@ FIELD_CLIENT_COLLATION_ID
Definition: routines.h:73
@ FIELD_RESULT_IS_UNSIGNED
Definition: routines.h:59
@ NUMBER_OF_FIELDS
Definition: routines.h:81
@ FIELD_EXTERNAL_LANGUAGE
Definition: routines.h:80
@ FIELD_DEFINER
Definition: routines.h:71
@ FIELD_CONNECTION_COLLATION_ID
Definition: routines.h:74
@ FIELD_COMMENT
Definition: routines.h:78
@ FIELD_RESULT_DATETIME_PRECISION
Definition: routines.h:63
@ FIELD_SQL_MODE
Definition: routines.h:72
@ FIELD_RESULT_COLLATION_ID
Definition: routines.h:64
@ FIELD_RESULT_DATA_TYPE_UTF8
Definition: routines.h:57
@ FIELD_OPTIONS
Definition: routines.h:79
@ FIELD_DEFINITION
Definition: routines.h:65
@ FIELD_IS_DETERMINISTIC
Definition: routines.h:68
@ FIELD_NAME
Definition: routines.h:54
@ FIELD_TYPE
Definition: routines.h:55
enum_foreign_keys
Definition: routines.h:94
@ FK_RESULT_COLLATION_ID
Definition: routines.h:96
@ FK_CONNECTION_COLLATION_ID
Definition: routines.h:98
@ FK_CLIENT_COLLATION_ID
Definition: routines.h:97
@ FK_SCHEMA_ID
Definition: routines.h:95
@ FK_SCHEMA_COLLATION_ID
Definition: routines.h:99
static bool update_object_key(Routine_name_key *key, Object_id schema_id, Routine::enum_routine_type type, const String_type &routine_name)
Definition: routines.cc:192
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required string type
Definition: replication_group_member_actions.proto:34
Definition: m_ctype.h:421