[storm] Not Unique table/alias
Hamilton Tran
hamilton.tran at gmail.com
Wed Nov 4 17:56:47 GMT 2009
First things first, I’m coming from a .10 release of Storm, and I am trying
to upgrade to .12 but I’m stuck at this problem. I basically took the .12
release and copied it over the old .10 release and removed all the .pyc
files. Onto the problem.
I have this table definition:
Class Foo(Storm)
fooId = Int(name=”foo_id”, primary
= True);
barId = …
pieId = …
#then some references
barRef = Reference(barId, Bar.barId)
pieRef = Reference(pieId, Pie.pieId)
#and now some proxies
bar = Proxy(barRef, Bar.name);
pie = Proxy(pieRef, Pie.name);
When I do a find like this
Store.find(Foo, Foo.bar = “brown”, Foo.pie = “cherry”) the
resulting sql statement comes out
SELECT Foo.fooId, Foo.barId … FROM Foo LEFT JOIN bar ON foo.bar_Id =
bar.bar_Id WHERE bar.name = ‘brown’, foo LEFT JOIN pie on pie.pie_id =
foo.pie_id WHERE bar.name = “brown” AND pie.name = “cherry”.
Which gives me that Not unique table/alias error. Remove one of the
conditional statements and storm returns a result. From my testing, it seems
that if I include multiple conditions that use the references/proxy storm
compiles the sql incorrectly. Namely here
bar.name = ‘brown’, foo LEFT JOIN
Where there’s a comma as well as foo coming out of nowhere. Remove the comma
and the foo and the statement works. Did something change that I need to be
aware of in order to get this to work as I’ve looked through the mailing
list and figured this situation would have cropped up sooner if it is indeed
a bug with storm.
Thanks for the help
Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20091104/7d00ea6c/attachment.htm
More information about the storm
mailing list