[asterisk-bugs] [Asterisk 0010722]: [patch] Allow odbc queries using SQLExecDirect() (ie. non prepared statement execution)

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Sep 14 11:26:06 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10722 
====================================================================== 
Reported By:                mnicholson
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   10722
Category:                   Resources/res_odbc
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 82391 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-14-2007 11:15 CDT
Last Modified:              09-14-2007 11:26 CDT
====================================================================== 
Summary:                    [patch] Allow odbc queries using SQLExecDirect()
(ie. non prepared statement execution)
Description: 
This patch adds a hook into res_odbc to allow non prepared statement
execution.  The idea behind prepared statements (SQLPrepare() ->
SQLExecute()) in ODBC is to allow efficient execution of a single statement
multiple times.  I do not think there is a single place in asterisk where
we execute the same query over and over again in this manner.  Generally we
prepare a query execute it, then free the statement handle.

This patch provides a hook to execute a query with in the res_odbc
framework (handling db reconnection and such) but use SQLExecDirect() which
does not require SQLPrepare().  On MS SQL databases this can dramatically
improve database performance.  Patches to use this function from func_odbc
and voicemail should follow from vovochka and myself.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 09-14-07 11:26  
---------------------------------------------------------------------- 
You're ignoring the many places where we need to bind parameters prior to
statement execution.  All of those places (which is the majority of
Asterisk) require the separate SQLPrepare, SQLBindParam, SQLExecute.

We actually had the execdirect method in 1.2 and it was removed, because
it was never used (or really, never used in an appropriate way). 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-14-07 11:26  Corydon76      Note Added: 0070544                          
======================================================================




More information about the asterisk-bugs mailing list