[asterisk-commits] tilghman: trunk r99018 - /trunk/funcs/func_odbc.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jan 18 00:58:35 CST 2008
Author: tilghman
Date: Fri Jan 18 00:58:35 2008
New Revision: 99018
URL: http://svn.digium.com/view/asterisk?view=rev&rev=99018
Log:
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
Modified:
trunk/funcs/func_odbc.c
Modified: trunk/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_odbc.c?view=diff&rev=99018&r1=99017&r2=99018
==============================================================================
--- trunk/funcs/func_odbc.c (original)
+++ trunk/funcs/func_odbc.c Fri Jan 18 00:58:35 2008
@@ -98,7 +98,7 @@
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 @@
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 @@
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 @@
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;
More information about the asterisk-commits
mailing list