Skip to content

Commit e4e011d

Browse files
committed
Only allow retry function internally
Signed-off-by: Salil Chandra <schandra107@bloomberg.net>
1 parent 8acbd4e commit e4e011d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tools/cdb2sql/cdb2sql.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ static int show_effects = 0;
101101
static char doublefmt[32];
102102
static int docost = 0;
103103
static int return_long_column_names = 0;
104+
#ifdef COMDB2_TEST
104105
static int maxretries = 0;
105106
static int minretries = 0;
107+
#endif
106108
static FILE *redirect = NULL;
107109
static int hold_stdout = -1;
108110
static char *history_file = NULL;
@@ -1524,12 +1526,14 @@ static int run_statement_int(const char *sql, int ntypes, int *types,
15241526
*run_time = 0;
15251527

15261528
if (cdb2h == NULL) {
1529+
#ifdef COMDB2_TEST
15271530
if (maxretries) {
15281531
cdb2_set_max_retries(maxretries);
15291532
}
15301533
if (minretries) {
15311534
cdb2_set_min_retries(minretries);
15321535
}
1536+
#endif
15331537

15341538
verbose_print("calling cdb2_open\n");
15351539

@@ -2275,15 +2279,17 @@ int main(int argc, char *argv[])
22752279
{"admin", no_argument, &isadmin, 1},
22762280
{"help", no_argument, NULL, 'h'},
22772281
{"script", no_argument, NULL, 's'},
2282+
#ifdef COMDB2_TEST
22782283
{"maxretries", required_argument, NULL, 'r'},
2284+
{"minretries", required_argument, NULL, 'R'},
2285+
#endif
22792286
{"precision", required_argument, NULL, 'p'},
22802287
{"cdb2cfg", required_argument, NULL, 'c'},
22812288
{"file", required_argument, NULL, 'f'},
22822289
{"gensql", required_argument, NULL, 'g'},
22832290
{"delim", required_argument, NULL, 'd'},
22842291
{"type", required_argument, NULL, 't'},
22852292
{"host", required_argument, NULL, 'n'},
2286-
{"minretries", required_argument, NULL, 'R'},
22872293
{"connect-to-master", no_argument, NULL, 'm'},
22882294
{"multiline", no_argument, NULL, 'l'},
22892295
{"allow-incoherent", no_argument, NULL, 'i'},
@@ -2304,12 +2310,14 @@ int main(int argc, char *argv[])
23042310
setenv("CDB2_LOG_CALLS", "1", 1);
23052311
verbose = 1;
23062312
break;
2313+
#ifdef COMDB2_TEST
23072314
case 'r':
23082315
maxretries = atoi(optarg);
23092316
break;
23102317
case 'R':
23112318
minretries = atoi(optarg);
23122319
break;
2320+
#endif
23132321
case 'p':
23142322
precision = atoi(optarg);
23152323
break;

0 commit comments

Comments
 (0)