#1208 closed defect (fixed)
SelectFeatures doesn't work if filter is secondary property
Reported by: | christinebao | Owned by: | Christine Bao |
---|---|---|---|
Priority: | medium | Milestone: | 2.2 |
Component: | Feature Service | Version: | 2.1.0 |
Severity: | major | Keywords: | |
Cc: | aleck.sun@…, Bruce, Dechant | External ID: | 1282026 |
Description
Steps to reproduce:
(The following data names are for explanation and understanding. You can use any data as needed)
Open MapGuide Studio:
- Connect to Primary.SDF, assuming it has properties: ID, Name.
- Connect to Secondary.SDF, assuming it has properties: ID, Code.
- Open Primary.FeatureSource, create a join with following conditions:
Extension name is: Join_Extension
Primary.ID = Secondary.ID
One-to-one
- View the extension data in MapGuide FeatureSource editor, and there are properties: ID, Name, SecondaryID, SecondaryCode. Please note the last two, they are from secondary table, and the property name is formatted by "Secondary table name" + "Property name".
- Use MapGuide agent to test FeatureService -> SelectFeatures:
- If use property from primary table as filter, for example "ID=1", the result is right.
- If use property from secondary table as filter, for example "SecondaryID=1", there is an exception: FDO can't execute query.
- If use property from primary table as filter, for example "ID=1", the result is right.
Attachments (1)
Change History (7)
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
How to fix:
The purpose of the above comparison
if(NULL == wcsstr(filterText, name.c_str()))
should be whether the filter contains secondary name ("Secondary" in this case), not extension name ("Join_Extension" in this case).
Take "SecondaryID=1" for example, if it contains secondary feature source name, it shouldn't be treated from primary.
by , 15 years ago
Attachment: | JoinSelect.patch added |
---|
comment:3 by , 15 years ago
Attach patch http://trac.osgeo.org/mapguide/attachment/ticket/1208/JoinSelect.patch for fixing this. Please review.
Use MapGuide agent test, and it works.
comment:4 by , 15 years ago
The patch looks good Christine. Please verify that the code still works for the case that Bruce's submission originally addressed before you check it in.
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks Chris for reviewing :)
This submission won't break Bruce's fixing. It's submitted.
Tech diagnosis:
In r3524 Bruce submitted a patch about "Selection against a joined feature source returns an extra feature", which is to fix ticket http://trac.osgeo.org/mapguide/ticket/614.
In this submission, there is a snippet of code added into ServerSelectFeatures.cpp:
And name is extension name, which is "Join_Extension" in this case.
The problem is: when property from secondary feature source(such as "SecondaryID") comes here, it doesn't contain extension name, so it's treated as from primary feature source, thus cause an exception.