Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-452

Add Statement and Connection attributes to control where queries are prepared by SQLExecDirect and SQLPrepare

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.2.4
    • 3.2.5
    • General
    • 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

          Activity

            Lawrin Lawrin Novitsky created issue -
            Lawrin Lawrin Novitsky made changes -
            Field Original Value New Value

            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)

            Lawrin Lawrin Novitsky added a comment - 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)
            Lawrin Lawrin Novitsky made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

              Lawrin Lawrin Novitsky
              Lawrin Lawrin Novitsky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.