【发布时间】:2012-08-02 17:50:48
【问题描述】:
我正在使用 SQLite 验证 length(x) 如何在 BLOB 上工作,我惊讶地发现 randomblob(0) 的长度为 1,甚至更多 zeroblob(0) 的长度为 0,如下所示。 randomblob(0) 和 zeroblob(0) 不应该都有 0 长度吗?如果不是,为什么?
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select length(zeroblob(0));
0
sqlite> select length(zeroblob(1));
1
sqlite> select length(zeroblob(2));
2
sqlite> select length(randomblob(0));
1
sqlite> select length(randomblob(1));
1
sqlite> select length(randomblob(2));
2
【问题讨论】: