Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4650

Coverity complaint: Constant expression result (CONSTANT_EXPRESSION_RESULT)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT3.2.0, 4.1.10
    • Component/s: None
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      Storage Engines 2019-03-25

      Description

      src/cache/cache_las.c:

      1144                        /*
      1145                         * Never expect an entry with prepare locked state or
      1146                         * with durable timestamp as max timestamp or with
      1147                         * in-progress prepare state and non-zero durable
      1148                         * timestamp. In all other cases the durable timestamp
      1149                         * is higher or same as the las timestamp.
      1150                         */
          	
      CID 1399759 (#1 of 1): Constant expression result (CONSTANT_EXPRESSION_RESULT)
      always_true_or: The "or" condition prepare_state != 2 || durable_timestamp != 18446744073709551615UL || (prepare_state != 1 || durable_timestamp == 0UL) will always be true because prepare_state cannot be equal to two different values at the same time, so it must be not equal to at least one of them.
      1151                        WT_ASSERT(session,
      1152                            prepare_state != WT_PREPARE_LOCKED ||
      1153                            durable_timestamp != WT_TS_MAX ||
      1154                            (prepare_state != WT_PREPARE_INPROGRESS ||
      1155                            durable_timestamp == 0));
      

        Attachments

          Activity

            People

            • Assignee:
              alex.cameron Alex Cameron
              Reporter:
              keith.bostic Keith Bostic
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: