]> git.sur5r.net Git - openldap/commitdiff
ITS#6657/6691 use proper SQL length data type
authorHoward Chu <hyc@openldap.org>
Mon, 13 Jun 2011 20:54:56 +0000 (13:54 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 13 Jun 2011 20:54:56 +0000 (13:54 -0700)
servers/slapd/back-sql/add.c
servers/slapd/back-sql/back-sql.h
servers/slapd/back-sql/proto-sql.h
servers/slapd/back-sql/sql-wrap.c

index 4afd12af52b05413ce07d930bac79473636af1ca..af617000fb4c85743a7dbb9b53377ddd1f534dfe 100644 (file)
@@ -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 );
index 638267a7deffbac70d7e0472ffa8867daae85d7d..936bd7703ac612011f6a82846d81110889493ace 100644 (file)
@@ -183,7 +183,7 @@ typedef struct {
        UDWORD          *col_prec;
        SQLSMALLINT     *col_type;
        char            **cols;
-       SQLINTEGER      *value_len;
+       SQLLEN          *value_len;
 } BACKSQL_ROW_NTS;
 
 /*
index 1302c6d24e04fbdc39afc22820082eb577d116ed..2d8852f051ecbac89208a405e7ff8db0100814d1 100644 (file)
@@ -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 )                    \
index 078af5509464104be0529a86a149074549249c0c..cd73ad5b183819dadfe3344665527aff75138bbf 100644 (file)
@@ -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;
                }