Sorry for the frequent e-mails.

I just solved the problem - I forgot to set the type of the ID field to 
INTEGER PRIMARY KEY AUTOINCREMENT,
since Sqliteman does not show it as an option.

Best,
Omri

On Wednesday, May 9, 2012 12:15:31 PM UTC+2, Omri Har-Shemesh wrote:
>
> Additional information:
> after going through my revision history, it seems that the problem started 
> after
> I changed the type of a field from "string" (didn't notice I forgot to 
> define it as "integer"
> and therefore it defaulted to string, even though the default=0 was 
> specified).
> Then, since sqlite doesn't really allow you to change the type of a 
> column, I used
> Sqliteman to do that (it was critical to change the field type). What 
> sqliteman does
> is essentially drop the table and recreate it with the new definitions.
>
> I'm suspecting that web2py is unhappy about this. Is there a way to make 
> web2py happy
> again? I'm guessing that now the table's definition as it really is, is 
> different from what web2py
> expects.
>
> Any help would be greatly appreciated!
>
> Omri
>
> On Wednesday, May 9, 2012 11:14:57 AM UTC+2, Omri Har-Shemesh wrote:
>>
>> Hi,
>>
>> I suddenly came across a weird bug, where when I add a record to a 
>> specific table (it doesn't happen with other tables),
>> it inserts the record with the id field == null, but returns a number as 
>> if it is the id. Furthermore, the number returned is
>> close to (but not exactly) the number of records in the table (it is a 
>> little bigger than the number of rows in the table).
>> The thing is that the highest id field in the table (which was obviously 
>> inserted prior to the bug) is 219, while the new 
>> ids generated are around 70, and the number of records in the table is 65.
>>
>> I am using web2py 1.99.7 dev with pysqlite2.
>>
>> Any advice as to how to debug this will be greatly appreciated!
>>
>

Reply via email to