Wt::Dbo Dubious query result from table of composite foreign primary key
I have a problem that sounds a bit like described here: http://redmine.webtoolkit.eu/issues/1335, i.e. a query to get a subset of this table produces the correct number of items, but each item in the query result is just the first one of the subset.
Adding records to the table works as expected. Also, performing the query in pgAdmin 3 produces the correct results.
I did not find a similar table in the examples ...
The setup is such:
- Primary key of Table 1 (the one being queried)
- Table 2
- Table 3
- Primary key of Table 2
- String 2.1
- Table 4
- Primary key of Table 3
- String 3.1
- Table 5
- Primary key of Table 4
- Primary key of Table 5
Can you tell a problem from that already? Anything to look out for?
Thanks & Best regards,
RE: Wt::Dbo Dubious query result from table of composite foreign primary key - Added by Koen Deforche about 8 years ago
Perhaps the foreign key type does not provide correct comparison operators? These are used by wt::dbo to judge identity of objects.
Other than that, I have no idea ... a working test case would be helpful.
RE: Wt::Dbo Dubious query result from table of composite foreign primary key - Added by Stefan Hainzl about 8 years ago
Oh, how embarrassing ...
I lost about a week (well, part time) to this one.
The < operator in table 1 was taking the AND instead of the OR between the two pointers.
Thanks for the hint, Koen! You guys are the best!