[asterisk-bugs] [JIRA] (ASTERISK-28065) res_odbc: missing SQL error diagnostic
Alexei Gradinari (JIRA)
noreply at issues.asterisk.org
Thu Sep 20 14:09:54 CDT 2018
[ https://issues.asterisk.org/jira/browse/ASTERISK-28065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=244921#comment-244921 ]
Alexei Gradinari commented on ASTERISK-28065:
---------------------------------------------
With my patch I get
WARNING res_odbc.c: SQL Execute returned an error: 23000: [MySQL][ODBC 5.3(w) Driver][mysqld-5.6.41-log]Duplicate entry....
WARNING res_odbc.c: SQL Execute error -1!
> res_odbc: missing SQL error diagnostic
> --------------------------------------
>
> Key: ASTERISK-28065
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-28065
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_odbc
> Affects Versions: 13.23.0
> Environment: Linux Slackware-64 14.2
> unixODBC 2.3.7pre
> mysql-connector-odbc 5.3.11
> mysql 5.6.41
> Reporter: Alexei Gradinari
>
> On SQL error there is not diagnostic information about this error.
> There is only
> WARNING res_odbc.c: SQL Execute error -1!
> The function ast_odbc_print_errors calls a SQLGetDiagField to get the number of available diagnostic records, but the SQLGetDiagField returns 0.
> However SQLGetDiagRec could return one diagnostic records in this case.
> Looking at many example of getting diagnostics error information I found out that the best way it's to use only SQLGetDiagRec while it returns SQL_SUCCESS.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list