SQL statement affect on nodes synchronization

XMLWordPrintable

    • Type: Incident report
    • Resolution: Won't fix
    • Priority: Major
    • 1.8.4
    • Affects Version/s: 1.8.3
    • Component/s: None
    • None
    • Environment:
      Error in Zabbix Server code independent from platform.

      In file nodesender.c there is statement like this:
      /* Find updated records */
      result = DBselect("select curr.tablename,curr.recordid,prev.cksum,curr.cksum,prev.sync "
      "from node_cksum curr, node_cksum prev "
      "where curr.nodeid=%d and prev.nodeid=curr.nodeid and "
      "curr.tablename=prev.tablename and curr.recordid=prev.recordid and "
      "curr.cksumtype=%d and prev.cksumtype=%d "
      "union all "

      This statement returns not only updated records but also records which are up to date.
      In my opinion this statement should look more like this:
      /* Find updated records */
      result = DBselect("select curr.tablename,curr.recordid,prev.cksum,curr.cksum,prev.sync "
      "from node_cksum curr, node_cksum prev "
      "where curr.nodeid=%d and prev.nodeid=curr.nodeid and "
      "curr.tablename=prev.tablename and curr.recordid=prev.recordid and "
      "curr.cksumtype=%d and prev.cksumtype=%d and curr.cksum<>prev.cksum"
      "union all "

            Assignee:
            Unassigned
            Reporter:
            Ɓukasz Reszka
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: