Skip to content

Cross-backend edge-case consistency test matrix #23

Description

@yancya

Background

The three backends were written years apart and their edge-case behavior drifted (see the sibling correctness issues: PG empty tuples, PG/MySQL/BQ identifier escaping, MySQL Infinity). Nothing today pins down "what all backends must agree on" — each test file only tests its own backend's status quo.

Prerequisites

  • The individual correctness fixes should land first (PG empty tuples, PG identifier quoting, MySQL/BQ backtick escaping, MySQL Infinity) — this issue locks in their outcomes. Check which are closed before starting.

Task

Add one cross-backend test file (e.g. test/consistency_test.rb, test-unit like the rest) that runs a shared matrix of edge cases against all three backends and asserts either the common behavior or the documented, intentional divergence:

Case Expectation
nil value in a tuple SQL NULL in output, all backends
column with only nils, no explicit type ReasonlessTypeError (or documented alternative), all backends
empty tuples + explicit types valid 0-row relation, all backends
empty tuples, no types TypeNotFoundError, all backends
mixed types in a column ReasonlessTypeError, all backends
single column valid output (BQ adds dummy column)
quote character in column name correctly escaped per backend
quote character in string value correctly escaped per backend
Float::INFINITY / NAN per-backend documented behavior (PG literal, BQ handling, MySQL error)
BigDecimal round-trip precision value survives to the literal without float truncation

Acceptance criteria

  • New test file covering the matrix above for BigQuery, Postgresql, and MySQL
  • Any intentional divergence is asserted AND written down in a README "Edge cases" / "Errors" subsection (extend the existing Errors section)
  • bundle exec rake runs the new file via the existing default task glob (test/*_test.rb)
  • CI green on Ruby 3.2/3.3/3.4/4.0

Verification

  • bundle exec rake green locally and in CI
  • The matrix table in this issue is fully mirrored by test cases (reviewer can diff table rows against test data entries)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions