[OpenSIPS-Users] possible big in unixodbc queries

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Mar 5 09:14:15 UTC 2024


The data type of the each column is provided by the unixodbc lib via the 
SQLDescribeCol() function.

I would rather suspect an issue between the unixodbc layer and the 
underlying DB.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 02.03.2024 02:57, Saint Michael wrote:
> whatever query I call, db_unixodbc_get_columns returns only db_int for
> every field.
> DBG:avpops:ops_dbquery_avps: query [CALL get_user_details(1)]
>   DBG:core:db_new_result: allocate 48 bytes for result set at 0x71c49935ba20
>   DBG:db_unixodbc:db_unixodbc_get_columns: 3 columns returned from the query
>   DBG:core:db_allocate_columns: allocate 84 bytes for result columns at
> 0x71c49935ba88
>   DBG:db_unixodbc:db_unixodbc_get_columns:
> RES_NAMES(0x71c49935baa0)[0]=[username]
>   DBG:db_unixodbc:db_unixodbc_get_columns: use DB_INT result type
>   DBG:db_unixodbc:db_unixodbc_get_columns: RES_NAMES(0x71c49935bab0)[1]=[email]
>   DBG:db_unixodbc:db_unixodbc_get_columns: use DB_INT result type
>   DBG:db_unixodbc:db_unixodbc_get_columns: RES_NAMES(0x71c49935bac0)[2]=[phone]
>   DBG:db_unixodbc:db_unixodbc_get_columns: use DB_INT result type
>   DBG:core:db_allocate_rows: allocate 112 bytes for result rows and
> values at 0x71c49935bb18
>   DBG:db_unixodbc:db_unixodbc_str2val: converting INT [johndoe]
>   ERROR:core:db_str2int: Unexpected characters: [johndoe]
>   ERROR:db_unixodbc:db_unixodbc_str2val: converting integer value from
> string failed
>   ERROR:db_unixodbc:db_unixodbc_convert_row: failed to convert value
>
> opensips -V
> version: opensips 3.4.4 (x86_64/linux)
> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
> Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535
> poll method support: poll, epoll, sigio_rt, select.
> git revision: e50c6736e
> main.c compiled on 00:29:53 Mar  2 2024 with gcc 9
>
> dpkg -l | grep unixodbc
> ri  unixodbc                         2.3.6-0.1build1
> amd64        Basic ODBC tools
> ri  unixodbc-dev:amd64               2.3.6-0.1build1
> amd64        ODBC libraries for UNIX (development files)
>
> odbc.ini
>
> [opensips]
> Description = MySQL ODBC Driver Testing
> Driver = maria
> Socket = /var/run/mysqld/mysqld.sock
> #Server = localhost
> User = xxxxx
> Password = xxxx
> Database = asterisk
> Option = 3
>
> odbcinst.ini
>
> [maria]
> Description=ODBC for MySQL
> Driver=/usr/lib64/mariadb/libmaodbc.so
> FileUsage=1
> Threading=0
>
> a Unixodbc trace shows that everything is normal,so the issue must be
> with opensips
>                      Statement = 0x6003034831b0
>                          Column Number = 3
>                          Target Type = 1 SQL_CHAR
>                          Buffer Length = 1024
>                          Target Value = 0x77a24e1ff318
>                          StrLen Or Ind = 0x7ffc233ad5f0
> [ODBC][103886][1709340852.301423][SQLGetData.c][545]
>                  Exit:[SQL_SUCCESS]
>                          Buffer = [123-456-7890]
>                          Strlen Or Ind = 0x7ffc233ad5f0 -> 1
>
> as you can see, the target Type is SQL_CHAR
>
> any ideas?
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list