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

Coverity complaint: Constant expression result (CONSTANT_EXPRESSION_RESULT)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT3.2.0, 4.1.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • 2
    • Storage Engines 2019-03-25

      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));
      

            Assignee:
            alex.cameron@mongodb.com Alex Cameron (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: