MySQL  8.0.18
Source Code Documentation
sdi_utils.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
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 SDI_UTILS_INCLUDED
24 #define SDI_UTILS_INCLUDED
25 
26 #include <stddef.h>
27 
28 #include "my_inttypes.h"
29 
30 /**
31  This function retrieves serialized meta data from the data dictionary
32  for the given schema and table. The serialized meta data may be used
33  for various purposes, such as writing it to a file, shipping it to
34  other processes, etc.
35 
36  @param[in] schema_name Name of the schema
37  @param[in] table_name Name of the table
38  @param[out] meta_data The serialized meta data of the table
39  @param[out] meta_data_length The size of the meta data blob
40 
41  @retval false Success
42  @retval true Error, e.g. the table was not found in the data dictionary.
43  In this case, the values of 'meta_data_length' and
44  'meta_data' are not defined.
45 */
46 
47 bool create_serialized_meta_data(const char *schema_name,
48  const char *table_name, uchar **meta_data,
49  size_t *meta_data_length);
50 
51 /**
52  This function takes the submitted serialized meta data, de-serializes
53  and analyzes it, and merges it into the data dictionary.
54 
55  @param[in] meta_data The serialized meta data
56  @param[in] meta_data_length The size of the meta data blob
57  @param[in] readonly Disallow conflict resolution affecting the
58  imported meta data
59 
60  @retval false Success
61  @retval true Error, e.g. a conflict was detected while 'readonly' is
62  set to 'true'.
63 */
64 
66  size_t meta_data_length, bool readonly);
67 
68 /**
69  This function takes the two submitted serialized meta data blobs,
70  and compares them.
71 
72  @param[in] a_meta_data First serialized meta data blob
73  @param[in] a_meta_data_length Size of the first meta data blob
74  @param[in] b_meta_data Second serialized meta data blob
75  @param[in] b_meta_data_length Size of the second meta data blob
76 
77  @retval false The two blobs are identical
78  @retval true The two blobs are different
79 */
80 
81 bool different_serialized_meta_data(const uchar *a_meta_data,
82  size_t a_meta_data_length,
83  const uchar *b_meta_data,
84  size_t b_meta_data_length);
85 
86 #endif /* SDI_UTILS_INCLUDED */
bool different_serialized_meta_data(const uchar *a_meta_data, size_t a_meta_data_length, const uchar *b_meta_data, size_t b_meta_data_length)
This function takes the two submitted serialized meta data blobs, and compares them.
Definition: sdi_utils.cc:73
unsigned char uchar
Definition: my_inttypes.h:51
Some integer typedefs for easier portability.
std::shared_ptr< MetaData > meta_data
Definition: metadata_factory.cc:28
bool import_serialized_meta_data(const uchar *meta_data, size_t meta_data_length, bool readonly)
This function takes the submitted serialized meta data, de-serializes and analyzes it...
Definition: sdi_utils.cc:63
bool create_serialized_meta_data(const char *schema_name, const char *table_name, uchar **meta_data, size_t *meta_data_length)
This function retrieves serialized meta data from the data dictionary for the given schema and table...
Definition: sdi_utils.cc:32
const char * table_name
Definition: rules_table_service.cc:55