From 255ec3ca8e8fb4e0b4aeffd85b7c3aab029cd133 Mon Sep 17 00:00:00 2001 From: Aleksandr Cupacenko Date: Sat, 14 Sep 2024 15:08:46 +0300 Subject: [PATCH] define operator precedence --- src/stream_processor/parser/sql.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stream_processor/parser/sql.y b/src/stream_processor/parser/sql.y index 866f95cc023..e798cdf021a 100644 --- a/src/stream_processor/parser/sql.y +++ b/src/stream_processor/parser/sql.y @@ -1,5 +1,4 @@ -%name-prefix="flb_sp_" // replace with %define api.prefix {flb_sp_} -%define api.pure full +%name-prefix "flb_sp_" // replace with %define api.prefix {flb_sp_} %define parse.error verbose %parse-param { struct flb_sp_cmd *cmd }; %parse-param { const char *query }; @@ -98,6 +97,10 @@ void yyerror(struct flb_sp_cmd *cmd, const char *query, void *scanner, const cha %type aggregate_func %type COUNT AVG SUM MAX MIN TIMESERIES_FORECAST +/* Define operator precedence and associativity for logical operations in conditions */ +%right NOT // Highest precedence for NOT +%left OR // Lowest precedence for OR +%left AND // Middle precedence for AND %destructor { flb_free ($$); } IDENTIFIER