| 646 | // --------------------------------------------------------------------------- |
| 647 | |
| 648 | bool DiskChunkCache::update_linked_chunks(sqlite3_int64 link_id, |
| 649 | sqlite3_int64 prev, |
| 650 | sqlite3_int64 next) { |
| 651 | auto stmt = |
| 652 | prepare("UPDATE linked_chunks SET prev = ?, next = ? WHERE id = ?"); |
| 653 | if (!stmt) |
| 654 | return false; |
| 655 | if (prev) |
| 656 | stmt->bindInt64(prev); |
| 657 | else |
| 658 | stmt->bindNull(); |
| 659 | if (next) |
| 660 | stmt->bindInt64(next); |
| 661 | else |
| 662 | stmt->bindNull(); |
| 663 | stmt->bindInt64(link_id); |
| 664 | const auto ret = stmt->execute(); |
| 665 | if (ret != SQLITE_DONE) { |
| 666 | pj_log(ctx_, PJ_LOG_ERROR, "%s", sqlite3_errmsg(hDB_)); |
| 667 | return false; |
| 668 | } |
| 669 | return true; |
| 670 | } |
| 671 | |
| 672 | // --------------------------------------------------------------------------- |
| 673 | |