Repository navigation
Use a trusted search path for internal SPI queries - #8955
Open
ibrahim halatci (ihalatci) wants to merge 1 commit into
Open
ibrahim halatci (ihalatci) wants to merge 1 commit into
ibrahim halatci (ihalatci) wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ihalatci-main-metadata-cleanup-authorization #8955 +/- ##
=============================================================================
Coverage 88.81% 88.81%
=============================================================================
Files 290 290
Lines 65502 65512 +10
Branches 8261 8261
=============================================================================
+ Hits 58176 58185 +9
Misses 4941 4941
- Partials 2385 2386 +1 🚀 New features to boost your workflow:
|
Resolve internal SPI queries through pg_catalog rather than the caller's search path. Preserve the existing GUC restoration semantics and cover operator lookup with an adversarial regression. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ibrahim halatci (ihalatci)
force-pushed
the
ihalatci-main-trusted-search-path
branch
from
October 26, 2026 10:46
b69a4d9 to
6734dfc
Compare
ibrahim halatci (ihalatci)
enabled stacked auto-merge (squash)
October 26, 2026 11:48
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.
DESCRIPTION: Uses a trusted search path for internal SPI queries
Stacked on #8954; this PR contains only the trusted-search-path layer for main, ported from #8944.
Use the existing PushEmptySearchPath()/PopEmptySearchPath() helpers around internal SPI execution in ExecuteQueryViaSPI, TableEmpty, ExecuteCommandAsSuperuser, EnsureParentSessionHasExclusiveLockOnPgDistNode, and LockAcquireHelperMain. This prevents caller-controlled operator lookup while retaining the helpers' existing error/GUC restoration behavior.
Add the adversarial oid-equality regression force_search_path_in_execute to multi_1_create_citus_schedule and update affected schema-qualified expectations, including citus_local_tables_mx. No SQL migration, privilege, version, or packaging changes.
Validation on PostgreSQL 18.6 in isolated WSL source/runtime directories, using main plus #8954 and this layer:
./configure— passed.make -s -j8— passed.make -s install-all— passed.make -s -C src/test/regress check-minimal EXTRA_TESTS='multi_behavioral_analytics_create_table force_search_path_in_execute alter_distributed_table alter_table_set_access_method merge undistribute_table'— passed 12/12.make -s -C src/test/regress check-multi-mx— passed 69/69, including citus_local_tables_mx.make -s -C src/test/regress check-multi-1— passed 210/210.uncrustify -c <pinned-tools-0.8.33>/etc/citustools/citus-style.cfg --check src/backend/distributed/commands/alter_table.c src/backend/distributed/commands/create_distributed_table.c src/backend/distributed/metadata/distobject.c src/backend/distributed/metadata/node_metadata.c src/backend/distributed/utils/acquire_lock.c— passed with Uncrustify 0.82.0.bash ci/normalize_expected.shandbash ci/sort_and_group_includes.sh— no content changes.git diff --cached --check— passed; all 13 changed files match the validated Linux sources after line-ending normalization.Negative control:
make -s -C src/test/regress check-minimal EXTRA_TESTS='force_search_path_in_execute'against an independently built, unchanged #8954 parent fails as expected: 107 untrusted operator calls instead of 0. With this layer the count is 0.The initial focused invocation omitted multi_behavioral_analytics_create_table and failed alter_distributed_table's colocation expectation; the documented prerequisite was restored for the passing 12/12 run above.