[OpenSIPS-Devel] [opensips] Maintain database result integrity by supporting null column values (#693)

Jarrod Baumann notifications at github.com
Mon Nov 9 21:10:08 CET 2015


The avp population of column values from avp_db_query equaling NULL are skipped, sacrificing the integrity of the actual database result.

Basically, the old method checked if the column value structure's nul member was 1 and skipped to the next avp:

```
if (RES_ROWS(db_res)[i].values[j].nul)
        goto next_avp;
```

I moved this check to column values of type DB_INT, since that is the default type, and instead of skipping the avp, assign the value type to AVP_VAL_NULL:

```
avp_type |= AVP_VAL_NULL;
```
You can view, comment on, or merge this pull request online at:

  https://github.com/OpenSIPS/opensips/pull/693

-- Commit Summary --

  * Maintain database result integrity by supporting null column values

-- File Changes --

    M modules/avpops/avpops_db.c (12)

-- Patch Links --

https://github.com/OpenSIPS/opensips/pull/693.patch
https://github.com/OpenSIPS/opensips/pull/693.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/693
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20151109/4d60a3e0/attachment.htm>


More information about the Devel mailing list