SQL left joins behave as inner joins #1563

Open
mapkyca opened this Issue Oct 23, 2016 · 0 comments

Projects

None yet

1 participant

@mapkyca
Collaborator
mapkyca commented Oct 23, 2016 edited

While trying to do this:

Filter based on publish_status, e.g.

$search['publish_status']['$not'] = 'draft';

I encountered this error:

Entities with no metadata value set for publish_status are not returned, despite a left join value for this field should be 'NULL'.

The key needs to be present for each object for it to display, even if an unset value should evaluate to NULL, i.e. not 'draft'

Some other notes:

I suspect this is an artefact caused by joining on a name/value key table, and as a result I can't see a way round it short of rewriting getRecords from the ground up. Mind you, I'm not an SQL expert.

@mapkyca mapkyca changed the title from Mysql left joins behave as inner joins to SQL left joins behave as inner joins Oct 23, 2016
@mapkyca mapkyca added the Bug label Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment