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

db_read_values_by_count should also order by "ns desc", not just by "clock desc".

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: False Positive
    • Icon: Trivial Trivial
    • None
    • 7.4.0beta1 (master)
    • Server (S)
    • None

      In db_read_values_by_count (src/libs/zbxhistory/history_sql.c), I noticed that the query ordering is specified as

                      zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, " order by clock desc");

      However this means that values occurring within the same second are returned in an unspecified order, even though the order within the second is known (ns field).  Shouldn't it be

                      zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, " order by clock desc, ns desc");

      ?

      Rummaging around in the same source file, it seems that db_read_values_by_time_and_count has the same issue.

       

            zabbix.support Zabbix Support Team
            duncan.sands Duncan Sands
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: