Parses the things that can come after the argument list of a table function call. These are - optional WITH ORDINALITY - optional table alias - optional WITH ORDINALITY again! This is allowed just to keep supporting our earlier buggy order where we allowed WITH ORDINALITY only after the table alias. (Postgres and other systems support it only before the table alias.)
(&mut self)
| 8521 | /// order where we allowed WITH ORDINALITY only after the table alias. (Postgres and other |
| 8522 | /// systems support it only before the table alias.) |
| 8523 | fn parse_table_function_suffix(&mut self) -> Result<(bool, Option<TableAlias>), ParserError> { |
| 8524 | let with_ordinality_1 = self.parse_keywords(&[WITH, ORDINALITY]); |
| 8525 | let alias = self.parse_optional_table_alias()?; |
| 8526 | let with_ordinality_2 = self.parse_keywords(&[WITH, ORDINALITY]); |
| 8527 | if with_ordinality_1 && with_ordinality_2 { |
| 8528 | return parser_err!( |
| 8529 | self, |
| 8530 | self.peek_prev_pos(), |
| 8531 | "WITH ORDINALITY specified twice" |
| 8532 | ); |
| 8533 | } |
| 8534 | Ok((with_ordinality_1 || with_ordinality_2, alias)) |
| 8535 | } |
| 8536 | |
| 8537 | fn parse_named_function(&mut self) -> Result<Function<Raw>, ParserError> { |
| 8538 | let name = self.parse_raw_name()?; |
no test coverage detected