LucaCappelletti94 commented on code in PR #2245:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2245#discussion_r2874500309


##########
tests/sqlparser_postgres.rs:
##########
@@ -1084,6 +1084,61 @@ PHP      ₱ USD $
     pg_and_generic().one_statement_parses_to(sql, "");
 }
 
+#[test]
+fn parse_copy_from_stdin_without_semicolon() {
+    let stmt = pg().verified_stmt("COPY bitwise_test FROM STDIN NULL 'null'");
+    assert_eq!(
+        stmt,
+        Statement::Copy {
+            source: CopySource::Table {
+                table_name: ObjectName::from(vec!["bitwise_test".into()]),
+                columns: vec![],
+            },
+            to: false,
+            target: CopyTarget::Stdin,
+            options: vec![],
+            legacy_options: vec![CopyLegacyOption::Null("null".into())],
+            values: vec![],
+        }
+    );
+}
+
+#[test]
+fn parse_copy_from_stdin_without_semicolon_variants() {
+    let cases = [
+        "COPY bool_test FROM STDIN NULL 'null'",
+        "COPY varbit_table FROM stdin",
+        "COPY bit_table FROM stdin",
+        "copy copytest2(test) from stdin",
+        "copy copytest3 from stdin csv header",
+        "copy copytest4 from stdin (header)",
+        "copy parted_copytest from stdin",
+        "copy tab_progress_reporting from stdin",
+        "copy oversized_column_default from stdin",
+        "COPY x (a, b, c, d, e) from stdin",
+        "copy header_copytest (c, a) from stdin",
+        "COPY atest5 (two) FROM stdin",
+        "COPY main_table (a, b) FROM stdin",
+    ];
+
+    for sql in cases {
+        match pg().one_statement_parses_to(sql, "") {

Review Comment:
   Done, and these are just a handful of distinct cases from the postgres 
regression SQL statements.



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