Hello
My application does iteration in reverse order over duplicate keys in a
secondary database.
It uses the following code:
bool res;
if (res = (cursorPtr->get(&dbKey, &dbData, DB_SET) == 0)) {
// if iterating backwards, need to find last element with the same key
// by DB_NEXT_NODUP, and then DB_PREV
if (res = cursorPtr->get(&dbKey, &dbData, DB_NEXT_NODUP) ==
0) { // <=== CRASH
res = cursorPtr->get(&dbKey, &dbData, DB_PREV)
== 0;
}
}
the code crashes when trying to get data from cursor with DB_NEXT_NODUP
flag.
The weird thing is, in db-4.3.29 it works fine
The stack is:
#0 0x404a40b4 in __db_c_get (dbc_arg=0x868b0d0, key=0x8645314,
data=0xbfff72c0, flags=20) at ../dist/../db/db_cam.c:801
#1 0x404a5cfb in __db_c_pget (dbc=0x868cc10, skey=0x8645314,
pkey=0xbfff72c0, data=0x864532c, flags=20) at
.../dist/../db/db_cam.c:1776
#2 0x404b0177 in __db_c_pget_pp (dbc=0x868cc10, skey=0x8645314,
pkey=0x0, data=0x864532c, flags=20) at ../dist/../db/db_iface.c:2109
#3 0x404a59ce in __db_c_secondary_get_pp (dbc=0x868cc10,
skey=0x8645314, data=0x864532c, flags=20) at
.../dist/../db/db_cam.c:1621
#4 0x4054a366 in Dbc::get (this=0x868cc10, key=0x8645314,
data=0x864532c, _flags=20) at ../dist/../cxx/cxx_dbc.cpp:80
Please help!!
Thanks in advance,
Leon