作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据http://www.sqlite.org/fileformat.html SQLite3 在数据库文件的字节24..27
中维护一个4 字节大端整数文件更改计数器
。
当文件更改计数器
超过最大大小时,是否会溢出?
(我觉得答案是:是的,它确实会溢出)
<小时/>我问这个问题是因为我想要类似于 sqlite 文件校验和的东西,并通过另一个 StackOverflow 问题找到了文件更改计数器
: Checksum for a SQLite database?
最佳答案
文件更改计数器的实际值没有任何意义(它不是版本号);唯一重要的是它与所有其他最近的值不同。
快速测试表明该值环绕:
$ sqlite3 test.db 'create table t(x);'
$ od --skip-bytes 24 --read-bytes 4 -tx1 test.db | cut -c9-
00 00 00 01
(lots of changes ...)
$ od --skip-bytes 24 --read-bytes 4 -tx1 test.db | cut -c9-
ff ff ff ff
$ sqlite3 test.db 'drop table t;'
$ od --skip-bytes 24 --read-bytes 4 -tx1 test.db | cut -c9-
00 00 00 00
关于sqlite - sqlite 'file change counter'超过最大大小时是否溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32342495/
我是一名优秀的程序员,十分优秀!