This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.

The procedure is defined as:

proc nsmcp::invalidRequestContextSQL {peerKey side} {
    
    if {![regexp {^[0-9a-f]{64}$} $peerKey] || $side ni {before after}} {
        error "invalid warning context query"
    }
    if {$side eq "before"} {
        set condition {r.t>=:lo AND r.t<:at}
        set order DESC
        set limit 17
    } else {
        set condition {r.t>=:at AND r.t>=:lo AND r.t<:hi}
        set order ASC
        set limit 6
    }
    # Only a validated SHA-256 hex literal enters SQL. Values use bindings.
    return "SELECT r.t, r.status, substr(r.path,1,512) AS path,
        substr(r.method,1,32) AS method, substr(r.pool,1,128) AS pool,
        substr(r.source,1,32) AS source, substr(r.driver,1,128) AS driver,
        substr(r.label,1,1024) AS userAgent, r.clipped
        FROM main.rows r WHERE r.kind=0 AND $condition
        AND r.peer=X'$peerKey'
        AND EXISTS(SELECT 1 FROM main.files f WHERE f.fid=r.fid AND f.active=1)
        ORDER BY r.t $order LIMIT $limit"

}

Show another procedure: