Skip to content

Commit 9279fb9

Browse files
committed
efficient comparison
1 parent 5226b10 commit 9279fb9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/parser/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11411,7 +11411,9 @@ impl<'a> Parser<'a> {
1141111411
Token::Colon if self.dialect.supports_named_fn_args_with_colon_operator() => {
1141211412
Ok(FunctionArgOperator::Colon)
1141311413
}
11414-
Token::Word(w) if w.value.to_uppercase() == "VALUE" => Ok(FunctionArgOperator::Value),
11414+
Token::Word(w) if w.value.eq_ignore_ascii_case("value") => {
11415+
Ok(FunctionArgOperator::Value)
11416+
}
1141511417
_ => {
1141611418
self.prev_token();
1141711419
self.expected("argument operator", tok)

tests/sqlparser_postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,7 @@ fn test_json_object() {
28192819
assert!(matches!(
28202820
&args[..],
28212821
&[FunctionArg::ExprNamed { operator: FunctionArgOperator::Value, .. }]
2822-
));
2822+
), "Invalid function argument: {:?}", args);
28232823
}
28242824
other => panic!("Expected: JSON_OBJECT('name' VALUE 'value') to be parsed as a function, but got {other:?}"),
28252825
}

0 commit comments

Comments
 (0)