summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorSulabh Mahajan <sulabh.mahajan@mongodb.com>2016-08-30 21:45:24 +1000
committerKeith Bostic <keith.bostic@mongodb.com>2016-08-30 07:45:24 -0400
commit3dedd2205bdfdcae537172ab9c5a2228b983e808 (patch)
treee39f330247620206ee47f5a2c4c5e98798289242 /bench
parent13d1b2182f91c58569463e09f35cdadbe928ed68 (diff)
downloadmongo-3dedd2205bdfdcae537172ab9c5a2228b983e808.tar.gz
WT-2824 Fix double concating the config strings (#2990)
* WT-2824 Fix double concating the config strings * WT-2824 Fix code styling
Diffstat (limited to 'bench')
-rw-r--r--bench/wtperf/wtperf.c32
-rw-r--r--bench/wtperf/wtperf.h2
2 files changed, 19 insertions, 15 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index d3d54fff6e3..c689fca80f7 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -2329,7 +2329,7 @@ main(int argc, char *argv[])
if (cfg->verbose > 1 || user_cconfig != NULL ||
cfg->session_count_idle > 0 || cfg->compress_ext != NULL ||
cfg->async_config != NULL) {
- req_len = strlen(cfg->conn_config) + strlen(debug_cconfig) + 3;
+ req_len = strlen(debug_cconfig) + 3;
if (user_cconfig != NULL)
req_len += strlen(user_cconfig);
if (cfg->async_config != NULL)
@@ -2349,21 +2349,23 @@ main(int argc, char *argv[])
/*
* This is getting hard to parse.
*/
- snprintf(cc_buf, req_len, "%s%s%s%s%s%s%s%s",
- cfg->conn_config,
+ snprintf(cc_buf, req_len, "%s%s%s%s%s%s%s",
cfg->async_config ? cfg->async_config : "",
cfg->compress_ext ? cfg->compress_ext : "",
- cfg->verbose > 1 ? ",": "",
- cfg->verbose > 1 ? debug_cconfig : "",
+ cfg->verbose > 1 && strlen(debug_cconfig) ? ",": "",
+ cfg->verbose > 1 &&
+ strlen(debug_cconfig) ? debug_cconfig : "",
sess_cfg ? sess_cfg : "",
user_cconfig ? ",": "",
user_cconfig ? user_cconfig : "");
- if ((ret = config_opt_str(cfg, "conn_config", cc_buf)) != 0)
- goto err;
+ if (strlen(cc_buf))
+ if ((ret = config_opt_str(
+ cfg, "conn_config", cc_buf)) != 0)
+ goto err;
}
if (cfg->verbose > 1 || cfg->index ||
user_tconfig != NULL || cfg->compress_table != NULL) {
- req_len = strlen(cfg->table_config) + strlen(debug_tconfig) + 3;
+ req_len = strlen(debug_tconfig) + 3;
if (user_tconfig != NULL)
req_len += strlen(user_tconfig);
if (cfg->compress_table != NULL)
@@ -2374,16 +2376,18 @@ main(int argc, char *argv[])
/*
* This is getting hard to parse.
*/
- snprintf(tc_buf, req_len, "%s%s%s%s%s%s%s",
- cfg->table_config,
+ snprintf(tc_buf, req_len, "%s%s%s%s%s%s",
cfg->index ? INDEX_COL_NAMES : "",
cfg->compress_table ? cfg->compress_table : "",
- cfg->verbose > 1 ? ",": "",
- cfg->verbose > 1 ? debug_tconfig : "",
+ cfg->verbose > 1 && strlen(debug_tconfig) ? ",": "",
+ cfg->verbose > 1 &&
+ strlen(debug_tconfig) ? debug_tconfig : "",
user_tconfig ? ",": "",
user_tconfig ? user_tconfig : "");
- if ((ret = config_opt_str(cfg, "table_config", tc_buf)) != 0)
- goto err;
+ if (strlen(tc_buf))
+ if ((ret = config_opt_str(
+ cfg, "table_config", tc_buf)) != 0)
+ goto err;
}
if (cfg->log_partial && cfg->table_count > 1) {
req_len = strlen(cfg->table_config) +
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h
index e0467f4f3a1..9d6ef2f56ea 100644
--- a/bench/wtperf/wtperf.h
+++ b/bench/wtperf/wtperf.h
@@ -43,7 +43,7 @@ typedef struct __truncate_queue_entry TRUNCATE_QUEUE_ENTRY;
#define EXT_PFX ",extensions=("
#define EXT_SFX ")"
#define EXTPATH "../../ext/compressors/" /* Extensions path */
-#define BLKCMP_PFX ",block_compressor="
+#define BLKCMP_PFX "block_compressor="
#define LZ4_BLK BLKCMP_PFX "lz4"
#define LZ4_EXT \