parse-community / parse-community/parse-server

Incorrect result from Parse.Query on Postgres

Open
#6,991 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

When I try to request some data, I got results which supposed not to be there

Steps to reproduce
let query = new Parse.Query('Foo');
let subquery = new Parse.Query('Bar');
subquery.contains('name', FILTER);
query.matchesQuery('bar', subquery);

The query result also includes all Foo-objects whose 'bar' field is undefined or null, regardless of the value of FILTER.
I think this is wrong behavior.

Server

  • Parse Server version: 4.4.0
  • Operating system: Ubuntu 18.04
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): Postgres
  • Database version: 10.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JS
  • SDK version: 2.17.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Parse.Query and matchesQuery example on PostgreSQL with null and undefined bar fields, then trace the PostgreSQL handling of the matchesQuery entry point. Compare the result with the expected FILTER behavior and add or update coverage so Foo objects without a matching bar are excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgres
Domain
backend-api-design, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.