Skip to content

mappedResultsQuery splits rows in 2 subsets with key null when there are functions in SELECT parameters #149

@pedropastor

Description

@pedropastor

This query:
SELECT index, mac::text, imei, backend, status, lockstatus,
powerstatus, id, chargestatus, lastping::timestamptz,
public.ST_AsText(lastpos) AS lastpos
FROM iotdevices
WHERE backend = "backend01"

Instead of returning this:
{iotdevices: {index: 5, mac: e2:40:8b:ff:fe:48:02:63, imei: 867584031544559, backend: back01, status: OK, lockstatus: 1, powerstatus: 45, id: 010115, chargestatus: false, lastping: null, lastpos: null}}

It is incorrectly returning this, and I am not finding a way to retrieve the data from it properly:
{iotdevices: {index: 5, imei: 867584031544559, backend: back01, status: OK, lockstatus: 1, powerstatus: 45, id: 010115, chargestatus: false, lastping: null}, null: {mac: e2:40:8b:ff:fe:48:02:63, lastpos: null}}

I guess there is some issue behind mapped query, and the execution (it may treat the query as 2 separate ones). When tested directly in DB works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions