IndexSeek commented on code in PR #1999:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1999#discussion_r2264184902


##########
tests/sqlparser_common.rs:
##########
@@ -4758,6 +4758,25 @@ fn parse_alter_table() {
     }
 }
 
+#[test]
+fn alter_table_span_includes_semicolon() {
+    use sqlparser::ast::Spanned;
+    use sqlparser::dialect::PostgreSqlDialect;
+    use sqlparser::parser::Parser;
+
+    let sql = r#"-- foo
+ALTER TABLE users
+  ADD COLUMN foo
+  varchar; -- hi there"#;
+    let dialect = PostgreSqlDialect {};
+    let ast = Parser::parse_sql(&dialect, sql).unwrap();
+    let stmt = &ast[0];
+    let span = stmt.span();
+
+    assert_eq!(span.end.line, 4);
+    assert_eq!(span.end.column, 11);
+}
+

Review Comment:
   Good catch, yes, that was redundant! I've removed this one.



-- 
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]

Reply via email to