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

Save return value for later comparison in transaction code

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.9, 4.0.1, 4.1.1, WT3.2.0
    • Component/s: None
    • Labels:
      None

      Description

      The coverity static analysis tool uncovered a bug:

       

        • CID 1393767:  Control flow issues  (DEADCODE)
          /src/txn/txn_timestamp.c: 355 in __wt_txn_update_pinned_timestamp()

      ________________________________________________________________________________________________________

          • CID 1393767:  Control flow issues  (DEADCODE)
            /src/txn/txn_timestamp.c: 355 in __wt_txn_update_pinned_timestamp()
            349             WT_WITH_TIMESTAMP_READLOCK(session, &txn_global->rwlock,
            350                 __wt_timestamp_set(
            351                 &oldest_timestamp, &txn_global->oldest_timestamp));
            352     
            353             /* Scan to find the global pinned timestamp. */
            354             if (__txn_get_pinned_timestamp(session, &active_timestamp, false) != 0)
            >>>     CID 1393767:  Control flow issues  (DEADCODE)
            >>>     Execution cannot reach the expression "0" inside this statement: "return (ret == -31803) ? 0 ...".
            355                     return (ret == WT_NOTFOUND ? 0 : ret);
            356     
            357             if (__wt_timestamp_cmp(&oldest_timestamp, &active_timestamp) < 0)
            Unknown macro: { 358                     __wt_timestamp_set(&pinned_timestamp, &oldest_timestamp); 359             }

            else
            360                     __wt_timestamp_set(&pinned_timestamp, &active_timestamp);

       

      The return value of the call to __txn_get_pinned_timestamp should be assigned to the ret variable.

        Attachments

          Activity

            People

            Assignee:
            alexander.gorrod Alexander Gorrod
            Reporter:
            alexander.gorrod Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: