sqlite数据库ID自增长最大是几位数?

最大能增长到多少位?
2025-04-23 13:25:51
推荐回答(1个)
回答1:

#ifdef SQLITE_32BIT_ROWID
#   define MAX_ROWID 0x7fffffff
#else
    /* Some compilers complain about constants of the form 0x7fffffffffffffff.
    ** Others complain about 0x7ffffffffffffffffLL.  The following macro seems
    ** to provide the constant while making all compilers happy.
    */
#   define MAX_ROWID  (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
#endif
这是sqlite源码中定义的值,自增id即ROWID,最大值即MAX_ROWID