From 23be4e20612b939de26afc13293472e3ece8e1f3 Mon Sep 17 00:00:00 2001 From: Daehyun Kim Date: Wed, 20 Nov 2024 17:08:41 +0900 Subject: [PATCH] feat(csql_result_format): csql output format vimkim --- src/executables/csql_result_format.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/executables/csql_result_format.c b/src/executables/csql_result_format.c index 54bbdb060e..8e88c1642e 100644 --- a/src/executables/csql_result_format.c +++ b/src/executables/csql_result_format.c @@ -1472,9 +1472,24 @@ csql_db_value_as_string (DB_VALUE * value, int *length, const CSQL_ARGUMENT * cs } break; case DB_TYPE_VIMKIM: - result = - bigint_to_string (db_get_vimkim (value), default_int_profile.fieldwidth, default_int_profile.leadingzeros, - default_int_profile.leadingsymbol, default_int_profile.commas, default_int_profile.format); + { + const float * vimkim = db_get_vimkim (value); + const int vimkim_size = db_get_vimkim_size (value); + + + std::ostringstream oss; + oss << "["; + + // Add elements to the string stream + for (int i = 0; i < vimkim_size; ++i) { + if (i > 0) { + oss << ", "; + } + oss << vimkim[i]; + } + oss << "]"; + result = strdup(oss.str().c_str()); + } if (result) { len = strlen (result);