[Kamailio-Devel] postgres queries overlapping

Klaus Darilion klaus.mailinglists at pernau.at
Wed Jul 30 08:17:27 CEST 2008


Hi Humberto!

Please post the bugreport and the patch (please make an unified diff 
(diff -u) ) at the bugtracker.

http://sourceforge.net/tracker/?group_id=139143&atid=743020

thanks
klaus

H Quintana schrieb:
> Hi dear developers,
> 
> 
> I just upgraded from 1.2.2 to 1.3.2 and I'm getting a postgres error because the DELETE query (delete from location where expires...) is overlapped with a previous INSERT in the accounting table. 
> 
> I did some changes in postgres/dbase.c to always set the end of the string for pg_delete, pg_update, pg_query, as it is for pg_insert.  I dont know if that is the best solution but it's working for me.
> 
> Please let me know if that was ok or there is a better way to fix it.
> 
> 
> Thanks for your time,
> 
> Humberto
> 
> 
> *******The problem's log*******
> 
> 
> Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0 Probable invalid query
> 
> Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0: PGRES_FATAL_ERROR
> 
> Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0: ERROR:  syntax error at or near "_from" LINE 1: ...07-29 13:06:02' AND expires!='1969-12-31 19:00:00'_from,sip_...                                                              ^
> 
> Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_delete: 0x8193ef0 Query: delete from location where expires<'2008-07-29 13:06:02' AND expires!='1969-12-31 19:00:00'_from,sip_to,i_uri,o_uri,from_uri,to_uri,username,domain,hunt,invite_time,ringing_time ) values ('INVITE','e5326044ad106ef2', ...
> 
> 
> **********My solution(?) ********
> 
> [root at localhost postgres]# diff dbase.c dbase.c.orig
> 656d655
> <       *(_s + off) = '\0';
> 852d850
> <       *(_s + off) = '\0';
> 895a894
>>               *(_s + off) = '\0';
> 897d895
> <       *(_s + off) = '\0';
> 
> 
> 
> 
> 
> 
>       
> 
> _______________________________________________
> Devel mailing list
> Devel at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel



More information about the Devel mailing list