aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-18 06:58:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-18 06:58:35 +0000
commitc7e5938e4858bdaebee92c14b33461ce4f587c30 (patch)
tree8890ef54e6fd66fe1f78f382f0a0eadd74bd77d3
parent9ee1b6fabe504a0165d01575620bdb130a75d27c (diff)
Convert func_odbc to use SQLExecDirect for speed
(closes issue #10723) Reported by: mnicholson Patches: func-odbc-direct-execute1.diff uploaded by mnicholson (license 96) Tested by: Corydon76, mnicholson, falves11 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99018 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--funcs/func_odbc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index f472e2599..af4bab069 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -98,7 +98,7 @@ static void odbc_datastore_free(void *data)
ast_free(result);
}
-static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
+static SQLHSTMT generic_execute(struct odbc_obj *obj, void *data)
{
int res;
char *sql = data;
@@ -110,9 +110,9 @@ static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
return NULL;
}
- res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
+ res = SQLExecDirect(stmt, (unsigned char *)sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
+ ast_log(LOG_WARNING, "SQL Exec Direct failed![%s]\n", sql);
SQLCloseCursor(stmt);
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
return NULL;
@@ -209,7 +209,7 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co
if (!ast_strlen_zero(query->writehandle[dsn])) {
obj = ast_odbc_request_obj(query->writehandle[dsn], 0);
if (obj)
- stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, buf);
+ stmt = ast_odbc_direct_execute(obj, generic_execute, buf);
}
if (stmt)
break;
@@ -310,7 +310,7 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
if (!ast_strlen_zero(query->writehandle[dsn])) {
obj = ast_odbc_request_obj(query->writehandle[dsn], 0);
if (obj)
- stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, sql);
+ stmt = ast_odbc_direct_execute(obj, generic_execute, sql);
}
if (stmt)
break;