Commit 0a9f51f5 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#6657/6691 use proper SQL length data type

parent 9578bf01
......@@ -1219,7 +1219,7 @@ backsql_add( Operation *op, SlapReply *rs )
if ( !BACKSQL_IS_ADD( oc->bom_expect_return ) ) {
SWORD ncols;
SQLINTEGER value_len;
SQLLEN value_len;
if ( BACKSQL_CREATE_NEEDS_SELECT( bi ) ) {
SQLFreeStmt( sth, SQL_DROP );
......
......@@ -183,7 +183,7 @@ typedef struct {
UDWORD *col_prec;
SQLSMALLINT *col_type;
char **cols;
SQLINTEGER *value_len;
SQLLEN *value_len;
} BACKSQL_ROW_NTS;
/*
......
......@@ -189,25 +189,25 @@ RETCODE backsql_Prepare( SQLHDBC dbh, SQLHSTMT *sth, const char* query, int time
#define backsql_BindParamStr( sth, par_ind, io, str, maxlen ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_CHAR, SQL_VARCHAR, \
(SQLUINTEGER)(maxlen), 0, (SQLPOINTER)(str), \
(SQLUINTEGER)(maxlen), NULL )
(SQLULEN)(maxlen), 0, (SQLPOINTER)(str), \
(SQLLEN)(maxlen), NULL )
#define backsql_BindParamBerVal( sth, par_ind, io, bv ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_CHAR, SQL_VARCHAR, \
(SQLUINTEGER)(bv)->bv_len, 0, \
(SQLULEN)(bv)->bv_len, 0, \
(SQLPOINTER)(bv)->bv_val, \
(SQLUINTEGER)(bv)->bv_len, NULL )
(SQLLEN)(bv)->bv_len, NULL )
#define backsql_BindParamInt( sth, par_ind, io, val ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_ULONG, SQL_INTEGER, \
0, 0, (SQLPOINTER)(val), 0, (SQLINTEGER*)NULL )
0, 0, (SQLPOINTER)(val), 0, (SQLLEN*)NULL )
#define backsql_BindParamNumID( sth, par_ind, io, val ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), BACKSQL_C_NUMID, SQL_INTEGER, \
0, 0, (SQLPOINTER)(val), 0, (SQLINTEGER*)NULL )
0, 0, (SQLPOINTER)(val), 0, (SQLLEN*)NULL )
#ifdef BACKSQL_ARBITRARY_KEY
#define backsql_BindParamID( sth, par_ind, io, id ) \
......
......@@ -148,7 +148,7 @@ backsql_BindRowAsStrings_x( SQLHSTMT sth, BACKSQL_ROW_NTS *row, void *ctx )
} else {
SQLCHAR colname[ 64 ];
SQLSMALLINT name_len, col_type, col_scale, col_null;
UDWORD col_prec;
SQLLEN col_prec;
int i;
#ifdef BACKSQL_TRACE
......@@ -180,8 +180,8 @@ backsql_BindRowAsStrings_x( SQLHSTMT sth, BACKSQL_ROW_NTS *row, void *ctx )
goto nomem;
}
row->value_len = (SQLINTEGER *)ber_memcalloc_x( row->ncols,
sizeof( SQLINTEGER ), ctx );
row->value_len = (SQLLEN *)ber_memcalloc_x( row->ncols,
sizeof( SQLLEN ), ctx );
if ( row->value_len == NULL ) {
goto nomem;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment