Skip to content

ci: test against crdb v25.4 and v26.2 - #404

Merged
rafiss merged 6 commits into
masterfrom
ci-crdb-25.4-26.2
Aug 19, 2026
Merged

ci: test against crdb v25.4 and v26.2#404
rafiss merged 6 commits into
masterfrom
ci-crdb-25.4-26.2

Conversation

@rafiss

@rafiss rafiss commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Add CockroachDB v25.4 and v26.2 to the CI test matrix and remove the
now end-of-life v25.1 and v25.3 versions.

rafiss and others added 5 commits August 18, 2026 16:13
Add CockroachDB v25.4 and v26.2 to the CI test matrix and remove the
now end-of-life v25.1 and v25.3 versions.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
CockroachDB v26.x creates tables with schema_locked enabled by default.
It cannot auto-unlock a table for the multi-statement DDL batches used to
drop and re-add foreign keys in disable_referential_integrity (auto-unlock
only applies to single-statement implicit transactions, and the test suite
runs with autocommit_before_ddl disabled). Unlock the affected tables
explicitly around each batch and restore their locked state afterwards.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Adding a foreign key writes a back-reference into the referenced table,
so that table must be unlocked too, not just the referencing table. A
parent table with no outgoing foreign keys (e.g. students) was never in
the referencing set and stayed schema_locked, so the batched ADD CONSTRAINT
still failed. Pass both the referencing and referenced tables to
with_schema_unlocked in both the remove and add paths.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
CockroachDB v26.x enables the schema_locked storage parameter on new
tables by default (via the sql.create_table_with_schema_locked.enabled
cluster setting). Locked tables reject DDL run inside a transaction, which
is how Active Record migrations and the test suite issue schema changes;
CockroachDB can only auto-unlock a table for single-statement implicit
transactions. Set create_table_with_schema_locked = false at the session
level on connect so Active Record works out of the box, gated to v25.3+
where the session variable exists, and deferring to an explicit :variables
entry when the user provides one.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Add a regression test that locks both the referencing and referenced
tables of a foreign key, then verifies disable_referential_integrity
succeeds (unlocking the tables around the batched drop/re-add of foreign
keys) and restores their locked state. Runs outside a transaction and is
gated to CockroachDB v25.3+ where the schema_locked toggle is available.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@rafiss
rafiss force-pushed the ci-crdb-25.4-26.2 branch from bcab6db to f5e202e Compare August 18, 2026 21:40
test_cache_gets_cleared_after_migration runs change_column to add a VARCHAR
length limit. Since cockroachdb/cockroach@5a8fd7226192 (v26.2), converting an
unbounded string to a bounded one validates existing data and cannot run inside
an explicit transaction (https://go.crdb.dev/issue-v/49351/v26.2). Rather than
skip the test, run it non-transactionally so change_column executes as an
implicit single-statement transaction, which CockroachDB allows. Earlier
versions treat the change as metadata-only, so this is safe everywhere.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@rafiss
rafiss force-pushed the ci-crdb-25.4-26.2 branch from 6892f87 to 4e8623d Compare August 18, 2026 22:26
@rafiss
rafiss merged commit 2f3840b into master Aug 19, 2026
5 checks passed
@rafiss
rafiss deleted the ci-crdb-25.4-26.2 branch August 19, 2026 00:05
@rafiss rafiss mentioned this pull request Aug 19, 2026
rafiss added a commit that referenced this pull request Aug 19, 2026
- Disabled schema_locked by default on connect for CockroachDB v25.3+ and
  unlocked tables around batched foreign key changes (#404)
- Improved error classification by detecting cached plan failures from the
  error message instead of the source function (#403)
- Stopped advertising support for restarting database transactions (#398)
- Fixed enum columns being misdetected as spatial columns (#396)

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant