| 668 | // --------------------------------------------------------------------------- |
| 669 | |
| 670 | bool DiskChunkCache::update_linked_chunks(sqlite3_int64 link_id, |
| 671 | sqlite3_int64 prev, |
| 672 | sqlite3_int64 next) { |
| 673 | auto stmt = |
| 674 | prepare("UPDATE linked_chunks SET prev = ?, next = ? WHERE id = ?"); |
| 675 | if (!stmt) |
| 676 | return false; |
| 677 | if (prev) |
| 678 | stmt->bindInt64(prev); |
| 679 | else |
| 680 | stmt->bindNull(); |
| 681 | if (next) |
| 682 | stmt->bindInt64(next); |
| 683 | else |
| 684 | stmt->bindNull(); |
| 685 | stmt->bindInt64(link_id); |
| 686 | const auto ret = stmt->execute(); |
| 687 | if (ret != SQLITE_DONE) { |
| 688 | pj_log(ctx_, PJ_LOG_ERROR, "%s", sqlite3_errmsg(hDB_)); |
| 689 | return false; |
| 690 | } |
| 691 | return true; |
| 692 | } |
| 693 | |
| 694 | // --------------------------------------------------------------------------- |
| 695 | |