mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-26 07:29:11 +00:00
Add support for $$ in generic dialect ... (#1185)
This commit is contained in:
parent
6b03a259aa
commit
4472789171
2 changed files with 3 additions and 2 deletions
|
@ -5954,7 +5954,8 @@ impl<'a> Parser<'a> {
|
||||||
pub fn parse_function_definition(&mut self) -> Result<FunctionDefinition, ParserError> {
|
pub fn parse_function_definition(&mut self) -> Result<FunctionDefinition, ParserError> {
|
||||||
let peek_token = self.peek_token();
|
let peek_token = self.peek_token();
|
||||||
match peek_token.token {
|
match peek_token.token {
|
||||||
Token::DollarQuotedString(value) if dialect_of!(self is PostgreSqlDialect) => {
|
Token::DollarQuotedString(value) if dialect_of!(self is PostgreSqlDialect | GenericDialect) =>
|
||||||
|
{
|
||||||
self.next_token();
|
self.next_token();
|
||||||
Ok(FunctionDefinition::DoubleDollarDef(value.value))
|
Ok(FunctionDefinition::DoubleDollarDef(value.value))
|
||||||
}
|
}
|
||||||
|
|
|
@ -3305,7 +3305,7 @@ fn parse_create_function() {
|
||||||
|
|
||||||
let sql = "CREATE OR REPLACE FUNCTION add(a INTEGER, IN b INTEGER = 1) RETURNS INTEGER LANGUAGE SQL IMMUTABLE RETURN a + b";
|
let sql = "CREATE OR REPLACE FUNCTION add(a INTEGER, IN b INTEGER = 1) RETURNS INTEGER LANGUAGE SQL IMMUTABLE RETURN a + b";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
pg().verified_stmt(sql),
|
pg_and_generic().verified_stmt(sql),
|
||||||
Statement::CreateFunction {
|
Statement::CreateFunction {
|
||||||
or_replace: true,
|
or_replace: true,
|
||||||
temporary: false,
|
temporary: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue