[Asterisk-code-review] res odbc: fix missing SQL error diagnostic (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Thu Sep 20 17:31:33 CDT 2018


Hello Jenkins2, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/10226

to look at the new patch set (#2).

Change subject: res_odbc: fix missing SQL error diagnostic
......................................................................

res_odbc: fix missing SQL error diagnostic

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.

Also this patch adds calls of ast_odbc_print_errors on SQL_ERROR
to res_config_odbc.

ASTERISK-28065 #close

Change-Id: Iba5ae5470ac49ecd911dd084effbe9efac68ccc1
---
M res/res_config_odbc.c
M res/res_odbc.c
2 files changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/10226/2
-- 
To view, visit https://gerrit.asterisk.org/10226
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iba5ae5470ac49ecd911dd084effbe9efac68ccc1
Gerrit-Change-Number: 10226
Gerrit-PatchSet: 2
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180920/5fb62052/attachment.html>


More information about the asterisk-code-review mailing list