diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 751101fe..da1b4d2a 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -1264,7 +1264,7 @@ impl<'a> Parser<'a> { self.prev_token(); self.parse_duckdb_struct_literal() } - _ => self.expected("an expression:", next_token), + _ => self.expected("an expression", next_token), }?; if self.parse_keyword(Keyword::COLLATE) { diff --git a/tests/sqlparser_clickhouse.rs b/tests/sqlparser_clickhouse.rs index f89da7ee..ae769c76 100644 --- a/tests/sqlparser_clickhouse.rs +++ b/tests/sqlparser_clickhouse.rs @@ -276,13 +276,13 @@ fn parse_alter_table_attach_and_detach_partition() { clickhouse_and_generic() .parse_sql_statements(format!("ALTER TABLE t0 {operation} PARTITION").as_str()) .unwrap_err(), - ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError("Expected: an expression, found: EOF".to_string()) ); assert_eq!( clickhouse_and_generic() .parse_sql_statements(format!("ALTER TABLE t0 {operation} PART").as_str()) .unwrap_err(), - ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError("Expected: an expression, found: EOF".to_string()) ); } } @@ -355,7 +355,7 @@ fn parse_alter_table_add_projection() { clickhouse_and_generic() .parse_sql_statements("ALTER TABLE t0 ADD PROJECTION my_name (SELECT)") .unwrap_err(), - ParserError("Expected: an expression:, found: )".to_string()) + ParserError("Expected: an expression, found: )".to_string()) ); } @@ -498,13 +498,13 @@ fn parse_optimize_table() { clickhouse_and_generic() .parse_sql_statements("OPTIMIZE TABLE t0 DEDUPLICATE BY") .unwrap_err(), - ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError("Expected: an expression, found: EOF".to_string()) ); assert_eq!( clickhouse_and_generic() .parse_sql_statements("OPTIMIZE TABLE t0 PARTITION") .unwrap_err(), - ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError("Expected: an expression, found: EOF".to_string()) ); assert_eq!( clickhouse_and_generic() @@ -1479,7 +1479,7 @@ fn parse_freeze_and_unfreeze_partition() { clickhouse_and_generic() .parse_sql_statements(format!("ALTER TABLE t0 {operation_name} PARTITION").as_str()) .unwrap_err(), - ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError("Expected: an expression, found: EOF".to_string()) ); assert_eq!( clickhouse_and_generic() diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs index 2f001e17..ac89fc1c 100644 --- a/tests/sqlparser_common.rs +++ b/tests/sqlparser_common.rs @@ -2051,7 +2051,7 @@ fn parse_tuple_invalid() { let sql = "select (), 2"; let res = parse_sql_statements(sql); assert_eq!( - ParserError::ParserError("Expected: an expression:, found: )".to_string()), + ParserError::ParserError("Expected: an expression, found: )".to_string()), res.unwrap_err() ); } @@ -9556,7 +9556,7 @@ fn parse_projection_trailing_comma() { trailing_commas .parse_sql_statements("SELECT * FROM track ORDER BY milliseconds,") .unwrap_err(), - ParserError::ParserError("Expected: an expression:, found: EOF".to_string()) + ParserError::ParserError("Expected: an expression, found: EOF".to_string()) ); assert_eq!( diff --git a/tests/sqlparser_databricks.rs b/tests/sqlparser_databricks.rs index ee0cf2d7..095ab0b3 100644 --- a/tests/sqlparser_databricks.rs +++ b/tests/sqlparser_databricks.rs @@ -64,7 +64,7 @@ fn test_databricks_exists() { let res = databricks().parse_sql_statements("SELECT EXISTS ("); assert_eq!( // TODO: improve this error message... - ParserError::ParserError("Expected: an expression:, found: EOF".to_string()), + ParserError::ParserError("Expected: an expression, found: EOF".to_string()), res.unwrap_err(), ); } diff --git a/tests/sqlparser_mssql.rs b/tests/sqlparser_mssql.rs index 0ab160f5..97114aed 100644 --- a/tests/sqlparser_mssql.rs +++ b/tests/sqlparser_mssql.rs @@ -487,7 +487,7 @@ fn parse_convert() { let error_sql = "SELECT CONVERT(INT, 'foo',) FROM T"; assert_eq!( - ParserError::ParserError("Expected: an expression:, found: )".to_owned()), + ParserError::ParserError("Expected: an expression, found: )".to_owned()), ms().parse_sql_statements(error_sql).unwrap_err() ); } diff --git a/tests/sqlparser_snowflake.rs b/tests/sqlparser_snowflake.rs index d0876fc5..5be5bfd3 100644 --- a/tests/sqlparser_snowflake.rs +++ b/tests/sqlparser_snowflake.rs @@ -1230,13 +1230,13 @@ fn parse_snowflake_declare_result_set() { let error_sql = "DECLARE res RESULTSET DEFAULT"; assert_eq!( - ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()), + ParserError::ParserError("Expected: an expression, found: EOF".to_owned()), snowflake().parse_sql_statements(error_sql).unwrap_err() ); let error_sql = "DECLARE res RESULTSET :="; assert_eq!( - ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()), + ParserError::ParserError("Expected: an expression, found: EOF".to_owned()), snowflake().parse_sql_statements(error_sql).unwrap_err() ); } @@ -1328,13 +1328,13 @@ fn parse_snowflake_declare_variable() { let error_sql = "DECLARE profit INT DEFAULT"; assert_eq!( - ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()), + ParserError::ParserError("Expected: an expression, found: EOF".to_owned()), snowflake().parse_sql_statements(error_sql).unwrap_err() ); let error_sql = "DECLARE profit DEFAULT"; assert_eq!( - ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()), + ParserError::ParserError("Expected: an expression, found: EOF".to_owned()), snowflake().parse_sql_statements(error_sql).unwrap_err() ); } diff --git a/tests/sqlparser_sqlite.rs b/tests/sqlparser_sqlite.rs index ce11b015..8e2afb8d 100644 --- a/tests/sqlparser_sqlite.rs +++ b/tests/sqlparser_sqlite.rs @@ -432,7 +432,7 @@ fn invalid_empty_list() { let sql = "SELECT * FROM t1 WHERE a IN (,,)"; let sqlite = sqlite_with_options(ParserOptions::new().with_trailing_commas(true)); assert_eq!( - "sql parser error: Expected: an expression:, found: ,", + "sql parser error: Expected: an expression, found: ,", sqlite.parse_sql_statements(sql).unwrap_err().to_string() ); }