Skip to content

Commit

Permalink
db_unixodbc: do not consider SQL_NO_DATA return code as an error
Browse files Browse the repository at this point in the history
(cherry picked from commit feb195b)
(cherry picked from commit 6f8ff98)
  • Loading branch information
Giovanni Mele authored and miconda committed Jun 29, 2016
1 parent 587d032 commit f525e3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/db_unixodbc/dbase.c
Expand Up @@ -127,7 +127,9 @@ static int db_unixodbc_submit_query(const db1_con_t* _h, const str* _s)
}

ret=SQLExecDirect(CON_RESULT(_h), (SQLCHAR*)_s->s, _s->len);
if (!SQL_SUCCEEDED(ret))

/* Handle SQL_NO_DATA as a valid return code. DELETE and UPDATE statements may return this return code if nothing was deleted/updated. */
if (!SQL_SUCCEEDED(ret) && (ret != SQL_NO_DATA))
{
SQLCHAR sqlstate[7];
LM_ERR("rv=%d. Query= %.*s\n", ret, _s->len, _s->s);
Expand Down

0 comments on commit f525e3e

Please sign in to comment.