Skip to content

Commit

Permalink
ignore cmp with timestamptz
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Dec 30, 2022
1 parent 0fff740 commit 6f6e531
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests/sqlsmith/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ fn not_unique_error(db_error: &str) -> bool {
db_error.contains("Bind error") && db_error.contains("is not unique")
}

fn is_unsupported_timestamp_error(db_error: &str) -> bool {
db_error.contains("Unsupported function: Timestamptz cmp Date")
|| db_error.contains("Unsupported function: Date cmp Timestamptz ")
|| db_error.contains("Unsupported function: Timestamp cmp Timestamptz")
|| db_error.contains("Unsupported function: Timestamptz cmp Timestamp")
}

/// Certain errors are permitted to occur. This is because:
/// 1. It is more complex to generate queries without these errors.
/// 2. These errors seldom occur, skipping them won't affect overall effectiveness of sqlsmith.
Expand All @@ -44,4 +51,5 @@ pub fn is_permissible_error(db_error: &str) -> bool {
|| is_division_by_zero_err(db_error)
|| is_unimplemented_error(db_error)
|| not_unique_error(db_error)
|| is_unsupported_timestamp_error(db_error)
}

0 comments on commit 6f6e531

Please sign in to comment.