dbd/db2/dbd_db2.h

Sat, 30 Jun 2012 00:37:19 +0200

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 30 Jun 2012 00:37:19 +0200
changeset 46
5ba1dd988961
parent 33
6c64c45e7d8f
permissions
-rw-r--r--

MySQL: Fix off-by-one in allocation and pass address of correct bind result buffer to mysql_stmt_fetch_column()

#undef UNICODE

#include <sqlcli1.h>
#include <sqlutil.h>
#include <sqlenv.h>
#include <dbd/common.h>

#define DBD_DB2_CONNECTION   "DBD.DB2.Connection"
#define DBD_DB2_STATEMENT    "DBD.DB2.Statement"

/*
 * result set metadata
 */

typedef struct _resultset {
    SQLSMALLINT name_len;
    SQLSMALLINT type;
    SQLUINTEGER size;
    SQLSMALLINT scale;
    SQLCHAR name[32];
} resultset_t;

/*
 * bind parameters
 */
typedef struct _bindparams { 
    SQLCHAR *buffer;
    SQLINTEGER len;
    SQLINTEGER buffer_len;
} bindparams_t;

/*
 * connection object implentation
 */
typedef struct _connection {
    SQLHANDLE env;
    SQLHANDLE db2;
} connection_t;

/*
 * statement object implementation
 */
typedef struct _statement {
    resultset_t * resultset;
    bindparams_t * bind;
    unsigned char *buffer;
    SQLSMALLINT num_result_columns; /* variable for SQLNumResultCols */

    SQLHANDLE stmt;
    SQLHANDLE db2;
} statement_t;

mercurial