Re: [pysqlite] About one in a thousand inserts fail!
AK <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Dennis Lee Bieber wrote: > On Mon, 24 Mar 2008 12:15:07 -0500, AK > <[email protected]> declaimed the > following in gmane.comp.python.db.pysqlite.user: > > > >> cmd = 'SELECT id FROM items WHERE title="%s" AND tags="%s"' % >> (title, tags) >> self.cursor.execute(cmd) >> > > Danger if either title or tags has certain characters... > > You properly did the insert, you should do the selects the same way. > > self.cursor.execute( > """select id from items > where title = ? and tags = ?""", > (title, tags) ) > The thing is, all words here are taken from a small words file that doesn't have any unusual characters - all alphanumerics. And I checked the words that were involved in last error. But, when I used lastrowid property, there were no errors.. I don't understand.:-( -- -ak Tobu | http://www.lightbird.net/tobu/ | Freeform DB / Tagger / PIM