[Home]

Summary:ASTERISK-28065: res_odbc: missing SQL error diagnostic
Reporter:Alexei Gradinari (alexei gradinari)Labels:
Date Opened:2018-09-20 14:02:55Date Closed:2018-09-28 10:39:28
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_odbc
Versions:13.23.0 Frequency of
Occurrence
Related
Issues:
Environment:Linux Slackware-64 14.2 unixODBC 2.3.7pre mysql-connector-odbc 5.3.11 mysql 5.6.41Attachments:
Description: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.
Comments:By: Asterisk Team (asteriskteam) 2018-09-20 14:02:56.394-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Alexei Gradinari (alexei gradinari) 2018-09-20 14:08:35.217-0500

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!

By: Friendly Automation (friendly-automation) 2018-09-28 10:39:29.720-0500

Change 10226 merged by Kevin Harwell:
res_odbc: fix missing SQL error diagnostic

[https://gerrit.asterisk.org/10226|https://gerrit.asterisk.org/10226]

By: Friendly Automation (friendly-automation) 2018-09-28 10:39:38.498-0500

Change 10283 merged by Kevin Harwell:
res_odbc: fix missing SQL error diagnostic

[https://gerrit.asterisk.org/10283|https://gerrit.asterisk.org/10283]

By: Friendly Automation (friendly-automation) 2018-09-28 10:39:45.576-0500

Change 10284 merged by Kevin Harwell:
res_odbc: fix missing SQL error diagnostic

[https://gerrit.asterisk.org/10284|https://gerrit.asterisk.org/10284]

By: Friendly Automation (friendly-automation) 2018-09-28 10:40:06.906-0500

Change 10285 merged by Kevin Harwell:
res_odbc: fix missing SQL error diagnostic

[https://gerrit.asterisk.org/10285|https://gerrit.asterisk.org/10285]