snowflake: Fix handling of /~% in the stage name (#1009)

This commit is contained in:
Lukasz Stefaniak 2023-10-26 21:23:57 +02:00 committed by GitHub
parent 2f437db2a6
commit 7b3cc18229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 5 deletions

View file

@ -26,6 +26,9 @@ use test_utils::*;
#[macro_use]
mod test_utils;
#[cfg(test)]
use pretty_assertions::assert_eq;
#[test]
fn test_snowflake_create_table() {
let sql = "CREATE TABLE _my_$table (am00unt number)";
@ -1118,3 +1121,16 @@ fn parse_subquery_function_argument() {
// the function.
snowflake().one_statement_parses_to("SELECT func(SELECT 1, 2)", "SELECT func((SELECT 1, 2))");
}
#[test]
fn parse_division_correctly() {
snowflake_and_generic().one_statement_parses_to(
"SELECT field/1000 FROM tbl1",
"SELECT field / 1000 FROM tbl1",
);
snowflake_and_generic().one_statement_parses_to(
"SELECT tbl1.field/tbl2.field FROM tbl1 JOIN tbl2 ON tbl1.id = tbl2.entity_id",
"SELECT tbl1.field / tbl2.field FROM tbl1 JOIN tbl2 ON tbl1.id = tbl2.entity_id",
);
}