hashicorp / hashicorp/mql

Incorrect parsing with extra parentheses

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
67
Forks
12
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When I add an extra left and right parentheses in the middle of a query around a comparison, the mql parser doesn't generate the same logical representation.

Example:

URL Query (parentheses around test_b="TestB"):
`(test_a="TestA" and (test_b="TestB")) or (test_c="TestC" and test_d="TestD")`

SQL Query Generated:
`(test_a=? and (test_b=? or (test_c=? and test_d=?)))`

**To Reproduce**
A full example with [Go Playground](https://go.dev/play/p/h4TUgVzG71m)

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.