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

Save return value for later comparison in transaction code

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

      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.

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

              Created:
              Updated:
              Resolved: