Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,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) {
Expand Down
12 changes: 6 additions & 6 deletions tests/sqlparser_clickhouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
);
}
}
Expand Down Expand Up @@ -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())
);
}

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down Expand Up @@ -9526,7 +9526,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!(
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlparser_databricks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlparser_mssql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/sqlparser_snowflake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down Expand Up @@ -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()
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlparser_sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down
Loading