Add missing types in dump local

This commit is contained in:
Richard Berger
2021-04-09 17:08:57 -04:00
parent 511f64fde4
commit 234c755507
3 changed files with 16 additions and 0 deletions

View File

@ -144,6 +144,10 @@ void DumpLocalGZ::write_data(int n, double *mybuf)
int written = 0; int written = 0;
if (vtype[j] == Dump::INT) { if (vtype[j] == Dump::INT) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<int> (mybuf[m])); written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<int> (mybuf[m]));
} else if (vtype[j] == Dump::DOUBLE) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]);
} else if (vtype[j] == Dump::BIGINT) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint> (mybuf[m]));
} else { } else {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]); written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]);
} }

View File

@ -155,6 +155,10 @@ void DumpLocalZstd::write_data(int n, double *mybuf)
int written = 0; int written = 0;
if (vtype[j] == Dump::INT) { if (vtype[j] == Dump::INT) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<int> (mybuf[m])); written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<int> (mybuf[m]));
} else if (vtype[j] == Dump::DOUBLE) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]);
} else if (vtype[j] == Dump::BIGINT) {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint> (mybuf[m]));
} else { } else {
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]); written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], mybuf[m]);
} }

View File

@ -179,6 +179,8 @@ void DumpLocal::init_style()
vformat[i] = utils::strdup(std::string(format_int_user) + " "); vformat[i] = utils::strdup(std::string(format_int_user) + " ");
else if (vtype[i] == Dump::DOUBLE && format_float_user) else if (vtype[i] == Dump::DOUBLE && format_float_user)
vformat[i] = utils::strdup(std::string(format_float_user) + " "); vformat[i] = utils::strdup(std::string(format_float_user) + " ");
else if (vtype[i] == Dump::BIGINT && format_bigint_user)
vformat[i] = utils::strdup(std::string(format_bigint_user) + " ");
else vformat[i] = utils::strdup(word + " "); else vformat[i] = utils::strdup(word + " ");
++i; ++i;
} }
@ -375,6 +377,10 @@ int DumpLocal::convert_string(int n, double *mybuf)
for (j = 0; j < size_one; j++) { for (j = 0; j < size_one; j++) {
if (vtype[j] == Dump::INT) if (vtype[j] == Dump::INT)
offset += sprintf(&sbuf[offset],vformat[j],static_cast<int> (mybuf[m])); offset += sprintf(&sbuf[offset],vformat[j],static_cast<int> (mybuf[m]));
else if (vtype[j] == Dump::DOUBLE)
offset += sprintf(&sbuf[offset],vformat[j],mybuf[m]);
else if (vtype[j] == Dump::BIGINT)
offset += sprintf(&sbuf[offset],vformat[j],static_cast<bigint> (mybuf[m]));
else else
offset += sprintf(&sbuf[offset],vformat[j],mybuf[m]); offset += sprintf(&sbuf[offset],vformat[j],mybuf[m]);
m++; m++;
@ -409,6 +415,8 @@ void DumpLocal::write_lines(int n, double *mybuf)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
for (j = 0; j < size_one; j++) { for (j = 0; j < size_one; j++) {
if (vtype[j] == Dump::INT) fprintf(fp,vformat[j],static_cast<int> (mybuf[m])); if (vtype[j] == Dump::INT) fprintf(fp,vformat[j],static_cast<int> (mybuf[m]));
else if (vtype[j] == Dump::DOUBLE) fprintf(fp,vformat[j],mybuf[m]);
else if (vtype[j] == Dump::BIGINT) fprintf(fp,vformat[j],static_cast<bigint>(mybuf[m]));
else fprintf(fp,vformat[j],mybuf[m]); else fprintf(fp,vformat[j],mybuf[m]);
m++; m++;
} }