未验证 提交 d30da66d 编写于 作者: G Ganesh Vernekar 提交者: GitHub

Fix timestamp() method for vector selector inside paren (#8164)

Signed-off-by: NGanesh Vernekar <cs15btech11018@iith.ac.in>
上级 f8ba0ed9
......@@ -1027,6 +1027,7 @@ func (ev *evaluator) eval(expr parser.Expr) (parser.Value, storage.Warnings) {
// Matrix evaluation always returns the evaluation time,
// so this function needs special handling when given
// a vector selector.
unwrapParenExpr(&e.Args[0])
vs, ok := e.Args[0].(*parser.VectorSelector)
if ok {
return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) (Vector, storage.Warnings) {
......
......@@ -300,6 +300,9 @@ eval instant at 0s timestamp(metric)
eval instant at 5s timestamp(metric)
{} 0
eval instant at 5s timestamp(((metric)))
{} 0
eval instant at 10s timestamp(metric)
{} 10
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册