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)
(cherry picked from commit f525e3e)
  • Loading branch information
Giovanni Mele authored and miconda committed Jul 4, 2016
1 parent 6b32814 commit 3f9bb62
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 3f9bb62

Please sign in to comment.