Skip to content

fix: partition_drop_plan's drop block carries its body as a literal, not dollar-quoted (#1331 review) - #1334

Merged
jdatcmd merged 4 commits into
commandprompt:mainfrom
OffgridwithJD:fix/1331-drop-literal
Oct 13, 2026
Merged

jdatcmd merged 4 commits into
commandprompt:mainfrom
OffgridwithJD:fix/1331-drop-literal

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

The follow-up to your nit on #1331. A partition name containing $pgcolumnar_drop$ ended the drop block's dollar quote early. As you found, it can't be exploited, but the planned statement failed to parse, so that partition was never dropped.

The fix

The drop block's body is now a string literal: format('DO %L', body), where the body is built with %L for every value. No name can end it. The block refuses with 55000 while the partition is still attached, exactly as before. The alpha5 install script and the alpha4 upgrade script carry identical patches.

The arm, in both twins

A partition named "dq$pgcolumnar_drop$1" ("xq$pgcolumnar_drop$a" in the twin) must drop as planned: every statement runs, the partition is gone, and its sibling stays attached. A premise checks that the fixture's name really holds the tag.

  • Red first on PG17 at 614eb02 (main): the shell twin read failed: DO $pgcolumnar_drop$ …. The pytest twin went red at this same arm, run from a scratch copy that expects main's plan text so that only this arm could fail.
  • Green: partition_lifecycle.sh 52/52 and test_partition_lifecycle.py 2/2 on each of PG15–19.
  • PG17: native_upgrade_converge and docs_style pass.
  • Guard half: 419/419.

Ledger: two rows. The arm is dated by the red run on main's drop, and its premise arrives never. 1804 → 1805, and the gate gives rc=0.

The plan text changed shape, so both twins' gdrop helpers now build the literal form. Every existing arm that compares the plan text passes with them.

🤖 Generated with Claude Code

jdatcmd and others added 4 commits October 13, 2026 15:48
…rop as planned, red (commandprompt#1331 review)

Red on PG17 at 614eb02: the DO block's body ends at the tag inside the
quoted partition name, so the statement fails to parse and the partition
stays. Not exploitable (jdatcmd's probe), but the plan does not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not dollar-quoted (commandprompt#1331 review)

A partition name holding $pgcolumnar_drop$ ended the DO block's dollar quote
and the statement failed to parse. The body is now format('DO %L', ...), so
no name can end it. partition_lifecycle.sh 52/52 on PG17; identical patches
in both scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ar-quote tag (commandprompt#1331 review)

Red against main's dollar-quoted drop (a scratch copy of this file with main's
plan text, so only the new arm can fail); green with the fix. compare_to_bash:
nothing missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndprompt#1331 review)

Ledger 2311 / 1805, gate rc=0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 6dc5751. The whole body now goes through %L inside DO %L, so no partition name can end it, and the RAISE message travels as an argument, so its % reaches RAISE untouched.

PG19 at this head: partition_lifecycle.sh 52/52 and test_partition_lifecycle.py 2 passed. That includes the new arm, a partition named with the old dollar-quote tag dropped by the plan as returned, which is red on main's dollar-quoted body.

Ledger: two rows over main's 2309; 1805 never red equals the budget; the never row is a premise. Merging when CI is green on this head.

@jdatcmd

jdatcmd commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Merging: approved at 6dc5751, and CI is green on that head.

@jdatcmd
jdatcmd merged commit add4450 into commandprompt:main Oct 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants