get_array_info() can modifiy DBADDR::pfield
Allow the record support function get_array_info() to modify its first argument to provide a different pointer from which values should be read. Remember the original and restore it afterwards.
This commit is contained in:
@@ -104,7 +104,9 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
if (chan->addr.special == SPC_DBADDR &&
|
||||
nSource > 1 &&
|
||||
(prset = dbGetRset(&chan->addr)) &&
|
||||
prset->get_array_info) {
|
||||
prset->get_array_info)
|
||||
{
|
||||
void *pfieldsave = chan->addr.pfield;
|
||||
prec = dbChannelRecord(chan);
|
||||
dbScanLock(prec);
|
||||
prset->get_array_info(&chan->addr, &nSource, &offset);
|
||||
@@ -126,6 +128,7 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
pfl->u.r.field = pdst;
|
||||
}
|
||||
dbScanUnlock(prec);
|
||||
chan->addr.pfield = pfieldsave;
|
||||
}
|
||||
|
||||
/* Extract from buffer */
|
||||
|
||||
Reference in New Issue
Block a user