[CP] ocp requires double quote for restore scn display

This commit is contained in:
oceanoverflow
2023-08-16 02:40:38 +00:00
committed by ob-robot
parent 2d7f00be98
commit 530dbeeef0
2 changed files with 23 additions and 1 deletions

View File

@ -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
*/

View File

@ -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),