Menu

#119 In DB Scheme docs, LCR table, priority should be int

trunk
closed-fixed
tools (25)
5
2009-03-19
2009-03-17
No

Hi!

In DB Scheme docs, LCR table, priority column should be 'int' and not 'char'.

Discussion

  • Bogdan-Andrei Iancu

    But this is ok, as char is an integer data type and it is translated correctly :
    for mysql -> TINYINT
    for postgres -> SMALLINT
    for oracle -> NUMBER

    I guess this is ok, right ?

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
     
  • Alex Massover

    Alex Massover - 2009-03-18

    I'm afraid that it makes troubles. I found this because it didn't worked for me with MSSQL via ODBC. char(4) was translated to 4 digits number and every lcr_reload priority was changing. I changed it to tinyint and everything became OK and lcr_dump gives me correct rules.

    I think it just typo in DOCs. In MySQL installation scripts the data type is int.

     
  • Bogdan-Andrei Iancu

    But in both docs (http://www.opensips.org/html/docs/db/db-schema-devel.html#GEN-DB-LCR) and db schema, the priority is defined as "unsigned char" (with no size).

    So, for MSSQL, this "unsigned char" is translated to a 4 digits number (xxxx) ? if so, what is the problem? do you have priorities larger then 4 digits, or the db_unixodbc is not properly loading the value?

     
  • Alex Massover

    Alex Massover - 2009-03-18

    In /scripts/mysql/lcr-create.sql in 1.4.4:
    priority TINYINT UNSIGNED NOT NULL
    oracle script:
    priority NUMBER(5)
    postgres script:
    priority SMALLINT NOT NULL

    Only the doc says that it's char.

    Yes it's translated to 4 digits number (xxxx).
    The problem with ODBC and MSSQL is that this 4 digits number (xxxx) is every time different for every lcr_reload. This translation is somehow not unique. And I have in DB only number from 1 to 16 in priority column.

    Changing it to tinyint fixing the problem.

     
  • Bogdan-Andrei Iancu

    To avoid any issues with less standard data-types, I already changed th column type to int.

    Thanks and regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • labels: 1120303 --> tools
    • milestone: --> trunk
    • status: open --> closed-fixed
     

Log in to post a comment.