So I was up until 2:30am last night chasing down what looked like a huge
memory leak in our app, and it turned out to be what I think is a bug in the
way that SA maps the in_() function to SQL syntax.

Most of the way it works is great:

>> col.in_(v1, v2, v2)
   COL IN (v1, v2, v3)
>> col.in_(v1)
   COL = v1

but this one:

>> col.in_()
   COL IS NULL

is a mapping I don't think
is right. In our case, it caused an unexpected enormous table scan
that loaded over 800MB of data and set our server to swapping.

Now I know that's really a bug in our app to not check for an empty IN
list, and that's fixed.
But I would rather
have seen SA generate the " col in ()" syntax and have the SQL server
complain (I
think most SQL engines would throw an error on that syntax)
than to have what is really an incorrect query generated.

What do others think on this one?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to