Why are you specifying the ids?

On Tuesday, August 6, 2013 10:27:03 PM UTC-4, Jim Gregory wrote:
>
> I noticed an odd behavior when inserting a record in a MySQL table.  Given 
> a table:
>
> db.define_table('person', Field('name'))
>
> inserting some records without specifying the id returns the correct id:
> >>> db.person.insert(name='John')
> 1
> >>> db.person.insert(name='Bill')
> 2
>
> But specifying the id when the record is inserted does not:
> >>> db.person.insert(id=3, name='Fred')
> 2
> >>> db.person.insert(id=10, name='George')
> 2
>
> even though the records are inserted correctly:
> >>> print db().select(db.person.ALL)
> 1 John
> 2 Bill
> 3 Fred
> 10 George
>
> Is this unique to MySQL?  Is this a bug or is there a logical reason for 
> this?  
>
> -Jim
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to