sqlite3_changes() and sqlite3_total_changes() both return an int.
I ran a huge update on a table with 2147483685 rows in it, and when I was done, 
the result from sqlite3_total_changes() was negative, it had overflowed to 
-2147483612.
The documentation doesn't seem to indicate negative values being used for any 
type of error conditions from these functions, so it seems to me the return 
types should be unsigned.

On further consideration of ROWID, the documentation indicates that the highest 
value it can store is 9223372036854775807 and once it is full, a table full 
error response is returned when trying to insert another row. However, testing 
indicates that ROWID can be negative values as well, meaning a table has an 
upper limit of 18446744073709551615 rows.
This limitation should probably be mentioned on the limits page. But more 
importantly, sqlite3_changes() should have a return type of sqlite3_uint64, as 
that is indeed a type that would be able to contain any response it should be 
able to return.
sqlite3_total_changes() should share the same return type, although given 
enough operations, a call to sqlite3_total_changes() with whatever magnitude 
return type would always eventually overflow.

I hope this is the right place to file this kind off error.



      
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to