1 /* Copyright (c) 2010, 2021, 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 #include "rpl_info_values.h"
24
25 #include "sql_string.h" // String
26
27
Rpl_info_values(int param_ninfo)28 Rpl_info_values::Rpl_info_values(int param_ninfo): value(0),
29 ninfo(param_ninfo) { }
30
31 /**
32 Initializes a sequence of values to be read from or stored into a repository.
33 The number of values created and initialized are determined by the property
34 @c ninfo which is set while calling the constructor. Each value is created
35 with the default size of @c FN_REFLEN.
36
37 @retval FALSE No error
38 @retval TRUE Failure
39 */
init()40 bool Rpl_info_values::init()
41 {
42 DBUG_ENTER("Rpl_info_values::init");
43
44 if (!value && !(value= new String[ninfo]))
45 DBUG_RETURN(TRUE);
46
47 DBUG_RETURN(FALSE);
48 }
49
~Rpl_info_values()50 Rpl_info_values::~Rpl_info_values()
51 {
52 delete [] value;
53 }
54