[Devel] [ openser-Bugs-1619472 ] multiple avp_db_query on same data return wrong results

SourceForge.net noreply at sourceforge.net
Wed Dec 20 15:38:37 CET 2006


Bugs item #1619472, was opened at 2006-12-20 16:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1619472&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Begeragus Lmerov (begeragus)
Assigned to: Nobody/Anonymous (nobody)
Summary: multiple avp_db_query on same data return wrong results

Initial Comment:
There is a problem in avp_db_query function in avpops module.
It appears that after repeatedly making selects the avps of the
multirow result do not clear and get filled up, producing 
unpredictable results.

How to reproduce (using latest development version from cvs):
-create table test in db openser (mysql) an populate it with 2 rows:

CREATE TABLE `test` (
  `one` char(50) default NULL,
  `two` char(50) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

insert into test (one, two) values ('in', 'yes');
insert into test (one, two) values ('out', 'yes');

- use this simple config which only registers UAC and rejects all messages:

# ----------- global configuration parameters ------------------------

debug=3            # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no    # (cmd line: -E)

check_via=no    # (cmd. line: -v)
dns=no          # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/openser_fifo"

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/avpops.so"
loadmodule "/usr/local/lib/openser/modules/xlog.so"

# ----------------- setting module-specific parameters ---------------

modparam("avpops", "avp_url", "mysql://openser:XXXXXX@localhost/openser")
modparam("avpops","avp_table","ddd")

# -------------------------  request routing logic -------------------

route{

        if (uri==myself) {

                if (method=="REGISTER") {


                        save("location");
                        exit;
                };
        avp_db_query("select * from test","$avp(i:111);$avp(i:222)");

        xlog("L_INFO", "-----------------------------------------");
        xlog("L_INFO", " result         |One    |Two|");
        xlog("L_INFO", " result1        |$avp(i:111[0]) |$avp(i:222[0])|");
        xlog("L_INFO", " result2        |$avp(i:111[1]) |$avp(i:222[1])|");
        xlog("L_INFO", " result3        |$avp(i:111[2]) |$avp(i:222[2])|");
        xlog("L_INFO", " result4        |$avp(i:111[3]) |$avp(i:222[3])|");
        xlog("L_INFO", "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");

        sl_send_reply("404", "Not Found");
        };
}


- send 5-10 invites and look at the log, the expected result (2 different rows of data in result) 
happens the first 2-3 times. After that the result returns all avps to be the same and is 4 and more rows. 
Bug appears even on version 1.1, if fixing please backport the fix.

Best,
Dimo

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1619472&group_id=139143



More information about the Devel mailing list