[Asterisk-code-review] func odbc: NODATA if SQLNumResultCols returned 0 columns on ... (asterisk[13])
Alexei Gradinari
asteriskteam at digium.com
Thu May 31 17:04:27 CDT 2018
Alexei Gradinari has posted comments on this change. ( https://gerrit.asterisk.org/9070 )
Change subject: func_odbc: NODATA if SQLNumResultCols returned 0 columns on readsql
......................................................................
Patch Set 1:
(2 comments)
https://gerrit.asterisk.org/#/c/9070/1/funcs/func_odbc.c
File funcs/func_odbc.c:
https://gerrit.asterisk.org/#/c/9070/1/funcs/func_odbc.c@862
PS1, Line 862: if (colcount <= 0) {
: ast_verb(4, "Returned %d columns [%s]\n", colcount, ast_str_buffer(sql));
: buf[0] = '\0';
: ast_copy_string(rowcount, "0", sizeof(rowcount));
: status = "NODATA";
: SQLCloseCursor(stmt);
: SQLFreeHandle (SQL_HANDLE_STMT, stmt);
: release_obj_or_dsn (&obj, &dsn);
: if (!bogus_chan) {
: pbx_builtin_setvar_helper(chan, "ODBCROWS", rowcount);
: pbx_builtin_setvar_helper(chan, "ODBCSTATUS", status);
: ast_autoservice_stop(chan);
: }
: odbc_datastore_free(resultset);
: return 0;
: }
> 'rowcount' and 'status' are local variables and we won't use them here unle
OK
https://gerrit.asterisk.org/#/c/9070/1/funcs/func_odbc.c@1547
PS1, Line 1547: break;
> Are you sure we shouldn't be returning here instead of breaking?
I did the same as for SQL_NO_DATA
--
To view, visit https://gerrit.asterisk.org/9070
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie0f7bdac6c405aa5bbd38932c7b831f90729ee19
Gerrit-Change-Number: 9070
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Thu, 31 May 2018 22:04:27 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180531/7cc57f82/attachment.html>
More information about the asterisk-code-review
mailing list