#1135 closed defect (fixed)
Feature Service API throws exception on executing some SQL's
Reported by: | Aleck | Owned by: | Aleck |
---|---|---|---|
Priority: | low | Milestone: | 2.2 |
Component: | Feature Service | Version: | 2.1.0 |
Severity: | trivial | Keywords: | |
Cc: | External ID: |
Description
- Connect to an Oracle datastore
Executes a SQL statement like the following: "select (max(f.id))+1 from table f";
You will get an MgFdoException:
This is becuase in MgServerFeatureUtil::GetMgProperty method, it is assumed that the property name will be in the form of [TableName].[FieldName]. And only the FieldName part will be used as the property name to get the property value through FDO.
However, this assumption is not necessary and even not correct. Take the above SQL statement as an example. the property name returned by FDO is "(max(f.id))+1". However, only the part "id))+1" is used as the property name. Thus exception occurs.
To fix this, the code that splits the assumed qualified property name is removed. The property name returned by FDO should be used directly to get the property value.
Attachments (1)
Change History (5)
by , 15 years ago
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Well, if an AS clause is provided for the selected field name such as the sql statement "select (max(f.id))+1 AS NextID from table f", everything goes OK. That is because for these statements,the provider will return the user defined field name in AS clause as the property name such as "NextID" in the above case. In this circumstance, there will be no dot in the property name text, therefore, feature service is able to handle this.
What I'm addressing in this ticket is that a property name containing a dot will raise this issue. that is to say a statement like "select (max(f.id))+1 from table f"
comment:3 by , 15 years ago
Milestone: | → 2.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | 2.0.2 → 2.1.0 |
Fixed in trunk r4333.
comment:4 by , 15 years ago
Component: | General → Feature Service |
---|
Hi - can I ask if this will address the more generic casting of column names such as:
or