iffyio commented on code in PR #2376:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2376#discussion_r3420076589
##########
tests/sqlparser_common.rs:
##########
@@ -17942,6 +17942,22 @@ fn parse_create_user() {
}
}
+#[test]
+fn key_value_option_statements_do_not_swallow_following_statement() {
+ // An unparenthesized key-value option list must not swallow the statement
+ // terminator, otherwise any following statement fails to parse. This
covers
+ // every unparenthesized caller of `parse_key_value_options`: `CREATE USER`
+ // and both `ALTER USER ... SET` forms.
+ for sql in [
+ "CREATE USER user1; SELECT 1",
+ "ALTER USER user1 SET x = 'y'; SELECT 1",
+ "ALTER USER user1 SET TAG t = 'v'; SELECT 1",
+ ] {
+ let statements = Parser::parse_sql(&GenericDialect {}, sql).unwrap();
Review Comment:
can we change this test to not hardcode the GenericDialect (can it use one
of the dialect select helpers to run the test case)?
--
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]