[asterisk-bugs] [JIRA] (ASTERISK-30023) cdr_adaptive_odbc: does not support DATETIME database columns

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Sep 14 10:18:15 CDT 2022


     [ https://issues.asterisk.org/jira/browse/ASTERISK-30023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asterisk Team updated ASTERISK-30023:
-------------------------------------

    Target Release Version/s: 20.0.0

> cdr_adaptive_odbc: does not support DATETIME database columns
> -------------------------------------------------------------
>
>                 Key: ASTERISK-30023
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30023
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_adaptive_odbc
>    Affects Versions: 18.11.1
>         Environment: Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Asterisk 18.10.1, Asterisk 18.11.2, MySQL ODBC connector 8.0.28.
>            Reporter: Gregory Massel
>            Assignee: Joshua C. Colp
>      Target Release: 16.26.0, 18.12.0, 19.4.0, 20.0.0
>
>
> When configuring cdr_adaptive_odbc with recent and/or latest versions of the MySQL ODBC connector and UnixODBC, and MySQL 8 (wasn't an issue on v5.7 with older connectors), cdr_adaptive_odbc no longer supports the 'start' column being a DATETIME column.
> It will log:
> {noformat}WARNING[1925399]: cdr_adaptive_odbc.c:731 odbc_log: Column type 9 (field 'asterisk-cdr-connector:cdr:start') is unsupported at this time.{noformat}
> The simple way to fix this from the database side is to alter the column from a DATETIME to a TIMESTAMP type. However, this is not immediately obvious to most and, there is no good reason why cdr_adaptive_odbc shouldn't support a DATETIME column type.
> To support DATETIME columns properly requires just a single additional line of code:
> {noformat}
> *** cdr/cdr_adaptive_odbc.c~    2022-04-14 23:53:34.000000000 +0200
> --- cdr/cdr_adaptive_odbc.c     2022-04-20 05:00:08.956054103 +0200
> ***************
> *** 564,569 ****
> --- 564,570 ----
>                                         break;
>                                 case SQL_TYPE_TIMESTAMP:
>                                 case SQL_TIMESTAMP:
> +                               case SQL_DATETIME:
>                                         if (ast_strlen_zero(colptr)) {
>                                                 continue;
>                                         } else {
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list