[storm] queries made to look for something storm already has

James Henstridge james at jamesh.id.au
Wed Jul 30 12:02:26 BST 2008


On Mon, Jul 28, 2008 at 4:17 PM, Gabriel Rossetti
<gabriel.rossetti at arimaz.com> wrote:
> Hello everyone,
>
> I turned on the debugging and I'm seeing queries like these :
>
> INSERT INTO `language` (name) VALUES (%s) (u'ENGLISH',)
> SELECT `language`.language_id FROM `language` WHERE
> `language`.language_id = 1 ()
> INSERT INTO `language` (name) VALUES (%s) (u'FRENCH',)
> SELECT `language`.language_id FROM `language` WHERE
> `language`.language_id = 2 ()
>
> Why is a query made for `language`.language_id if we already have it
> (it's used in the WHERE statement)?

This looks like a bug in the mysql backend.  The use of
cursor.lastrowid could probably be used to fill in the primary
variables in MySQLConnection.execute(), similar to what we do in the
PostgreSQL backend.

Filling them in at that point should be just as reliable as using them
to construct the where clause in get_insert_identity().


James.



More information about the storm mailing list