diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2011-02-15 07:03:44 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2011-02-15 07:03:44 +0000 |
commit | e38fa2d3cdf46f6ddd4143d39e966abed21b613f (patch) | |
tree | 1cfd596e8624a719082a68ea93969d3242006e9f /funcs | |
parent | 5c49abfcf3fd36957eef8e38a179fdba5e8a6c8d (diff) |
Merged revisions 307837 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r307837 | tilghman | 2011-02-15 01:02:45 -0600 (Tue, 15 Feb 2011) | 15 lines
Merged revisions 307836 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r307836 | tilghman | 2011-02-15 01:01:37 -0600 (Tue, 15 Feb 2011) | 8 lines
Need to retrieve the rows affected before using the associated variable.
(closes issue #18795)
Reported by: irroot
Patches:
20110211__issue18795.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_odbc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index 7f2de02fc..a5f02316f 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -336,6 +336,10 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co } } + if (stmt) { + SQLRowCount(stmt, &rows); + } + if (stmt && rows == 0 && ast_str_strlen(insertbuf) != 0) { SQLCloseCursor(stmt); SQLFreeHandle(SQL_HANDLE_STMT, stmt); @@ -356,7 +360,6 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co } } else if (stmt) { status = "SUCCESS"; - SQLRowCount(stmt, &rows); } AST_RWLIST_UNLOCK(&queries); |