diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c index 2b04280c0..7180259f5 100644 --- a/src/ioc/db/dbAccess.c +++ b/src/ioc/db/dbAccess.c @@ -694,7 +694,7 @@ void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry) pdbentry->precnode = ppvt->recnode; pdbentry->pflddes = paddr->pfldDes; pdbentry->pfield = paddr->pfield; - pdbentry->indfield = -1; /* invalid */ + pdbentry->indfield = paddr->pfldDes->indRecordType; } void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry) @@ -706,7 +706,6 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry) pdbentry->pdbbase = pdbbase; pdbentry->precordType = prec->rdes; pdbentry->precnode = ppvt->recnode; - pdbentry->indfield = -1; /* invalid */ } long dbValueSize(short dbr_type) diff --git a/src/ioc/db/test/dbStaticTest.c b/src/ioc/db/test/dbStaticTest.c index 5f5367722..589134d50 100644 --- a/src/ioc/db/test/dbStaticTest.c +++ b/src/ioc/db/test/dbStaticTest.c @@ -63,13 +63,10 @@ static void testAddr2Entry(const char *pv) testOk1(entry.pflddes==entry2.pflddes); testOk1(entry.precnode==entry2.precnode); testOk1(entry.pfield==entry2.pfield); - testOk1(entry2.indfield==-1); + testOk1(entry.indfield==entry2.indfield); testOk1(!entry2.pinfonode); testOk1(!entry2.message); - /* no way to look this up, so not set */ - entry.indfield = -1; - testOk1(memcmp(&entry, &entry2, sizeof(entry))==0); dbFinishEntry(&entry); @@ -103,13 +100,10 @@ static void testRec2Entry(const char *recname) testOk1(entry.pflddes==entry2.pflddes); testOk1(entry.precnode==entry2.precnode); testOk1(entry.pfield==entry2.pfield); - testOk1(entry2.indfield==-1); + testOk1(entry.indfield==entry2.indfield); testOk1(!entry2.pinfonode); testOk1(!entry2.message); - /* no way to look this up, so not set */ - entry.indfield = -1; - testOk1(memcmp(&entry, &entry2, sizeof(entry))==0); dbFinishEntry(&entry);