[BUG]: Misuse of variable in UID function fails silently
Open
Nobody has claimed this yet.
dgraph
exp/beginner
kind/bug
Stale
- Dominant language
- Go
- Stars
- 21.8k
- Forks
- 1.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 9
Description
What version of Dgraph are you using?
latest
Tell us a little more about your go-environment?
N/A
Have you tried reproducing the issue with the latest release?
Yes
What is the hardware spec (RAM, CPU, OS)?
N/A
What steps will reproduce the bug?
Run a query like this
q(func: uid(val(A)) )
Expected behavior and actual result.
q(func: uid(val(A)) ) = Silent return it should fail
q(func: uid(A) ) = Correct one.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported query q(func: uid(val(A))) and compare it with q(func: uid(A)). Trace the UID query handling and add a regression test showing that misuse produces an error instead of silently returning; the issue is done when the invalid form fails clearly while the valid form still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100