Repository navigation
fix(engine) #2378: SELECT * stops filtering properties the schema marks hidden - #5939
Conversation
…ks hidden #2378 removed database-level support for hidden properties in 2025, but left the filter in Projection: for `SELECT *` it skipped any alias whose schema property was marked hidden, while a bare `SELECT` returned the record's own names and never filtered anything. The two spellings of "give me everything" have disagreed ever since. Nobody saw it because Projection also sets the element on the row, and ResultInternal.getPropertyNames() used to union the element's names over the content's, putting the filtered name straight back. #5613 stopped merging them (to keep a Cypher `RETURN n` from emitting every type property as a null column) and left the year-old filter exposed, which is what has had CreatePropertyStatementExecutionTest.createHiddenProperty - and with it the whole unit-tests job - red on main ever since. Measured on ea4f6af before this change: SELECT * FROM Plain -> [name, extra, @Rid, @type] SELECT * FROM Hid -> [extra, @Rid, @type] <- hidden `name` dropped SELECT FROM Hid -> [name, extra] <- hidden `name` returned So the filter goes, finishing what #2378 started. `hidden` stays as a schema annotation: ALTER PROPERTY still records it, AbstractProperty still exposes it, and schema introspection still reports it - none of that is touched. Only the read path stops honouring it. Hiding a property from a projection but not from the record behind it was never a security boundary; it only made two queries that should agree return different rows. The inner `else if` branch goes with it: its only other condition was an excludes check the line above already performs, so removing the hidden clause left it dead. `!prop` exclusion syntax is unaffected and now has its own test. Tests: createHiddenProperty passes as written for the first time since #5613. hiddenPropertyIsReturnedByEverySpellingOfSelectAll pins `SELECT *` and bare `SELECT` to the same answer and asserts the schema flag survives; selectStarStillHonoursExplicitExclusions guards the loop simplification. Mutation-checked by restoring the filter: both go red, the new one reporting `got [plain, @Rid, @type]`. Full com.arcadedb.query.** sweep: 10598 tests, the only failure is Issue4305Test.pointRaisesCleanErrorOnNonNumericString, which fails identically on a clean ea4f6af checkout and comes from #5909 landing after this branch's base.
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -6 |
🟢 Coverage ∅ diff coverage · -6.40% coverage variation
Metric Results Coverage variation ✅ -6.40% coverage variation Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (ea4f6af) 152855 117429 76.82% Head commit (45662e9) 185198 (+32343) 130415 (+12986) 70.42% (-6.40%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#5939) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
ReviewVerified by reading Correctness
Test coverage - good, and appropriately targeted:
Minor nit (non-blocking): the inline comment block in Security: No concern. Hiding a schema property was never enforced anywhere else in the read path (bare Performance: Net positive - one fewer type/property lookup ( Scope: Tight - one production file, one test file, no unrelated changes. The PR description is thorough and the noted pre-existing unrelated failure ( Overall: a well-reasoned, well-tested fix for a real regression that's been red on |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5939 +/- ##
==========================================
+ Coverage 68.03% 68.06% +0.02%
==========================================
Files 1797 1797
Lines 152855 152855
Branches 32397 32397
==========================================
+ Hits 103999 104036 +37
+ Misses 35466 35437 -29
+ Partials 13390 13382 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Finishes #2378.
What was left behind
#2378 removed database-level support for hidden properties in 2025, but left the filter in
Projection: forSELECT *it skipped any alias whose schema property was markedhidden, while a bareSELECTreturned the record's own names and never filtered. The two spellings of "give me everything" have disagreed ever since.It stayed invisible because
Projectionalso sets the element on the row, andResultInternal.getPropertyNames()used to union the element's names over the content's - putting the filtered name straight back. #5613 stopped merging them (to keep a CypherRETURN nfrom emitting every type property as a null column) and left the year-old filter exposed.That is what has had
CreatePropertyStatementExecutionTest.createHiddenProperty, and with it the wholeunit-testsjob, red onmain.Measured on
ea4f6af30before this change:The change
The filter goes.
hiddenstays a schema annotation exactly as #2378 intended -ALTER PROPERTYstill records it,AbstractPropertystill exposes it, schema introspection still reports it. Only the read path stops honouring it. Hiding a property from a projection but not from the record behind it was never a security boundary; it only made two queries that should agree return different rows.The inner
else ifgoes with it: once the hidden clause was removed its only other condition was anexcludescheck the line above already performs, leaving it dead.Tests
createHiddenPropertypasses as written for the first time since openCypher: returning a whole vertex also emits the type's declared properties as null columns (1.6x the JSON of the same SQL MATCH answer) #5613.hiddenPropertyIsReturnedByEverySpellingOfSelectAllpinsSELECT *and bareSELECTto the same answer, and asserts the schema flag survives.selectStarStillHonoursExplicitExclusionsguards the loop simplification -SELECT *, !secretstill excludes.got [plain, @rid, @type].Full
com.arcadedb.query.**sweep: 10598 tests, one failure -Issue4305Test.pointRaisesCleanErrorOnNonNumericString, which fails identically on a cleanea4f6af30checkout and comes from #5909 landing after this branch's base. Unrelated to this diff, but note it will keepunit-testsred after this merges.