Skip to content

Commit 4953322

Browse files
committed
fix dropping function with empty brackets
Signed-off-by: Runji Wang <[email protected]>
1 parent 77c9fa2 commit 4953322

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

e2e_test/udf/python.slt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ drop function gcd;
177177
statement ok
178178
drop function gcd(int, int);
179179

180+
# foo() is different from foo.
181+
statement error function not found
182+
drop function gcd();
183+
180184
# Drop a function without arguments. Now the function name is unique.
181185
statement ok
182186
drop function gcd;

src/sqlparser/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ impl Parser {
21082108

21092109
let args = if self.consume_token(&Token::LParen) {
21102110
if self.consume_token(&Token::RParen) {
2111-
None
2111+
Some(vec![])
21122112
} else {
21132113
let args = self.parse_comma_separated(Parser::parse_function_arg)?;
21142114
self.expect_token(&Token::RParen)?;

0 commit comments

Comments
 (0)