MySQL 8.0.39
Source Code Documentation
check_constraints.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 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__CHECK_CONSTRAINTS_INCLUDED
25#define DD_TABLES__CHECK_CONSTRAINTS_INCLUDED
26
27#include "sql/dd/impl/types/object_table_impl.h" // dd::Object_table_impl
28#include "sql/dd/object_id.h" // dd::Object_id
29
30namespace dd {
31class Object_key;
32
33namespace tables {
34
35///////////////////////////////////////////////////////////////////////////
36
37// The Check_constraints table has one row for each check constraint.
38class Check_constraints : virtual public Object_table_impl {
39 public:
40 static const Check_constraints &instance();
41
42 static const CHARSET_INFO *name_collation();
43
52 NUMBER_OF_FIELDS // Always keep this entry at the end of the enum
53 };
54
59 };
60
62
64
66
68 Object_id schema_id, const String_type &check_cons_name);
69
70 /**
71 Check if schema contains check constraints with specified name.
72
73 @param thd Thread context.
74 @param schema_id Id of schema to be inspected.
75 @param check_cons_name Name of the check constraint.
76 @param[out] exists Set to true if check constraint
77 the the name provided exists in
78 the schema, false otherwise.
79
80 @retval false No error.
81 @retval true Error.
82 */
83
84 static bool check_constraint_exists(THD *thd, Object_id schema_id,
85 const String_type &check_cons_name,
86 bool *exists);
87};
88
89///////////////////////////////////////////////////////////////////////////
90
91} // namespace tables
92} // namespace dd
93
94#endif // DD_TABLES__CHECK_CONSTRAINTS_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Definition: object_key.h:38
Definition: object_table_impl.h:36
Definition: check_constraints.h:38
Check_constraints()
Definition: check_constraints.cc:52
static Object_key * create_key_by_table_id(Object_id table_id)
Definition: check_constraints.cc:87
static bool check_constraint_exists(THD *thd, Object_id schema_id, const String_type &check_cons_name, bool *exists)
Check if schema contains check constraints with specified name.
Definition: check_constraints.cc:103
static Object_key * create_key_by_check_constraint_name(Object_id schema_id, const String_type &check_cons_name)
Definition: check_constraints.cc:94
enum_foreign_keys
Definition: check_constraints.h:61
@ FK_SCHEMA_ID
Definition: check_constraints.h:61
@ FK_TABLE_ID
Definition: check_constraints.h:61
enum_fields
Definition: check_constraints.h:44
@ FIELD_SCHEMA_ID
Definition: check_constraints.h:46
@ FIELD_NAME
Definition: check_constraints.h:48
@ FIELD_CHECK_CLAUSE
Definition: check_constraints.h:50
@ FIELD_CHECK_CLAUSE_UTF8
Definition: check_constraints.h:51
@ FIELD_TABLE_ID
Definition: check_constraints.h:47
@ FIELD_ID
Definition: check_constraints.h:45
@ NUMBER_OF_FIELDS
Definition: check_constraints.h:52
@ FIELD_ENFORCED
Definition: check_constraints.h:49
static const Check_constraints & instance()
Definition: check_constraints.cc:39
static const CHARSET_INFO * name_collation()
Definition: check_constraints.cc:46
enum_indexes
Definition: check_constraints.h:55
@ INDEX_UK_SCHEMA_ID_NAME
Definition: check_constraints.h:57
@ INDEX_PK_ID
Definition: check_constraints.h:56
@ INDEX_UK_TABLE_ID_NAME
Definition: check_constraints.h:58
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
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106
Definition: m_ctype.h:385
unsigned int uint
Definition: uca9-dump.cc:75