DB_SECONDARY_BAD error while deleting the record -
11-23-2006
, 11:50 PM
Hi,
my structure is ,
typedef struct _Hdr_S
{
pwchar pwcLine1[MAXSTRINGLENGTH];
puint32 uiMsgId ;
}Hdr_S;
secondary key generation funtions are,
pint32 get_SecKeyForLine1( DB *psDb, const DBT *pkey, const DBT *pdata,
DBT *skey)
{
Hdr_S *pstDetail = (Hdr_S*)pdata->data;
memset(skey, 0, sizeof(DBT));
skey->data = pstDetail ->pwcLine1;
(pvoid)PBase_UString_length( pstDetail , &(skey->size));
skey->size = skey->size + 1;
return 0;
}
/* PBase_UString_length return the length of wide string */
When an item is added to db using db->put, the item is added
successfully and also the item can be deleted using db->del
Now once I close the program and again start it then I can iterate
through all the items in Db, but I get DB_SECONDARY_BAD when I try to
delete an item
what can be the reason for above problem?
Whether my key generation algoritm is incorrect? |