ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7687

Using camel-case aliases in queries with PosgreSQL

    Details

      Description

      There are some places in the frontend where we use camelCase aliases for columns in an SQL query, but PostgreSQL always returns results with lower-case keys. One of the problems it causes is that a template.get request in 2.2 returns unnecessary data:

      {
      "output": "refer",
      "parentTemplateids": 10050,
      "limit": 1
      }
      
      {
          "jsonrpc": "2.0",
          "result": [
              {
                  "parenttemplateid": "10050",
                  "templateid": "10001"
              }
          ],
          "id": 1
      }
      

      It may cause other problems too. We'll need to check all usages of aliases in the frontend and convert them to lower case. As far as I understood, the C side uses only lower-case aliases, so it shouldn't have any problems.

        Activity

        Hide
        Pavels Jelisejevs (Inactive) added a comment -

        I've added it to the coding guidelines https://www.zabbix.org/wiki/SQL_coding_guidelines

        Show
        Pavels Jelisejevs (Inactive) added a comment - I've added it to the coding guidelines https://www.zabbix.org/wiki/SQL_coding_guidelines
        Hide
        Pavels Jelisejevs (Inactive) added a comment - - edited

        Turned out that there are only two cases of camel case usage and one of them is a regression from ZBX-7660.

        Fixed directly in 2.2.2rc1 r41765.

        Show
        Pavels Jelisejevs (Inactive) added a comment - - edited Turned out that there are only two cases of camel case usage and one of them is a regression from ZBX-7660 . Fixed directly in 2.2.2rc1 r41765.
        Hide
        Eduards Samersovs (Inactive) added a comment -

        Tested

        Show
        Eduards Samersovs (Inactive) added a comment - Tested
        Hide
        Pavels Jelisejevs (Inactive) added a comment -

        CLOSED.

        Show
        Pavels Jelisejevs (Inactive) added a comment - CLOSED.

          People

          • Assignee:
            Unassigned
            Reporter:
            Pavels Jelisejevs (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: