LucaCappelletti94 commented on code in PR #2968:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2968#discussion_r4635440526
##########
tests/sqlparser_postgres.rs:
##########
@@ -13518,3 +13518,60 @@ fn
parse_case_ending_in_end_keyword_is_not_silently_dropped() {
ParserError::ParserError("Expected: end of statement, found:
END".to_string())
);
}
+
+#[test]
+fn parse_current_role_system_user_current_schema() {
+ let select =
+ pg_and_generic().verified_only_select("SELECT CURRENT_ROLE,
SYSTEM_USER, CURRENT_SCHEMA");
+ for (item, name) in
+ select
+ .projection
+ .iter()
+ .zip(["CURRENT_ROLE", "SYSTEM_USER", "CURRENT_SCHEMA"])
+ {
+ assert_eq!(
+ &Expr::Function(Function {
+ name: ObjectName::from(vec![Ident::new(name)]),
+ uses_odbc_syntax: false,
+ parameters: FunctionArguments::None,
+ args: FunctionArguments::None,
+ null_treatment: None,
+ filter: None,
+ over: None,
+ within_group: vec![],
+ }),
+ expr_from_projection(item)
+ );
+ }
+
+ let select = pg_and_generic().verified_only_select("SELECT
current_schema()");
+ assert_eq!(
+ &Expr::Function(Function {
+ name: ObjectName::from(vec![Ident::new("current_schema")]),
+ uses_odbc_syntax: false,
+ parameters: FunctionArguments::None,
+ args: FunctionArguments::List(FunctionArgumentList {
+ duplicate_treatment: None,
+ args: vec![],
+ clauses: vec![],
+ }),
+ null_treatment: None,
+ filter: None,
+ over: None,
+ within_group: vec![],
+ }),
+ expr_from_projection(only(&select.projection))
+ );
+
+ let select = pg_and_generic().verified_only_select(r#"SELECT
"current_role""#);
Review Comment:
And are unfortunately seemingly holistically present in RLS stuff.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]