@@ -4555,7 +4555,7 @@ impl<'a> Parser<'a> {
45554555 } else if self.parse_keyword(Keyword::EXTERNAL) {
45564556 self.parse_create_external_table(or_replace)
45574557 } else if self.parse_keyword(Keyword::FUNCTION) {
4558- self.parse_create_function(or_replace, temporary)
4558+ self.parse_create_function(or_alter, or_replace, temporary)
45594559 } else if self.parse_keyword(Keyword::TRIGGER) {
45604560 self.parse_create_trigger(or_replace, false)
45614561 } else if self.parse_keywords(&[Keyword::CONSTRAINT, Keyword::TRIGGER]) {
@@ -4864,6 +4864,7 @@ impl<'a> Parser<'a> {
48644864
48654865 pub fn parse_create_function(
48664866 &mut self,
4867+ or_alter: bool,
48674868 or_replace: bool,
48684869 temporary: bool,
48694870 ) -> Result<Statement, ParserError> {
@@ -4876,7 +4877,7 @@ impl<'a> Parser<'a> {
48764877 } else if dialect_of!(self is BigQueryDialect) {
48774878 self.parse_bigquery_create_function(or_replace, temporary)
48784879 } else if dialect_of!(self is MsSqlDialect) {
4879- self.parse_mssql_create_function(or_replace, temporary)
4880+ self.parse_mssql_create_function(or_alter, or_replace, temporary)
48804881 } else {
48814882 self.prev_token();
48824883 self.expected("an object type after CREATE", self.peek_token())
@@ -4991,6 +4992,7 @@ impl<'a> Parser<'a> {
49914992 }
49924993
49934994 Ok(Statement::CreateFunction(CreateFunction {
4995+ or_alter: false,
49944996 or_replace,
49954997 temporary,
49964998 name,
@@ -5024,6 +5026,7 @@ impl<'a> Parser<'a> {
50245026 let using = self.parse_optional_create_function_using()?;
50255027
50265028 Ok(Statement::CreateFunction(CreateFunction {
5029+ or_alter: false,
50275030 or_replace,
50285031 temporary,
50295032 name,
@@ -5113,6 +5116,7 @@ impl<'a> Parser<'a> {
51135116 };
51145117
51155118 Ok(Statement::CreateFunction(CreateFunction {
5119+ or_alter: false,
51165120 or_replace,
51175121 temporary,
51185122 if_not_exists,
@@ -5136,6 +5140,7 @@ impl<'a> Parser<'a> {
51365140 /// [MsSql]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql
51375141 fn parse_mssql_create_function(
51385142 &mut self,
5143+ or_alter: bool,
51395144 or_replace: bool,
51405145 temporary: bool,
51415146 ) -> Result<Statement, ParserError> {
@@ -5179,6 +5184,7 @@ impl<'a> Parser<'a> {
51795184 let function_body = Some(CreateFunctionBody::MultiStatement(result));
51805185
51815186 Ok(Statement::CreateFunction(CreateFunction {
5187+ or_alter,
51825188 or_replace,
51835189 temporary,
51845190 if_not_exists: false,
0 commit comments