Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.2.4
-
None
Description
We have introduced connection string option to control where are statements prepared at connection level. But It's unlikely optimal, it would make much more sense to do for individual statement.
The driver conforms to ODBC 3.8 specification, and it allows drivers to have among other things driver specific statement and connection attributes. Independence from the data source is one of the greatest values of use of the ODBC, and use of such attributes won't cause the vendor lock, i.e. dependency on concrete ODBC driver. If application sets these attributes with other driver, it will simply get the HYC00 error "Optional feature not implemented". If the driver manager does not support ODBC 3.8, it will return error about unknown attribute HY024. In any case the application should simply ignore the error(or process it in some way but not to stop) and using of these attributes with other data sources will not have any bad outcomes, while improving performance if used with the data source they have been designed for.
At the moment we need to have 2 attributes - one to make SQLExecDirect to use SSPS/binary protocol, and second - to make SQLPrepare to use CSPS/text protocol. The attributes should be possible to set at connection level(e.g. to prevent changing them by connstring option or force to change default). EDSERVER and PREPONCLIENT options should set default values for these new attributes.
Attachments
Issue Links
- relates to
-
ODBC-451 Introduce connection string option to force SQLExecDirect to use server side prepared statements(SSPS)
-
- Closed
-
Activity
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
SQL_ATTR_EXECDIRECT_ON_SERVER=25100 to control if SQLExecDirect should
use server or client side prepared statements. The attribute can be set
also at connection level - that will define default value for all
statements creted for the connection and is equivalent of use of the
EDSERVER connection string option.
SQL_ATTR_PREPARE_ON_CLIENT=25101 to control if SQLPrepare should
use server or client side prepared statements. The attribute can be set
also at connection level - that will define default value for all
statements creted for the connection and is equivalent of use of the
PREPONCLIENT connection string option.
Both attributes accepts and set SQLLEN values SQL_TRUE or SQL_FALSE.
SQL_TRUE means that SQLExecDirect should use SSPS for
SQL_ATTR_EXECDIRECT_ON_SERVER and SQLPrepare should use CSPS for
SQL_ATTR_PREPARE_ON_CLIENT attributes.
The values for attributes have been defined in the introduced header
file sqlmariadb.h that will be included in distributions. It will be
installed in the include/mariadb directory.
But application may use this values directly and not introduce
additional build dependency.
New testsuite mariadb_specific.c has been added to test these new attributes(and other driver specific stuff we may need to add in the future)