[SR-Users] Use mysql view to load data into htable

Jan Hazenberg jenus at cyberchaos.nl
Wed Apr 12 15:27:37 CEST 2017


Ovidiu,

Thanks for the pointer, with a correct CAST it works fine.

Jan

Ovidiu Sas schreef op 2017-04-12 15:09:
> Based on how your blacklist_prefix table is defined, you will need to
> perform some casts to make sure that the view matches the layout of
> the htable:
>  ID                    NOT NULL UNSIGNED INT
>  KEY_NAME     VARCHAR2(64)
>  KEY_TYPE      INT
>  VALUE_TYPE  INT
>  KEY_VALUE    VARCHAR2(16)
>  EXPIRES         INT
> 
> Regards,
> Ovidiu Sas
> 
> On Wed, Apr 12, 2017 at 9:02 AM, Jan Hazenberg <jenus at cyberchaos.nl> 
> wrote:
>> Hello,
>> 
>> I'm trying to load data from a mysql table into a htable using a mysql 
>> view.
>> But when i start kamailio i get the following error:
>> 
>> ERROR: htable [ht_db.c:345]: ht_db_load_table(): Wrong db type [3] for
>> key_type column
>> 
>> Here a example of a view i'm trying to use:
>> 
>> CREATE OR REPLACE VIEW `view_blacklist_prefix` AS SELECT
>> prefix AS  key_name, '0' AS key_type, '0' AS value_type, '1' AS 
>> key_value,
>> '0' AS expires
>> FROM openser.blacklist_prefix
>> GO
>> 
>> Should it be possible to use a mysql view as input for a htable?
>> 
>> 
>> Thanks,
>> 
>> Jan Hazenberg
>> 
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list