[fdo-trac] #397: Valid/Delete flag of record in DBF file
FDO
trac_fdo at osgeo.org
Fri Sep 19 04:11:06 EDT 2008
#397: Valid/Delete flag of record in DBF file
--------------------------+-------------------------------------------------
Reporter: StevenXu | Owner: StevenXu
Type: defect | Status: closed
Priority: major | Milestone:
Component: SHP Provider | Version: 3.3.1
Severity: 3 | Resolution: fixed
Keywords: | External_id:
--------------------------+-------------------------------------------------
Changes (by StevenXu):
* status: new => closed
* resolution: => fixed
Comment:
CC Review#909
Hi Dan,
I don’t accept Arthur’s fix.
AS old design, only records in DBF file which start with cVALID_RECORD_ID
can be accepted as valid record, but the attached SHP file in DID 1076437
has different leading character( ‘0’) with cVALID_RECORD_ID(‘ ‘). So that
these records would be treated as deleted records.
As Author’s change, this SHF file still would be treated as deleted record
and lead to import fail.
My change is, only records in DBF file which start cDELETED_RECORD_ID
(‘*’) can be accepted as deleted record.
RowData::RowData (ColumnInfo* pColumnInfo, void* buffer) :
mDeleted (true), HERE
mColumnInfo (pColumnInfo),
mBuffer (buffer),
mReading (NULL != buffer)
else if (cDELETED_RECORD_ID != ((char*)buffer)[0])
SetDeleted (false);
The following URL is Code Review.
http://ccs12378319:8080/index.jsp?page=ReviewDisplay&reviewid=909
Could you spare time help me to review this before this Friday? We want to
submit this in this week.
Thanks & Regards
Steven
From: Dan Stoica
Sent: Thursday, September 11, 2008 10:12 PM
To: Arthur Liu
Cc: Steven Xu; Leaf Li
Subject: RE: Ask help for one problem (SHP file)
Hi,
The change makes sense but by default RowData::mDeleted=false
So you also need to change:
RowData::RowData (ColumnInfo* pColumnInfo, void* buffer) :
mDeleted (true), HERE
mColumnInfo (pColumnInfo),
mBuffer (buffer),
mReading (NULL != buffer)
Otherwise all the records will be flagged as deleted
Cheers,
Dan.
From: Arthur Liu
Sent: Thursday, September 11, 2008 6:18 AM
To: Dan Stoica
Cc: Steven Xu; Leaf Li
Subject: RE: Ask help for one problem (SHP file)
Hi Dan,
According to QA’s responds, we still have to fix the defect this week.
It seem that we just need to update the logic like this:
The original code is –
else if (cVALID_RECORD_ID != ((char*)buffer)[0])
SetDeleted(true);
We can replace it with this -
else if (cVALID_RECORD_ID == ((char*)buffer)[0])
SetDeleted(false);
What’s your opinion? I’m looking forward to your advice.
Regards,
Arthur
From: Dan Stoica
Sent: Friday, August 08, 2008 10:53 PM
To: Steven Xu
Cc: Arthur Liu
Subject: RE: RE: Ask help for one problem (SHP file)
Hi,
Attached is the dll, debug mode.
Regarding the valid/deleted flag… I think I remember correctly that the
reason that condition is checking for not-valid (i.e. different from ‘ ‘)
is the fact we found non-standard deleted flags (i.e. different from ‘*’).
As you see, is hard to make a sound decision when people are very creative
The problem is interesting, I’ll think about it. So far I have no clue…
Thanks,
Dan.
From: Steven Xu
Sent: Friday, August 08, 2008 2:01 AM
To: Dan Stoica
Cc: Arthur Liu
Subject: RE: Ask help for one problem (SHP file)
Hi Dan,
Could you send the G015 ShpProvider.dll to me so that I can check if
it is fixing 1053806 as well. I can’t find this file on our component
server.
BTW, another question about SHP file provider , but it is another
defect 1076437.
\FDO\Providers\SHP\Src\ShpRead\rowdata.cpp Line 77
else if (cVALID_RECORD_ID != ((char*)buffer)[0])
Here, assume all valid records in DBF file of SHP package should be
started with a space character, it is no problem, it is standard .
But the DBF file in defect 1076437, maybe it is not a standard DBF file,
the every record was started with a ‘0’ character, so it can’t be imported
into map successfully.
Is It necessary to tolerate this un-standard SHP file in FDO? For example
, change this condition to make sure it is not equal to ‘*’ character?
Thanks
Steven Xu
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/397#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list