Repository navigation
fix(driver-sql): a plain index MySQL refuses to key no longer skips the object's remaining boot steps - #38225
Conversation
…bject's remaining boot steps Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
…e, live MySQL and PostgreSQL Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
…isposition is documented at the body Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 15 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6f7e8242f4ad28dc7152cc844db172d1bef2989d && git checkout 6f7e8242f4ad28dc7152cc844db172d1bef2989d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f19350b410df08db604881848b2c370047a114f2 0da725c4674955b5e266fe9778fc9928f9af0f3b && git checkout -B drift-repro f19350b410df08db604881848b2c370047a114f2 && git merge --no-ff 0da725c4674955b5e266fe9778fc9928f9af0f3b
node scripts/docs-audit/affected-docs.mjs --json f19350b410df08db604881848b2c370047a114f2 |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Seat reading, head Judged a flake ⇒ the seat re-runs the failed jobs of run 46125233126 once through |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 L1: ACCEPT · head Seat checks
Landing: non-governed, ≤3000 lines. The seat lands it through the ordinary queue. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46138308401 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Part of #35862 — this lands the card's half (B), the bounded one it orders first. Half (A) stays open on the card: converging an old MySQL TEXT column to its declared varchar(n), then the inbox index itself, which this dispatch excluded (it belongs to the other half of #35530).
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
syncDeclaredIndexes(packages/drivers/driver-sql/src/sql-driver-schema-sync.ts): when MySQL refuses to key a PLAIN index (ER_BLOB_KEY_WITHOUT_LENGTHorER_TOO_LONG_KEY, the codesexplainUnkeyableTextColumnrecognises), the refusal is still logged once aterrorthroughlogDurabilityFailurewith the same field-level remedy, and the loop nowcontinues instead of throwing. The index is still not created and still not substituted: no prefix index, no hash shadow (the existing scope limit for non-unique indexes).initObjectsrejected for the object, so every index declared after the refused one was never attempted, andretireIndexesNamedForOldKeys,reconcileAndWarnDrift, the four canonical backfills andmigrateMysqlDatetimeColumns/migrateMysqlTimeColumnsnever ran for that table, on every boot.initObjects/syncTableIndexes: the throw is the defect; a catch further up would still lose every index after the refused one in the same loop, and would also swallow the UNIQUE case the card keeps.Tests
sql-driver-35862-refused-plain-index-boot-steps.test.ts:knex.schema.alterTablewith MySQL's own error shape, for both codes. Pins: oneerrorline naming the object and the index; the refused index absent; the index declared after it built; every later boot step (8 named) called for the table; the drift report's warn line present. CONTROL: the same refusal on a UNIQUE index still rejects withcode: 'ER_BLOB_KEY_WITHOUT_LENGTH'and the named refusal.user_idfrom the release before the bound, then the release that declaresmaxLength: 255and a plain(user_id, created_at)index plus aseen_atindex. On MySQL: the column is still TEXT (the premise), the plain index is absent with no shadow column, one error line, theseen_atindex built, and a legacyTIMESTAMPseen_atwidened todatetime(3)(the last stepinitObjectsruns). CONTROL on PostgreSQL and SQLite: the index is built directly, no error line.maxLength: 1024text column is still carried on a hash shadow (whole key part,SUB_PARTnull,NON_UNIQUE0).initObjectsREJECTS for a non-unique unkeyable index (sql-driver-11627-hash-shadow-key.test.tsone,sql-driver-keyed-text-mysql.test.tstwo). They pinned exactly the throw this change removes; they now read the same named refusal from theerrorchannel and keep their negative half (no index keys the column, no shadow column).Temporal Conformance (live PG + MySQL), step "Run driver-sql suite against both live servers" (it runs this whole package withOS_TEST_MYSQL_URLandOS_TEST_POSTGRES_URLset andOS_EXPECT_LIVE_DIALECT_MATRIX=1). The SQLite layer also runs inTest Core.Acceptance notes
os migratearm", refusing with the offending rows named when a stored value is longer than n. That choice is open, and neither alternative named in the dispatch fits: a hash shadow is ruled out for non-unique indexes by the existing scope limit (a digest serves no lookup), and a prefix index is a valid access path for a plain index but is not what the card asks for. No code for (A) is in this PR.explainUnkeyableTextColumnwrites ends with "so any uniqueness it declared is currently unenforced" and a sentence about UNIQUE prefix indexes; on a plain index both are true but beside the point. Left as is: the line is shared with the UNIQUE path.SqlDriver#syncDeclaredIndexes's docblock insql-driver.tslists the dispositions; a bullet for this one would push the facade over its line ceiling (check:facade-delegation-only, 10071 lines, 0 left), so the disposition is documented at the body insql-driver-schema-sync.tsinstead.Verification
Read first, by risk:
packages/drivers/driver-sql/src/sql-driver-schema-sync.ts, the newif (!unique)arm afterthis.logDurabilityFailure(unkeyable, msg): the only behaviour change.packages/drivers/driver-sql/src/sql-driver-35862-refused-plain-index-boot-steps.test.ts, therefuseIndexesfake: it decides the refusal from the index thealterTablecallback declares, and passes everything else to the real knex.packages/drivers/driver-sql/src/sql-driver-keyed-text-mysql.test.ts, the two rewritten pins.Two-minute check:
pnpm --filter @objectstack/driver-sql exec vitest run sql-driver-35862printsTests 4 passed | 3 skipped (7)with no server (the 3 skipped are the live PostgreSQL and MySQL cells); withOS_TEST_MYSQL_URLandOS_TEST_POSTGRES_URLset it printsTests 7 passed (7).Readings, all at head
f1c4549df3, on local MySQL 8.0.46 (server zone +08:00) and PostgreSQL 16 (Asia/Shanghai), processTZ=America/New_York,OS_EXPECT_LIVE_DIALECT_MATRIX=1:The three touched files on live MySQL + PostgreSQL: 26/26
vitest run sql-driver-35862 sql-driver-11627-hash-shadow-key sql-driver-keyed-text-mysql:Test Files 3 passed (3),Tests 26 passed (26).Ablation: the fix removed, 6 red and every CONTROL green
scripts/ablation-replace.mjsreplaced the anchorif (!unique) {withif (false) {(anchor 1 to 0, blob 3fbbf2dfc9e7 to c0aaa9b00fb7) and ran the same three files:Tests 6 failed | 20 passed (26). Red: both faked refusals, the live MySQL upgrade (it rejected withER_BLOB_KEY_WITHOUT_LENGTHonidx_os35862_inbox_user_id_created_at, which is the card's premise, measured), and the three rewritten pins. Green: the UNIQUE CONTROL, the PostgreSQL and SQLite upgrade CONTROLs, the live hash-shadow CONTROL. Restored: blob equals HEAD (3fbbf2dfc9e7),git diff HEADempty.Whole driver-sql suite: 7052 passed, 1 failed, both failing files environmental
pnpm --filter @objectstack/driver-sql exec vitest run --maxWorkers=2:Test Files 2 failed | 283 passed | 1 skipped (286),Tests 1 failed | 7052 passed | 12 skipped (7065). The two files:sql-driver-37095-pgvector-extension(the local PostgreSQL has no pgvector extension; CI uses the pgvector image) andsql-driver-11565-row-byte-budget"reports InnoDB page-limit refusals" (fails identically with the fix ablated, so it is this local server, not this diff).pnpm --filter @objectstack/driver-sql typecheck: exit 0.Derived gate families: 67 exit 0, 2 not measured
dispatch-gates.mjs --commands(5 paths vs merge base 7605e0c) derived 69; all run;--ranreconciliation: 67 run, 2 NOT MEASURED. The two arecheck:dual-build-cjs-loadsandcheck:lean-entry-closure, both exit 3 PREREQUISITE NOT MET (they read built output of the whole workspace, not built here); CI runs them.Generated by Claude Code