Skip to content

rowid-keyed tables unsupported: rows are keyed by primary key, not rowid #1840

Description

@timsehn

DoltLite keys user-table rows in its prolly tree by the user's primary key
columns rather than by SQLite's auto-allocated rowid (since #358). Rowid is
allocation-order dependent and therefore history dependent, which is a hard
incompatibility with the Dolt model: two branches that independently insert
identical rows have to produce identical row identities, and a
content-addressed tree cannot do that if the key is "whichever integer this
connection handed out first".

Consequences, all of which inherited SQLite testfixture suites exercise:

  • a table without an explicit INTEGER PRIMARY KEY is auto-converted to
    WITHOUT ROWID, so rowid is not an addressable column — WHERE rowid = N
    and ORDER BY rowid error with "no such column: rowid"
  • an unordered SELECT returns user-PK order where stock SQLite returns
    rowid (insertion) order
  • PRAGMA table_info reports non-PK columns differently for auto-converted
    WITHOUT ROWID tables
  • AUTOINCREMENT and sqlite_sequence behavior tied to rowid allocation
  • foreign key SET NULL / SET DEFAULT whose triggering DELETE addresses
    parent rows by rowid

This is the single largest rationale in
test/known_testfixture_divergences.txt — its header block has documented it
at length, but with no issue to point at, so per-suite rows in
test/known_testfixture_exception_inventory.txt had nowhere to attribute it.
This issue is that anchor.

Not expected to be fixed; rowid-keyed storage is incompatible with the
version-control model rather than merely unimplemented.

Attribution status

Attributed so far are the suites whose own recorded reason names rowid
explicitly (25 divergence suites plus btreefault, incrblob, walbig).
That is a floor, not the true count: most rowid-driven suites rely on the
header block instead of repeating the reason inline. Widening the attribution
is a triage pass over the remaining intentional rows and should not be
guessed at in bulk.

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