目前ptrack的提示中,1 缺乏对于报错对应操作的解释 2 对于没有开启pstack的情况下,lsn可能获取为长度0的字符串的处理缺失(导致securec_check_for_sscanf_s失败,其提示容易误解为程序bug)
This commit is contained in:
@ -81,9 +81,12 @@ pg_ptrack_get_pagemapset(PGconn *backup_conn, XLogRecPtr lsn)
|
||||
char *temp_lsn = NULL;
|
||||
res = pgut_execute(backup_conn, "SELECT pg_cbm_tracked_location()", 0, NULL);
|
||||
if (PQnfields(res) != 1) {
|
||||
elog(ERROR, "cannot get cbm tracked lsn location");
|
||||
elog(ERROR, "cannot get cbm tracked lsn location, maybe enable_cbm_tracking is off");
|
||||
}
|
||||
temp_lsn = pg_strdup(PQgetvalue(res, 0, 0));
|
||||
if (strlen(temp_lsn)==0){
|
||||
elog(ERROR, "cannot get cbm tracked lsn location, maybe enable_cbm_tracking is off");
|
||||
}
|
||||
ret = sscanf_s(temp_lsn, "%X/%X", &lsn_hi, &lsn_lo);
|
||||
securec_check_for_sscanf_s(ret, 2, "\0", "\0");
|
||||
pfree(temp_lsn);
|
||||
|
Reference in New Issue
Block a user