Skip to content

Commit

Permalink
tiny update
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 14, 2024
1 parent a390d3d commit bbf48a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion e2e_test/udf/sql_udf.slt
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,17 @@ $1 + 114514 + $1
# In SQL UDF definition: `select a + aa + a`
# ^^
# ----------------------------------------
statement error failed to find named parameter aa
# statement error failed to find named parameter aa
statement error
create function unknown_parameter(a INT) returns int language sql as 'select a + aa + a';
----
db error: ERROR: Failed to run the query

Caused by:
Invalid input syntax: Failed to conduct semantic check
Bind error: [sql udf] failed to find named parameter aa
In SQL UDF definition: `select a + aa + a`
^^

statement error Expected end of statement, found: 💩
create function call_regexp_replace() returns varchar language sql as 'select regexp_replace('💩💩💩💩💩foo🤔️bar亲爱的😭baz这不是爱情❤️‍🔥', 'baz(...)', '这是🥵', 'ic')';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/handler/create_sql_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pub async fn handle_create_sql_function(
);

return Err(ErrorCode::InvalidInputSyntax(format!(
"{}\n{}\n{}`{}`\n{}",
"{}\n {}\n {}`{}`\n{}",
DEFAULT_ERR_MSG, invalid_msg, PROMPT, body, position
))
.into());
Expand Down

0 comments on commit bbf48a6

Please sign in to comment.