Skip to content

oracle_test: stale module copies are silently skipped by oracle-check #2126

Open

Description

@123123213weqw

Summary

Most modules under src/oracle_test/modules/ are hand-maintained copies of their
src/test/modules/ counterparts, and several of those copies have drifted. A module
is only exercised in Oracle mode when its Makefile lists ORA_REGRESS, so the stale
copies are currently silently skipped by make oracle-check-world — which is why
hs-liuxh's question in #1419 ("many modules are still missing ORA_REGRESS") cannot
be answered by simply adding the variable: adding it makes the suite fail.

Measured state (master 63fb0bfe615, debug/cassert build, --enable-injection-points)

Adding ORA_REGRESS = $(REGRESS) to the ten remaining modules fails 10 of 10.
make check (PG mode) vs make oracle-check after adding the variable:

module make check oracle-check cause
dummy_index_am, gin, typcache FAIL FAIL copy differs from src/test/modules/ only in psql header padding and a trailing blank line
nbtree, test_dsm_registry, test_extensions, test_oat_hooks, test_pg_dump FAIL FAIL copy is a stale fork: missing statements, older error texts, / terminators present in only one of the two copies (test_dsm_registry.c is out of date as well)
test_lwlock_tranches PASS FAIL oracle-check does not pass the module's --temp-config (see below)
spgist_name_ops PASS FAIL real mode difference: \d+ prints pg_catalog.int4 in Oracle mode

Two points worth noting:

  • dummy_index_am, gin and typcache fail make check too, so the drift is not an
    Oracle-mode problem — the copies are simply wrong today.
  • test_lwlock_tranches needs ORACLE_REGRESS_OPTS = --temp-config ... because
    oracle-check reads ORACLE_REGRESS_OPTS, not REGRESS_OPTS, and that config is
    what preloads the extension.

Proposal

  1. Re-sync the stale copies, keeping the IvorySQL-specific adjustments (the /
    statement terminators and the Oracle expected output), then list them in
    ORA_REGRESS.
  2. Decide on the two mode differences: spgist_name_ops (type qualification in \d+)
    and nbtree (the injection_points machinery does not fire in Oracle mode, the
    same root cause as the injection_points exclusion in oracle_test: enable compatible module tests #1419).

The whitespace-only copies plus test_lwlock_tranches are fixed in a follow-up PR that
references this issue; the remaining five need the copies re-synced first.

Activity

  1. 123123213weqw commented on Sep 20, 2026

    @123123213weqw
    ContributorAuthor

    Correction plus a deeper root cause, after testing the module copies on 63fb0bfe615 (debug/cassert build).

    Correction: the / markers in the oracle_test copies are not stale leftovers. They are required. In Oracle mode psql reads and echoes ahead until it meets a / (or EOF) and only then executes the batch, so results and NOTICEs land after the echoes that follow them. Adding / after a statement restores the usual interleaving:

    $ psql -p <oracle port> -X -a -q -d postgres < in > out 2>&1    # no slashes
    DROP TYPE IF EXISTS sht CASCADE;
    NOTICE:  type "sht" does not exist, skipping
    CREATE TYPE sht;
    CREATE FUNCTION sht_in(cstring) RETURNS sht AS 'textin' LANGUAGE internal STRICT IMMUTABLE;
    SELECT 'first' AS a1;
    SELECT 'second' AS a2;
    NOTICE:  return type sht is only a shell          <-- arrives late
      a1
    -------
     first
    
       a2
    --------
     second
    

    Same input with a / after each statement: echo, result, /, echo, result — normal order. The trigger is not the file size but the presence of routine/type DDL (CREATE FUNCTION etc.), which is why the src/oracle_test/regress/expected/*.out files are not interchangeable with src/test/regress/expected/*.out: they were generated with this batching. create_index.out shows it plainly — NOTICE: relation "onek_unique1" already exists, skipping sits after the echo of the next statement.

    So for the module copies the rule is: the statement text has to come from src/test/modules (that is the part that drifts), but the / terminators and the expected output have to stay Oracle-mode generated. Copying the src/test files wholesale, as my earlier table implied, throws away the / and with it the expected-output contract.

    What that changes in the table above. Five modules still cannot be listed, but for different reasons than "stale copies":

    • nbtree — the diff is dominated by displaced output (the injection_points_set_local result appears ~70 lines later), so it needs Oracle-generated expected output; on top of that the run ends with ERROR: invalid transaction termination from wait_prunable()'s ROLLBACK, which is a real Oracle-mode difference.
    • test_pg_dump — same displacement (pg_init_privs blocks land at the end of the file), plus type names render as pg_catalog.int2, like the pg_catalog.int4 in spgist_name_ops.
    • spgist_name_ops — its copy is not stale at all: it matches src/test/modules and passes make check; only the pg_catalog.int4 qualification differs.
    • test_extensions, test_oat_hooks — blocked by the harness issue oracle pg_regress creates the regression database over the Oracle port, breaking NO_LOCALE/ENCODING modules #2127, they never reach the SQL.

    What is enabled instead. A follow-up PR (#2128) takes the five copies whose content can be synced without losing anything — dummy_index_am, gin, typcache, test_lwlock_tranches (which additionally needed ORACLE_REGRESS_OPTS for its temp config) and test_dsm_registry (whose .c, extension script, test and expected output had all drifted). All five pass both make check and make oracle-check at 63fb0bfe615, and dummy_index_am/test_dsm_registry also get their meson manifests updated from the "no Oracle regress registration" comment to a real registration.

    The remaining question for the maintainers is the one this issue was opened for: whether regenerating Oracle-mode expected output for nbtree / test_pg_dump (and a decision on the pg_catalog.* qualification for spgist_name_ops) is wanted, or whether those stay out of ORA_REGRESS with a comment like the injection_points one.

  2. NotHimmel commented on Sep 20, 2026

    @NotHimmel
    Collaborator

    Thanks for reporting this issue.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions