Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canned Graph의 Date Picker에서 'Now' 선택 시 발생하는 버그 #545

Open
jaegeunha opened this issue Oct 24, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jaegeunha
Copy link
Collaborator

jaegeunha commented Oct 24, 2024

문제 상황

  • Canned Graph의 Date Picker에서 'Now' 옵션 선택 시 InfluxDB Query 요청에서 에러가 발생함.

문제 발생 UI 화면

Image

원인

  • now() String 값이 upper값으로 입력되었을 때 작은 따옴표로 감싸지지 않아야 하며, 그대로 조건식에 사용되어야 함.

기존 코드

if (upper) {
  text += ` where time > '${lower}' AND time < '${upper}'`
} else {
  text += ` where time > ${lower}`
}

개선 코드 (예상)

  if (upper === 'now()') {
    text += ` where time > '${lower}' AND time < ${upper}`
  } else if (upper) {
    text += ` where time > '${lower}' AND time < '${upper}'`
  } else {
    text += ` where time > ${lower}`
  }

API Error Response

{
    "results": [
        {
            "statement_id": 0,
            "error": "invalid operation: time and *influxql.StringLiteral are not compatible"
        }
    ]
}
@jaegeunha jaegeunha added this to v2.1 Oct 24, 2024
@jaegeunha jaegeunha converted this from a draft issue Oct 24, 2024
@jaegeunha jaegeunha self-assigned this Oct 24, 2024
@jaegeunha jaegeunha added the bug Something isn't working label Oct 24, 2024
@jaegeunha jaegeunha moved this from Ready to In progress in v2.1 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In review
Development

No branches or pull requests

1 participant