diff --git a/deps/oblib/src/lib/oblog/ob_log_print_kv.h b/deps/oblib/src/lib/oblog/ob_log_print_kv.h index 2e6247a8a0..b606e246e2 100644 --- a/deps/oblib/src/lib/oblog/ob_log_print_kv.h +++ b/deps/oblib/src/lib/oblog/ob_log_print_kv.h @@ -90,6 +90,28 @@ private: const char *str_; }; +class ObQuoteSzString +{ +public: + explicit ObQuoteSzString(const char *s) : str_(s) + {} + ~ObQuoteSzString() + {} + + int64_t to_string(char *buf, const int64_t len) const + { + int64_t pos = 0; + if (OB_ISNULL(str_)) { + (void)logdata_printf(buf, len, pos, "NULL"); + } else { + (void)logdata_printf(buf, len, pos, "\"%s\"", str_); + } + return pos; + } +private: + const char *str_; +}; + /** * used to print string that maybe not terminated by zero and has a max lenght */ diff --git a/src/share/backup/ob_backup_struct.cpp b/src/share/backup/ob_backup_struct.cpp index 935b3207f9..9ba2710f9d 100755 --- a/src/share/backup/ob_backup_struct.cpp +++ b/src/share/backup/ob_backup_struct.cpp @@ -4088,7 +4088,7 @@ int64_t ObBackupSetFileDesc::to_string(char *min_restore_scn_str_buf, char *buf, // do nothing } else { J_OBJ_START(); - ObSzString min_restore_scn_display(min_restore_scn_str_buf); + ObQuoteSzString min_restore_scn_display(min_restore_scn_str_buf); J_KV(K_(backup_set_id), K_(incarnation), K_(tenant_id), K_(dest_id), K_(backup_type), K_(plus_archivelog), K_(date), K_(prev_full_backup_set_id), K_(prev_inc_backup_set_id), K_(stats), K_(start_time), K_(end_time), K_(status), K_(result), K_(encryption_mode), K_(passwd), K_(file_status), K_(backup_path), K_(start_replay_scn),