Hello again,

I can confirm the RedHat patch mentioned above (and attached to this bug report for the sake of thoroughness) applies successfully to the Debian/Squeeze openldap 2.4.23 package's source and solves this issue. Automatic slapd tests carried out during debuild also complete successfully after applying the patch.

Best regards,

Cédric Dufour

diff -rupN openldap-old/servers/slapd/back-sql/add.c openldap-new/servers/slapd/back-sql/add.c
--- openldap-old/servers/slapd/back-sql/add.c	2011-08-02 12:37:54.699418798 +0200
+++ openldap-new/servers/slapd/back-sql/add.c	2011-08-02 12:38:52.634294367 +0200
@@ -1230,7 +1230,7 @@ backsql_add( Operation *op, SlapReply *r
 
 	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 );
diff -rupN openldap-old/servers/slapd/back-sql/back-sql.h openldap-new/servers/slapd/back-sql/back-sql.h
--- openldap-old/servers/slapd/back-sql/back-sql.h	2010-04-13 22:23:42.000000000 +0200
+++ openldap-new/servers/slapd/back-sql/back-sql.h	2011-08-02 12:39:33.546206351 +0200
@@ -183,7 +183,7 @@ typedef struct {
 	UDWORD		*col_prec;
 	SQLSMALLINT	*col_type;
 	char		**cols;
-	SQLINTEGER	*value_len;
+	SQLLEN	*value_len;
 } BACKSQL_ROW_NTS;
 
 /*
diff -rupN openldap-old/servers/slapd/back-sql/proto-sql.h openldap-new/servers/slapd/back-sql/proto-sql.h
--- openldap-old/servers/slapd/back-sql/proto-sql.h	2010-04-13 22:23:43.000000000 +0200
+++ openldap-new/servers/slapd/back-sql/proto-sql.h	2011-08-02 12:41:52.649906469 +0200
@@ -189,20 +189,20 @@ RETCODE backsql_Prepare( SQLHDBC dbh, SQ
 #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 )
 
 #ifdef BACKSQL_ARBITRARY_KEY
 #define backsql_BindParamID( sth, par_ind, io, id )			\
diff -rupN openldap-old/servers/slapd/back-sql/sql-wrap.c openldap-new/servers/slapd/back-sql/sql-wrap.c
--- openldap-old/servers/slapd/back-sql/sql-wrap.c	2010-04-13 22:23:43.000000000 +0200
+++ openldap-new/servers/slapd/back-sql/sql-wrap.c	2011-08-02 12:44:29.337567490 +0200
@@ -148,7 +148,7 @@ backsql_BindRowAsStrings_x( SQLHSTMT sth
 	} 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
 			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;
 		}

Reply via email to