Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17251

API should not create SQL errors if given input is wrong

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 4.0.17, 4.4.5, 5.0.0alpha2
    • API (A)
    • None

      Take host API for example and method get().
      Create a request:

      {
          "output": [
              "name"
          ],
          "hostids": [
              "10511", "10512"
          ],
          "sortfield": "name",
          "countOutput": true
      }
      

      No result is given, but in logs we can see the error:

      Query failed: ERROR: column "h.name" must appear in the GROUP BY clause or be used in an aggregate function

      This is bad.

            zabbix.dev Zabbix Development Team
            iivs Ivo Kurzemnieks
            Team B
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: