Compare the ages of two snapshot handles

Compare the ages of two snapshot handles

Compare the ages of two snapshot handles.

int sqlite3_snapshot_cmp(
  sqlite3_snapshot *p1,
  sqlite3_snapshot *p2
);

Important: This interface is experimental and is subject to change without notice.

The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages of two valid snapshot handles.

If the two snapshot handles are not associated with the same database file, the result of the comparison is undefined.

Additionally, the result of the comparison is only valid if both of the snapshot handles were obtained by calling sqlite3_snapshot_get() since the last time the wal file was deleted. The wal file is deleted when the database is changed back to rollback mode or when the number of database clients drops to zero. If either snapshot handle was obtained before the wal file was last deleted, the value returned by this function is undefined.

Otherwise, this API returns a negative value if P1 refers to an older snapshot than P2, zero if the two handles refer to the same database snapshot, and a positive value if P1 is a newer snapshot than P2.

See also lists of Objects, Constants, and Functions.

SQLite is in the Public Domain.
https://sqlite.org/c3ref/snapshot_cmp.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部