[Kamailio-Users] avp_db_query to SELECT a DOUBLE colomn

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 16 11:10:00 CEST 2009



On 16.09.2009 11:01 Uhr, Alex Balashov wrote:
> Iñaki Baz Castillo wrote:
>> 2009/9/16 Alex Balashov <abalashov at evaristesys.com>:
>>> Iñaki Baz Castillo wrote:
>>>
>>>>> For example a PostgreSQL BIGINT is unintelligible to sqlops, I 
>>>>> found out.
>>>> What do you mean exactly?
>>> CREATE TABLE stuff (
>>>   id bigint PRIMARY KEY NOT NULL
>>> );
>>>
>>> INSERT INTO stuff VALUES (1);
>>>
>>> ...
>>>
>>> sql_query("ca", "SELECT id FROM stuff", "ra");
>>>
>>> $dbr(ra=>[0,0]) will be NULL.
>>
>> sql_...ops!
>>
>> A bug?
>
> Maybe.  There was mailing list traffic about it when I first reported 
> it around 1 April 2009.
>
> I do not think it is a bug, but rather the understandable 
> unwillingness of the implementors to handle every database-specific 
> data type that might come their way, like 'timestamp', 'inet', etc.
the problem so far is the lack of support in config file interpreter for 
such types -- right now, operations in config file can deal with integer 
and string types only.

There are steps to overcome this limitation in the future. The devel 
version has a new PV class called xavp where the value can be of many 
more types:
http://sip-router.org/wiki/devel/xavp

One reason behind was this specific need of other value types. Next step 
will be to extend the cfg interpreter.

Cheers,
Daniel

>
> I do think 'bigint' is an important one to handle because there are 
> some values Kamailio may need to retrieve from time to time that are 
> simply larger than 32-bit width.  But it's hard to say where the line 
> should be drawn on special RDBM types, especially since the values 
> that are represented by user variables, AVPs, hash table, etc. are 
> ultimately just scalar quantities or strings.
>

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the Users mailing list