From 89d57d8570514fd6bbcac77cb9405832ef8225a6 Mon Sep 17 00:00:00 2001 From: ts <47553271+tomtiao@users.noreply.github.com> Date: Fri, 7 Oct 2022 23:32:52 +0800 Subject: [PATCH] fix: preserve whitespaces in chars when load data from file (#96) --- src/observer/storage/default/default_storage_stage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/observer/storage/default/default_storage_stage.cpp b/src/observer/storage/default/default_storage_stage.cpp index d99820e..0ce0c45 100644 --- a/src/observer/storage/default/default_storage_stage.cpp +++ b/src/observer/storage/default/default_storage_stage.cpp @@ -220,7 +220,9 @@ RC insert_record_from_file( const FieldMeta *field = table->table_meta().field(i + sys_field_num); std::string &file_value = file_values[i]; - common::strip(file_value); + if (field->type() != CHARS) { + common::strip(file_value); + } switch (field->type()) { case INTS: { -- GitLab