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.