Skip to content

Commit 0f2c3fa

Browse files
author
Pedro Figueiredo
committed
WL#12966 Replication with Restricted Privileges
[ post-push ] Description ----------- Clang issues were found on PB2, regarding a parameter shadowing a class member, `Rpl_info_handler::nullable_fields`. Fix --- Rename occurrences of the same-name parameter. Reviewed-by: Pedro Gomes <pedro.gomes@oracle.com> Reviewed-by: Abhinav Agarwal <abhinav.ab.agarwal@oracle.com>
1 parent 66b578a commit 0f2c3fa

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

sql/rpl_info_file.cc

+9-6
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ long init_dynarray_intvar_from_file(char *buffer, size_t size,
5858

5959
Rpl_info_file::Rpl_info_file(const int nparam, const char *param_pattern_fname,
6060
const char *param_info_fname, bool indexed_arg,
61-
MY_BITMAP const *nullable_fields)
62-
: Rpl_info_handler(nparam, nullable_fields),
61+
MY_BITMAP const *nullable_bitmap)
62+
: Rpl_info_handler(nparam, nullable_bitmap),
6363
info_fd(-1),
6464
name_indexed(indexed_arg) {
6565
DBUG_TRACE;
@@ -202,6 +202,9 @@ enum_return_check Rpl_info_file::do_check_info() {
202202
the actual file name
203203
@param indexed indicates whether the file is indexed and if so
204204
there is a range to count in.
205+
@param[in] nullable_bitmap
206+
bitmap that holds the fields that are allowed to be
207+
`NULL`.
205208
@param[out] counter the number of discovered instances before the first
206209
unsuccess in locating the next file.
207210
@@ -210,7 +213,7 @@ enum_return_check Rpl_info_file::do_check_info() {
210213
*/
211214
bool Rpl_info_file::do_count_info(const int nparam, const char *param_pattern,
212215
bool indexed,
213-
MY_BITMAP const *nullable_fields,
216+
MY_BITMAP const *nullable_bitmap,
214217
uint *counter) {
215218
uint i = 0;
216219
Rpl_info_file *info = nullptr;
@@ -222,7 +225,7 @@ bool Rpl_info_file::do_count_info(const int nparam, const char *param_pattern,
222225
DBUG_TRACE;
223226

224227
if (!(info = new Rpl_info_file(nparam, param_pattern, "", indexed,
225-
nullable_fields)))
228+
nullable_bitmap)))
226229
return true;
227230

228231
for (i = 1; last_check == REPOSITORY_EXISTS; i++) {
@@ -289,7 +292,7 @@ int Rpl_info_file::do_clean_info() {
289292

290293
int Rpl_info_file::do_reset_info(const int nparam, const char *param_pattern,
291294
bool indexed,
292-
MY_BITMAP const *nullable_fields) {
295+
MY_BITMAP const *nullable_bitmap) {
293296
int error = false;
294297
uint i = 0;
295298
Rpl_info_file *info = nullptr;
@@ -300,7 +303,7 @@ int Rpl_info_file::do_reset_info(const int nparam, const char *param_pattern,
300303
DBUG_TRACE;
301304

302305
if (!(info = new Rpl_info_file(nparam, param_pattern, "", indexed,
303-
nullable_fields)))
306+
nullable_bitmap)))
304307
return true;
305308

306309
for (i = 1; last_check == REPOSITORY_EXISTS; i++) {

sql/rpl_info_file.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ class Rpl_info_file : public Rpl_info_handler {
9090
@param[in] param_pattern_fname File's name.
9191
@param[in] indexed indicates whether the file is indexed and
9292
if so there is a range to count in.
93-
@param[in] nullable_fields bitmap that holds the fields that are
94-
allowed to be `NULL`-
93+
@param[in] nullable_bitmap bitmap that holds the fields that are
94+
allowed to be `NULL`.
9595
@param[out] counter Number of files found.
9696
9797
@retval false Success
9898
@retval true Error
9999
*/
100100
static bool do_count_info(const int nparam, const char *param_pattern_fname,
101-
bool indexed, MY_BITMAP const *nullable_fields,
101+
bool indexed, MY_BITMAP const *nullable_bitmap,
102102
uint *counter);
103103
static int do_reset_info(int const nparam, const char *param_pattern_fname,
104-
bool name_indexed, MY_BITMAP const *nullable_fields);
104+
bool name_indexed, MY_BITMAP const *nullable_bitmap);
105105

106106
int do_prepare_info_for_read();
107107
int do_prepare_info_for_write();
@@ -167,7 +167,7 @@ class Rpl_info_file : public Rpl_info_handler {
167167

168168
Rpl_info_file(int const nparam, const char *param_pattern_fname,
169169
const char *param_info_fname, bool name_indexed,
170-
MY_BITMAP const *nullable_fields);
170+
MY_BITMAP const *nullable_bitmap);
171171

172172
Rpl_info_file(const Rpl_info_file &info);
173173
Rpl_info_file &operator=(const Rpl_info_file &info);

sql/rpl_info_handler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class Rpl_info_handler {
387387
*/
388388
MY_BITMAP nullable_fields;
389389

390-
Rpl_info_handler(const int nparam, MY_BITMAP const *nullable_fields);
390+
Rpl_info_handler(const int nparam, MY_BITMAP const *nullable_bitmap);
391391

392392
/**
393393
Checks whether or not the field at position `pos` is allowed to be `NULL`.

sql/rpl_info_table.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Rpl_info_table::Rpl_info_table(uint nparam, const char *param_schema,
5757
const char *param_table,
5858
const uint param_n_pk_fields,
5959
const uint *param_pk_field_indexes,
60-
MY_BITMAP const *nullable_fields)
61-
: Rpl_info_handler(nparam, nullable_fields), is_transactional(false) {
60+
MY_BITMAP const *nullable_bitmap)
61+
: Rpl_info_handler(nparam, nullable_bitmap), is_transactional(false) {
6262
str_schema.str = str_table.str = nullptr;
6363
str_schema.length = str_table.length = 0;
6464

@@ -327,15 +327,15 @@ int Rpl_info_table::do_clean_info() {
327327
@param param_schema schema name
328328
@param param_table table name
329329
@param channel_name channel name
330-
@param nullable_fields fields allowed to be null.
330+
@param nullable_bitmap fields allowed to be null.
331331
332332
@return 0 on success
333333
1 when a failure happens
334334
*/
335335
int Rpl_info_table::do_reset_info(uint nparam, const char *param_schema,
336336
const char *param_table,
337337
const char *channel_name,
338-
MY_BITMAP const *nullable_fields) {
338+
MY_BITMAP const *nullable_bitmap) {
339339
int error = 0;
340340
TABLE *table = nullptr;
341341
sql_mode_t saved_mode;
@@ -347,7 +347,7 @@ int Rpl_info_table::do_reset_info(uint nparam, const char *param_schema,
347347
DBUG_TRACE;
348348

349349
if (!(info = new Rpl_info_table(nparam, param_schema, param_table, 0, nullptr,
350-
nullable_fields)))
350+
nullable_bitmap)))
351351
return 1;
352352

353353
thd = info->access->create_thd();
@@ -526,7 +526,7 @@ enum_return_check Rpl_info_table::do_check_info(uint instance) {
526526

527527
bool Rpl_info_table::do_count_info(uint nparam, const char *param_schema,
528528
const char *param_table,
529-
MY_BITMAP const *nullable_fields,
529+
MY_BITMAP const *nullable_bitmap,
530530
uint *counter) {
531531
int error = 1;
532532
TABLE *table = nullptr;
@@ -538,7 +538,7 @@ bool Rpl_info_table::do_count_info(uint nparam, const char *param_schema,
538538
DBUG_TRACE;
539539

540540
if (!(info = new Rpl_info_table(nparam, param_schema, param_table, 0, nullptr,
541-
nullable_fields)))
541+
nullable_bitmap)))
542542
return true;
543543

544544
thd = info->access->create_thd();

sql/rpl_info_table.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Rpl_info_table : public Rpl_info_handler {
109109
@param[in] nparam Number of fields in the table.
110110
@param[in] param_schema Table's schema.
111111
@param[in] param_table Table's name.
112-
@param[in] nullable_fields bitmap that holds the fields that are
112+
@param[in] nullable_bitmap bitmap that holds the fields that are
113113
allowed to be `NULL`-
114114
@param[out] counter Number of entries found.
115115
@@ -118,10 +118,10 @@ class Rpl_info_table : public Rpl_info_handler {
118118
*/
119119
static bool do_count_info(uint nparam, const char *param_schema,
120120
const char *param_table,
121-
MY_BITMAP const *nullable_fields, uint *counter);
121+
MY_BITMAP const *nullable_bitmap, uint *counter);
122122
static int do_reset_info(uint nparam, const char *param_schema,
123123
const char *param_table, const char *channel_name,
124-
MY_BITMAP const *nullable_fields);
124+
MY_BITMAP const *nullable_bitmap);
125125
int do_prepare_info_for_read();
126126
int do_prepare_info_for_write();
127127

@@ -184,7 +184,7 @@ class Rpl_info_table : public Rpl_info_handler {
184184
Rpl_info_table(uint nparam, const char *param_schema, const char *param_table,
185185
const uint param_n_pk_fields = 0,
186186
const uint *param_pk_field_indexes = nullptr,
187-
MY_BITMAP const *nullable_fields = nullptr);
187+
MY_BITMAP const *nullable_bitmap = nullptr);
188188

189189
Rpl_info_table(const Rpl_info_table &info);
190190
Rpl_info_table &operator=(const Rpl_info_table &info);

0 commit comments

Comments
 (0)