[Devel] [ openser-Bugs-1372451 ] avpops: avp_db_delete deletes too much

SourceForge.net noreply at sourceforge.net
Tue Dec 6 14:23:10 CET 2005


Bugs item #1372451, was opened at 2005-12-03 19:26
Message generated for change (Comment added) made by goestelecom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1372451&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: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Norman Brandinger (goestelecom)
Assigned to: Nobody/Anonymous (nobody)
Summary: avpops: avp_db_delete deletes too much

Initial Comment:
1) The use_domain parameter is turned off, for example
in the statement below:

modparam("avpops","use_domain", 0)

2) A call to avp_db_delete is made, for example:

avp_db_delete("$from/username","s:fwd_blind");

3) ALL AVP's for the specified username with an
attribute of "fwd_blind" are deleted.

If there are multiple entries for the username (some
with different domains), they are ALL unexpectedly deleted.

A fix would be to change the SQL delete from:

DELETE from usr_preferences where username = 'username'
and attribute = 'fwd_blind'

To:

DELETE from usr_preferences where username = 'username'
and attribute = 'fwd_blind' and domain = ''


I spent a little time looking at way the SQL query is
dynamically created and realized that this fix would be
able to be done faster ( and with less side effects) by
the developer.

Regards,
Norm


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

>Comment By: Norman Brandinger (goestelecom)
Date: 2005-12-06 13:23

Message:
Logged In: YES 
user_id=1372252

Based on a review, it was determined that use_domain(0) and
use_domain(1) should not be used with the same back-end
database.  Two databases should be used instead.  This will
make moot the issue of deleting records based on the domain.

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

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



More information about the Devel mailing list