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() {
16317
16317
}
16318
16318
16319
16319
#[test]
16320
- fn test_odbc_time_date_timestamp_support() {
16320
+ fn parse_odbc_time_date_timestamp() {
16321
+ // Supported statements
16321
16322
let sql_d = "SELECT {d '2025-07-17'}, category_name FROM categories";
16322
16323
let _ = all_dialects().verified_stmt(sql_d);
16323
16324
let sql_t = "SELECT {t '14:12:01'}, category_name FROM categories";
16324
16325
let _ = all_dialects().verified_stmt(sql_t);
16325
16326
let sql_ts = "SELECT {ts '2025-07-17 14:12:01'}, category_name FROM categories";
16326
16327
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());
16332
16331
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
+ );
16334
16342
}
16335
16343
16336
16344
#[test]
You can’t perform that action at this time.
0 commit comments