#463 listsHosts can generate an invalid SQL query
Closed: Fixed 5 years ago Opened 5 years ago by puiterwijk.

If the listsHosts API function is called, but with arch being an empty list (rather than None), the hub generates the following query:

[Sun Jun 18 21:48:59.793991 2017] [:error] [pid 16950] SELECT id, user_id, name, arches, task_load, capacity, description, comment, ready, enabled
[Sun Jun 18 21:48:59.793995 2017] [:error] [pid 16950]   FROM host
[Sun Jun 18 21:48:59.793999 2017] [:error] [pid 16950]   JOIN host_channels on host.id = host_channels.host_id
[Sun Jun 18 21:48:59.794001 2017] [:error] [pid 16950]  WHERE (())
[Sun Jun 18 21:48:59.794003 2017] [:error] [pid 16950]    AND (host_channels.channel_id = 1)
[Sun Jun 18 21:48:59.794006 2017] [:error] [pid 16950]    AND (enabled is true)

And WHERE (()) is not valid SQL.

This problem comes from hub/kojihub.py, line 10501-10507.


Metadata Update from @tkopecek:
- Issue set to the milestone: 1.13

5 years ago

Commit 1a7074d relates to this ticket

Login to comment on this ticket.

Metadata