android - 当自动增量列超过 SQLite 中的最大值时会发生什么

标签 android sqlite

我想使用 SQLite 及其自动增量列。但我想知道如果该值达到最大值(2,147,483,647 是“long”类型的最大值)会发生什么 有人知道吗?

最佳答案

这记录在 documentation 中.

没有自动增量:

If the largest ROWID is equal to the largest possible integer (9223372036854775807) then the database engine starts picking positive candidate ROWIDs at random until it finds one that is not previously used. If no unused ROWID can be found after a reasonable number of attempts, the insert operation fails with an SQLITE_FULL error.

使用自动增量:

If the table has previously held a row with the largest possible ROWID, then new INSERTs are not allowed and any attempt to insert a new row will fail with an SQLITE_FULL error.

关于android - 当自动增量列超过 SQLite 中的最大值时会发生什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35127862/

相关文章:

Android 布局 - 在 xml 中偏移背景图像

iphone - Sqlite 的 iOS-5 中的性能问题

android - 当前可用教室的数据库

android - 停止或杀死玩家的通知按钮

android - 出现 SWT 错误

android - 如何在偏好 Activity 上有自定义对话框?

java - 当值不在另一个表上时 SQLite 选择

java - 计算耗时?

android - shell 中删除 sqlite 数据库的命令是什么?

android - SQLite Android 插入返回 -1