Project

General

Profile

Wt::Dbo Dubious query result from table of composite foreign primary key

Added by Stefan Hainzl over 9 years ago

Hello,

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
    • String
  • Primary key of Table 5
    • String

Can you tell a problem from that already? Anything to look out for?

Thanks & Best regards,

Stefan


Replies (2)

RE: Wt::Dbo Dubious query result from table of composite foreign primary key - Added by Koen Deforche over 9 years ago

Hey,

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.

Regards,

Koen

RE: Wt::Dbo Dubious query result from table of composite foreign primary key - Added by Stefan Hainzl over 9 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!

Best regards,

Stefan

    (1-2/2)