Opened 16 years ago
Closed 16 years ago
#397 closed defect (fixed)
Valid/Delete flag of record in DBF file
Reported by: | StevenXu | Owned by: | StevenXu |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | SHP Provider | Version: | 3.3.1 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
Only records in DBF file which start with cVALID_RECORD_ID (' ')can be accepted as valid record. But customer encountered some SHP file with defference charater, for example , '0', as start character for each record. So that this SHP file can't be accepted. Suggest to change condition as:
- Only records in DBF file which start cDELETED_RECORD_ID can be accepted as invalid record.
Note:
See TracTickets
for help on using tickets.
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) :
mReading (NULL != buffer)
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) :
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])
We can replace it with this - else if (cVALID_RECORD_ID == ((char*)buffer)[0])
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,
\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