File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -16317,20 +16317,28 @@ fn parse_notnull() {
1631716317}
1631816318
1631916319#[test]
16320- fn test_odbc_time_date_timestamp_support() {
16320+ fn parse_odbc_time_date_timestamp() {
16321+ // Supported statements
1632116322 let sql_d = "SELECT {d '2025-07-17'}, category_name FROM categories";
1632216323 let _ = all_dialects().verified_stmt(sql_d);
1632316324 let sql_t = "SELECT {t '14:12:01'}, category_name FROM categories";
1632416325 let _ = all_dialects().verified_stmt(sql_t);
1632516326 let sql_ts = "SELECT {ts '2025-07-17 14:12:01'}, category_name FROM categories";
1632616327 let _ = all_dialects().verified_stmt(sql_ts);
16327- }
16328-
16329- #[test]
16330- #[should_panic]
16331- fn test_invalid_odbc_literal_fails() {
16328+ // Unsupported statement
16329+ let supports_dictionary = all_dialects_where(|d| d.supports_dictionary_syntax());
16330+ let dictionary_unsupported = all_dialects_where(|d| !d.supports_dictionary_syntax());
1633216331 let sql = "SELECT {tt '14:12:01'} FROM foo";
16333- let _ = all_dialects().verified_stmt(sql);
16332+ let res = supports_dictionary.parse_sql_statements(sql);
16333+ let res_dict = dictionary_unsupported.parse_sql_statements(sql);
16334+ assert_eq!(
16335+ ParserError::ParserError("Expected: :, found: '14:12:01'".to_string()),
16336+ res.unwrap_err()
16337+ );
16338+ assert_eq!(
16339+ ParserError::ParserError("Expected: an expression, found: {".to_string()),
16340+ res_dict.unwrap_err()
16341+ );
1633416342}
1633516343
1633616344#[test]
You can’t perform that action at this time.
0 commit comments