Skip to content

main red: on live MySQL, dropping a removed literal DEFAULT (#36245) leaves a NOT NULL column with no default, so unset inserts fail #36596

Closed

Description

@objectstack-fleet

triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

Filing gate ① · Source: fleet · found by the triage patrol on main CI.

What happens

Main's push CI has been red since 00:50Z on 2026-11-23. The four push runs since then failed (00:50, 01:06, 01:32 and 01:37; latest 45095572904 at 79d9c14355). The failing job is Temporal Conformance (live PG + MySQL), step "Run driver-sql suite against both live servers". 2 tests fail out of 7,006:

FAIL src/sql-driver-36245-stale-literal-default.test.ts > live cell budget (60000 ms) >
  #36245 §2 — a literal DEFAULT follows the declaration across two boots (live mysql)
Error: insert into `os36245_pref` (`id`, `title`) values ('after', 'after') -
  Field 'digest' doesn't have a default value

The fix for #36245 (PR #36564) drops a physical column DEFAULT that the metadata no longer declares. On MySQL the column is still NOT NULL, so after the drop an insert that leaves the field unset is refused, instead of storing null. That breaks the new test, and on a real MySQL deployment it would break every unset write to such a field. #36245's own "Read first" line named the NOT NULL with-default case (#33724's in-place relax is the precedent).

Done when

reach: main is red for every PR's base, and every MySQL deployment that upgrades past PR #36564 with a removed literal default on a NOT NULL column. Measured on main CI.
Business reason: main is red, and a MySQL customer's writes would fail.
Reader: domain:server (driver-sql schema sync). Follow-up of #36245 (closed).
Grade: p1. Main is blocked, and a common write fails on MySQL.

Activity

  1. added
    bug
    priority:p1
    pm:queue
    domain:server
    on Nov 23, 2026
  2. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim: PM loop round 2 · 2026-11-23T01:48Z
    Session: session_01JQwxbZeHNsF3RWcWpj7rGj
    Thread session: session_01JQwxbY6wSVQZ9QBM4hLeYw
    Account: os-warren
    Branch: the card thread's own branch, named at its first push; the seat amends this claim then
    Worktree: objectstack-issue-36596
    Domain: domain:server
    Seat: repo:objectstack#1
    Area: card thread #36245 (w1-T1), reopened for this follow-up; it carried the fix that turned main red
    Dispatch: triage's knock on this seat's mailbox (#36555 comment 7089408720) naming this seat as #36245's carrier
    File surface: packages/drivers/driver-sql/**, one changeset (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: opus — dispatch-gates --tier: no path-derived mandate, default tier (M, design judgement); the thread's first report states the served tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the platform's schema sync in objectstack (packages/drivers/driver-sql), this seat's own #36245 fix (PR #36564) | no platform path covers it today | every MySQL deployment past PR #36564 with a removed literal default on a NOT NULL column; measured on main CI run 45095572904
    Thread-read: 7089408720
    Premise: holds as filed (main CI red at 79d9c14 on the live MySQL leg); the card thread re-runs the live MySQL cell before code and stops on a miss
    Serial constraints cleared: no open PR names #36596; #36570 (stopgap removal) is Blocked-by #36564 and touches the hook, not driver-sql

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 23, 2026
  4. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim amendment · 2026-11-23T02:08Z — the card thread's branch is named; it completes claim 7089433563.
    Branch: claude/project-thread-a7tzee
    PR: #36600 (draft, head f972c24). Premise corrected by the thread on live MySQL 8.0.46: the column is nullable, and the failure is MySQL 8's DROP DEFAULT leaving no default at all (ER 1364). The nullable arm now sets DEFAULT NULL; a NOT NULL column pairs the drop with relax_not_null (needs_confirm) or is left alone as a destructive entry. The test is not narrowed. Seat L1 follows the thread's full report.

  5. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbY6wSVQZ9QBM4hLeYw
    os-dev-report

    {
      "issue": 36596,
      "status": "done",
      "branch": "claude/project-thread-a7tzee",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36600",
      "head": "f972c24ced205938213adc96316ec3b08d055b0f",
      "session": "session_01JQwxbY6wSVQZ9QBM4hLeYw",
      "premise_still_valid": false,
      "summary": "Reproduced on live MySQL 8.0.46 at main 79d9c143: both #36245 §2 MySQL cases fail with ER 1364 \"Field 'digest' doesn't have a default value\"; PG passes. PREMISE CORRECTION: the column is NOT left NOT NULL (IS_NULLABLE=YES throughout). The cause is MySQL 8's ALTER COLUMN ... DROP DEFAULT, which leaves even a nullable column with no default at all, so a strict-mode insert that omits it is refused; SET DEFAULT NULL stores NULL (measured by hand). Round 1 was validated on MariaDB 10.11, where DROP DEFAULT stores NULL. Fix (packages/drivers/driver-sql/** + 1 changeset): (1) MySQL drop_column_default on a nullable column runs SET DEFAULT NULL, NOT NULL keeps DROP DEFAULT (also covers the #4560 token arm). (2) A NOT NULL column with a stale literal DEFAULT and no declared default: the drop never travels alone. If the differ proposes relax_not_null (storage.notNull:false in words, or no storage declaration and not required, not the ceremony tenant column) the drop is emitted needs_confirm paired with it; publish and package install (#33724) select both when the field declares storage.notNull:false; os migrate apply applies both; afterwards an unset insert stores NULL on all three dialects. Otherwise (storage.notNull:true, required, ceremony column) the column is left alone and the entry is destructive, so it is warned at boot and listed by os migrate plan, never applied by a non-destructive door. Dev auto-reconcile applies neither, per ADR-0113 D5.",
      "tests": "Test file kept whole (no skip/quarantine/narrowing); new §3 adds 4 NOT NULL cases per dialect cell. In-container live servers with CI's own setup (MySQL 8.0.46 time_zone +08:00, PG 16 Asia/Shanghai, TZ=America/New_York, OS_EXPECT_LIVE_DIALECT_MATRIX=1, pnpm --filter @objectstack/driver-sql test): file 51/51 on sqlite, live postgres, live mysql. Full suite at f972c24c: Test Files 1 failed | 280 passed | 1 skipped; Tests 1 failed | 7007 passed | 10 skipped. The one failure (sql-driver-11565-row-byte-budget 'reports InnoDB page-limit refusals') fails identically at origin/main 79d9c143 against the same local server (main's src checked out, same command) and is green in main's CI mysql:8.0 image: environment, not this PR. Ablations via scripts/ablation-replace.mjs, each restored blob==HEAD: A1 MySQL back to DROP DEFAULT -> 4 red (both §2 MySQL ER 1364 + 2 §3 MySQL paired cases); A2 NOT NULL drop safe/unpaired as on main -> 9 red; A3 publish/install not selecting the paired drop -> 3 red; A4 pair even when NOT NULL is declared -> 6 red. Logs: /mnt/project-files/issue-36596/.",
      "gates": "Local derived set (dispatch-gates --commands, 70 families) at f972c24c: 67 exit 0 first pass; check-plugin-teardown-shape --self-test exit 3 (shallow clone) -> exit 0 after git fetch --unshallow; check:dual-build-cjs-loads and check:lean-entry-closure exit 3 while overlapping the live suite -> exit 0 on rerun. 70/70 green. driver-sql tsc --noEmit exit 0 (first push 26d6cd30 had one TS2345, fixed in f972c24c). check:facade-delegation-only green (sql-driver.ts untouched). PR #36600 check-runs at f972c24c: 57 total, 39 success, 18 skipped, 0 failed. Temporal Conformance (live PG + MySQL) is SKIPPED on the PR (path filter in .github/workflows/ci.yml): making it run on a driver-sql PR is a governed Tier H change outside this card's file surface, so not made; in-container evidence pasted in the PR body instead. Gate results: /mnt/project-files/issue-36596/gate-results-f972c24c.tsv.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "github get_job_logs x1, pull_request_read get_check_runs x2, plus schema loads; no write tool",
      "api_writes": "relay strokes: pr_create (#36600, run 45097510621, 4504 bytes read back identical), issue_patch PR body (run 45098367466, 7844 bytes identical), and this os-dev-report via post-stamped; git push x2 (not REST)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: docs · reach: low · content/docs/deployment/cli.mdx publish paragraph lists only safe changes + the declared relax; the publish now also applies the paired drop_column_default. Outside file surface, not edited · dedupe words: publish column changes doc, paired default drop · carrier: none",
        "class: ci · reach: medium · Temporal Conformance (live PG + MySQL) is path-filtered off on PRs, which is how #36564 reached main red; making it run for driver-sql PRs needs a governed ci.yml change · dedupe words: temporal conformance skipped on PR, live MySQL leg PR · carrier: none",
        "class: bug-latent · reach: low · MySQL relax_not_null uses MODIFY ... NULL, which also drops a declared literal DEFAULT (measured NOT NULL DEFAULT 'x' -> DEFAULT NULL); the #36245 set_column_default arm restates it on the next sync. Pre-existing · dedupe words: MODIFY drops default, relax loses default · carrier: none"
      ]
    }
  6. removed
    pm:dispatched
    on Nov 23, 2026
  7. added a commit that references this issue on Nov 23, 2026
    89ce4fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:serverpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions