Repository navigation
Fix create_archive: operator precedence, malformed zip bytea literals, repo scoping - #68
Merged
Merged
Conversation
…ping
create_archive errored on every call:
- tar path: `tf.path || '/' || e->>'name'` parsed as
`(tf.path || '/' || e) ->> 'name'` because || binds tighter than ->>,
raising "operator does not exist: text ->> unknown". Parenthesized the
accessor.
- zip path: the header/footer bytea literals '\x50\x4B\x03\x04' repeated the
\x prefix, which the bytea hex input format rejects as "invalid hexadecimal
digit". Use single-prefix literals ('\x504B0304' / '\x504B0506').
Also scope the tree-ish resolution, tree walk and blob join to the target
repository (they previously matched objects across all repositories), and
qualify the archived columns via their table aliases.
Add test/sql/archive_test.sql covering tar output (non-empty, embeds file
paths, explicit-commit form) and the zip PK signature. Wired into the core
suite.
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.
Summary
create_archiveerrored on every call, in two different ways depending on the format.Bugs fixed
tf.path || '/' || e->>'name'parsed as(tf.path || '/' || e) ->> 'name'because||binds tighter than->>, raisingoperator does not exist: text ->> unknown. Parenthesized the accessor.'\x50\x4B\x03\x04'repeat the\xprefix; PostgreSQL's bytea hex input takes a single\xprefix followed by all hex digits, so it rejected them withinvalid hexadecimal digit: "\". Use'\x504B0304'/'\x504B0506'.repo_id; they now are, and the archived columns are qualified via their table aliases.Tests
test/sql/archive_test.sql(5 assertions): tar output is non-empty, embeds both file paths, and works with an explicit commit; the zip archive begins with thePK\x03\x04signature. Wired into the core suite.Verification
make test-core— PASS (full suite green against PostgreSQL 16).🤖 Generated with Claude Code
Generated by Claude Code