fix: SELECT ... FROM sqlite_master does not compile (#707) - #719
Open
dpsiderius wants to merge 1 commit into
Open
dpsiderius wants to merge 1 commit into
dpsiderius wants to merge 1 commit into
Conversation
resolve_from_table_schema (the single choke point every FROM reference goes through) now recognizes sqlite_master/sqlite_schema and hands back a hardcoded TableSchema rooted at page 1 with its real five-column shape, instead of consulting the decoded catalog (which never contains an entry describing itself). Everything downstream — WHERE, ORDER BY, an empty database — falls out of the ordinary table-scan path for free, matching the oracle exactly, including autoindex rows. Route chosen (make sqlite_master a resolvable table, over adding an API-level indexes() accessor) and recorded in ADR-0042, which supersedes ADR-0029's problem statement for this one table only — the other 9 CLI-layer introspection pragmas ADR-0029 covers are unaffected. spend: roughly matched the medium estimate.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #708 (fix/708-rowid-in-projection) — merge that first.
What
Route 1 chosen and recorded in ADR-0046:
resolve_from_table_schemanowhands back a hardcoded
TableSchema(type,name,tbl_name,rootpage,sql) rooted at page 1 forsqlite_master/sqlite_schema.No synthesized rows, no CLI special-casing — ordinary table-scan codegen
handles
WHERE,ORDER BY, and an empty database.Before/after
Connection::table_names()(added earlier as a workaround) isunaffected; this closes the gap for the general
SELECTpath, includingindex discovery the workaround couldn't reach.
Test plan
tests/corpus/sqlite_master_test.rs— byte-exact vs. the oracle,including a DB with tables + autoindexes + explicit indexes.
make test,make lint,make test-corpus,make check-mvl-limit,make check-mod-files,make assuranceall pass.Refs: 013/Req-3, #705, ADR-0029, ADR-0046
Closes #707
spend: matched estimate