Repository navigation
fix(security)!: count-only limit=0, CSV newline fidelity, reserved ~ names everywhere - #104
Merged
Merged
Conversation
…names everywhere A root limit=0 was costed at 1 but still projected its look-ahead row, running every embed, spread and computed column under it. The selection is now compiled for validation and discarded: the look-ahead row reads only the root, so the statement does what the estimate prices. CSV records are written by a small RFC 4180 writer: CR and LF inside a value are quoted and copied byte for byte (encoding/csv with UseCRLF dropped a bare CR and rewrote LF as CRLF), records still end in CRLF and formula escaping is unchanged. Every query-string resolver now treats ~-prefixed names only through the reserved namespace: casts, JSON paths and aggregates in select=, JSON-path, distance and related order= terms, distinct=, on_conflict= and columns= answer like the plain forms. select=* and JSON bodies still reach such a column. 401/403 answers from authentication carry Vary: Accept; preflight responses already vary on Origin and are now covered by tests. server.request_timeout must be at least 1s. A contract keeps functions returning arrays of rows of a table it shows (regression test; the reported 404 came from a function created after the server booted). BREAKING CHANGE: server.request_timeout below 1s (including 0, which disabled the timeout) is a configuration error, and a column named ~x can no longer be named by casts, JSON paths, aggregates, distinct=, on_conflict= or columns=.
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.
Closes #100, closes #101, closes #102
limit=0. The root selection is compiled (so it is validated) and then discarded; the look-ahead row that decideshas_nextprojects nothing and runs no embed, spread or computed column. Cost stays 1, which now matches what runs. Also coversSETOF <table>RPCs. Goldens:limit_zeroupdated,limit_zero_rpcandlimit_zero_paramsadded (parameter renumbering after the discarded selection).encoding/csvis replaced by a small RFC 4180 writer: CR/LF inside values are quoted and kept byte for byte, records end in CRLF, formula escaping unchanged.~names. OnequeryFieldhelper is used by every query-string resolver (casts, JSON paths, aggregates, everyorder=form,distinct=,on_conflict=);columns=rejects them too.select=*and JSON bodies still reach such a column.Vary: Accepton 401/403 from auth; preflightVary: Originwas already set by pdbcore and is now pinned by tests;server.request_timeoutmust be>= 1s(breaking,docs/upgrading.mdrow).docs/contracts.mdnotes that contracts are built once at boot without watch mode.Tests: unit + e2e (
test/e2e_hardening_test.go, each fails onmainand passes here),go test -race ./..., full e2e on PG 18, FuzzFilter/FuzzParse 10s, golangci-lint, actlint-test.