From 5a90d4a23f3b16354168aece0ce198f9c0324bbc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 00:48:19 +0000 Subject: [PATCH] test(driver-sql): count the default-order index in the MySQL and MariaDB activation-ledger index lists The live MySQL 8 cell enumerates every index on the activation ledger after the safe replace. Since the (created_at, id) implicit index joined every managed table, that list has one more name; the MariaDB cell reads the same list through the same sync. Both now name it, so the assertion stays exact. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh --- .../src/sql-driver-widened-declared-unique.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/drivers/driver-sql/src/sql-driver-widened-declared-unique.test.ts b/packages/drivers/driver-sql/src/sql-driver-widened-declared-unique.test.ts index 175ff05d182..c060fccc03d 100644 --- a/packages/drivers/driver-sql/src/sql-driver-widened-declared-unique.test.ts +++ b/packages/drivers/driver-sql/src/sql-driver-widened-declared-unique.test.ts @@ -51,6 +51,8 @@ const ledgerIndexes = [{ fields: ['metadata_type', 'package_id', 'name'], unique const plain = (name: string, columns: string[], unique = true): PhysicalIndex => ({ name, columns, unique }); /** The package-less guard `metadata-protocol` builds at boot: a partial UNIQUE on the narrower key. */ const GUARD_NAME = 'uniq_sys_metadata_activation_packageless'; +/** The `(created_at, id)` index every managed table carries since #33695 (`IMPLICIT_SYSTEM_COLUMN_KEYS`). */ +const DEFAULT_ORDER = `idx_${LEDGER}_created_at_id`; const guard: PhysicalIndex = { name: GUARD_NAME, columns: ['metadata_type', 'name'], unique: true, partial: true }; /** The differ's verdict over the ledger as this release declares it, composed as `detectTableIndexDrift` composes it. */ @@ -447,7 +449,7 @@ declareDialectCell(MYSQL_CELL, 'activation ledger package-less guard on MySQL 8 'SELECT DISTINCT INDEX_NAME AS n FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ?', [LEDGER], ); - expect(stats.map((r: any) => r.n).sort()).toEqual(['PRIMARY', NEW, GUARD_NAME].sort()); + expect(stats.map((r: any) => r.n).sort()).toEqual(['PRIMARY', DEFAULT_ORDER, NEW, GUARD_NAME].sort()); await driver.create(LEDGER, { id: 'a', metadata_type: 'flow', name: 'x', active: false }); // A second row naming no package: refused by the guard. @@ -517,7 +519,7 @@ declareDialectCell(MYSQL_CELL, 'activation ledger package-less guard on MariaDB 'SELECT DISTINCT INDEX_NAME AS n FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ?', [LEDGER], ); - expect(stats.map((r: any) => r.n).sort()).toEqual(['PRIMARY', NEW, GUARD_NAME].sort()); + expect(stats.map((r: any) => r.n).sort()).toEqual(['PRIMARY', DEFAULT_ORDER, NEW, GUARD_NAME].sort()); await driver.create(LEDGER, { id: 'a', metadata_type: 'flow', name: 'x', active: false }); // A second row naming no package: refused by the guard.