Commit b4e37e51 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fixes for ITS#3480,3485,3489; implementation of DISCLOSE access for all...

fixes for ITS#3480,3485,3489; implementation of DISCLOSE access for all operations (ITS#3472); ITS#3432.4; added value validate/pretty when applicable (see comments and #defines in back-sql.h)
parent 56e45fc1
......@@ -301,6 +301,22 @@ in table \fIldap_entries\fP needs a subsequent select to collect
the automatically assigned ID, instead of being returned
by a stored procedure.
.LP
.B fetch_attrs <attrlist>
.br
.B fetch_all_attrs { NO | yes }
.RS
The first statement allows to provide a list of attributes that
must always be fetched in addition to those requested by any specific
operation, because they are required for the proper usage of the
backend. For instance, all attributes used in ACLs should be listed
here. The second statement is a shortcut to require all attributes
to be always loaded. Note that the dynamically generated attributes,
e.g. \fIhasSubordinates\fP, \fIentryDN\fP and other implementation
dependent attributes are \fBNOT\fP generated at this point, for
consistency with the rest of slapd. This may change in the future.
.RE
.TP
.B sqllayer <name> [...]
Loads the layer \fB<name>\fP onto a stack of helpers that are used
......
......@@ -952,7 +952,6 @@ backsql_add( Operation *op, SlapReply *rs )
RETCODE rc;
backsql_oc_map_rec *oc = NULL;
backsql_srch_info bsi;
backsql_entryID parent_id = BACKSQL_ENTRYID_INIT;
Entry p = { 0 }, *e = NULL;
Attribute *at,
*at_objectClass = NULL;
......@@ -1125,6 +1124,15 @@ backsql_add( Operation *op, SlapReply *rs )
goto done;
}
if ( get_assert( op ) &&
( test_filter( op, op->oq_add.rs_e, get_assertion( op ) )
!= LDAP_COMPARE_TRUE ) )
{
rs->sr_err = LDAP_ASSERTION_FAILED;
e = op->ora_e;
goto done;
}
if ( !access_allowed_mask( op, op->ora_e,
slap_schema.si_ad_entry,
NULL, ACL_WRITE, NULL, &mask ) )
......@@ -1140,7 +1148,7 @@ backsql_add( Operation *op, SlapReply *rs )
* the id of the added row; otherwise the procedure
* is expected to return the id as the first column of a select
*/
rc = SQLAllocStmt( dbh, &sth );
rc = backsql_Prepare( dbh, &sth, oc->bom_create_proc, 0 );
if ( rc != SQL_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
rs->sr_text = "SQL-backend error";
......@@ -1152,10 +1160,11 @@ backsql_add( Operation *op, SlapReply *rs )
if ( BACKSQL_IS_ADD( oc->bom_expect_return ) ) {
rc = backsql_BindParamInt( sth, 1, SQL_PARAM_OUTPUT, &new_keyval );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_add_attr(): "
"error binding keyval parameter for objectClass %s\n",
oc->bom_oc->soc_cname.bv_val, 0, 0 );
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"error binding keyval parameter "
"for objectClass %s\n",
op->ora_e->e_name.bv_val,
oc->bom_oc->soc_cname.bv_val, 0 );
backsql_PrintErrors( bi->sql_db_env, dbh,
sth, rc );
SQLFreeStmt( sth, SQL_DROP );
......@@ -1186,11 +1195,12 @@ backsql_add( Operation *op, SlapReply *rs )
oc->bom_create_hint->ad_cname.bv_val,
0, 0 );
}
colnum++;
}
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): executing \"%s\"\n",
op->ora_e->e_name.bv_val, oc->bom_create_proc, 0 );
rc = SQLExecDirect( sth, oc->bom_create_proc, SQL_NTS );
rc = SQLExecute( sth );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"create_proc execution failed\n",
......@@ -1203,9 +1213,8 @@ backsql_add( Operation *op, SlapReply *rs )
goto done;
}
if ( op->o_noop ) {
SQLTransact( SQL_NULL_HENV, dbh, SQL_ROLLBACK );
}
/* FIXME: after SQLExecute(), the row is already inserted
* (at least with PostgreSQL and unixODBC); needs investigation */
if ( !BACKSQL_IS_ADD( oc->bom_expect_return ) ) {
SWORD ncols;
......@@ -1213,7 +1222,8 @@ backsql_add( Operation *op, SlapReply *rs )
if ( BACKSQL_CREATE_NEEDS_SELECT( bi ) ) {
SQLFreeStmt( sth, SQL_DROP );
rc = SQLAllocStmt( dbh, &sth );
rc = backsql_Prepare( dbh, &sth, oc->bom_create_keyval, 0 );
if ( rc != SQL_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
rs->sr_text = "SQL-backend error";
......@@ -1221,7 +1231,7 @@ backsql_add( Operation *op, SlapReply *rs )
goto done;
}
rc = SQLExecDirect( sth, oc->bom_create_keyval, SQL_NTS );
rc = SQLExecute( sth );
if ( rc != SQL_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
rs->sr_text = "SQL-backend error";
......@@ -1340,10 +1350,10 @@ backsql_add( Operation *op, SlapReply *rs )
rc = backsql_BindParamBerVal( sth, 1, SQL_PARAM_INPUT, &realdn );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_add_attr(): "
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"error binding DN parameter for objectClass %s\n",
oc->bom_oc->soc_cname.bv_val, 0, 0 );
op->ora_e->e_name.bv_val,
oc->bom_oc->soc_cname.bv_val, 0 );
backsql_PrintErrors( bi->sql_db_env, dbh,
sth, rc );
SQLFreeStmt( sth, SQL_DROP );
......@@ -1356,10 +1366,11 @@ backsql_add( Operation *op, SlapReply *rs )
rc = backsql_BindParamInt( sth, 2, SQL_PARAM_INPUT, &oc->bom_id );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_add_attr(): "
"error binding objectClass ID parameter for objectClass %s\n",
oc->bom_oc->soc_cname.bv_val, 0, 0 );
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"error binding objectClass ID parameter "
"for objectClass %s\n",
op->ora_e->e_name.bv_val,
oc->bom_oc->soc_cname.bv_val, 0 );
backsql_PrintErrors( bi->sql_db_env, dbh,
sth, rc );
SQLFreeStmt( sth, SQL_DROP );
......@@ -1370,12 +1381,13 @@ backsql_add( Operation *op, SlapReply *rs )
goto done;
}
rc = backsql_BindParamID( sth, 3, SQL_PARAM_INPUT, &parent_id.eid_id );
rc = backsql_BindParamID( sth, 3, SQL_PARAM_INPUT, &bsi.bsi_base_id.eid_id );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_add_attr(): "
"error binding parent ID parameter for objectClass %s\n",
oc->bom_oc->soc_cname.bv_val, 0, 0 );
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"error binding parent ID parameter "
"for objectClass %s\n",
op->ora_e->e_name.bv_val,
oc->bom_oc->soc_cname.bv_val, 0 );
backsql_PrintErrors( bi->sql_db_env, dbh,
sth, rc );
SQLFreeStmt( sth, SQL_DROP );
......@@ -1388,10 +1400,11 @@ backsql_add( Operation *op, SlapReply *rs )
rc = backsql_BindParamInt( sth, 4, SQL_PARAM_INPUT, &new_keyval );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_add_attr(): "
"error binding entry ID parameter for objectClass %s\n",
oc->bom_oc->soc_cname.bv_val, 0, 0 );
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"error binding entry ID parameter "
"for objectClass %s\n",
op->ora_e->e_name.bv_val,
oc->bom_oc->soc_cname.bv_val, 0 );
backsql_PrintErrors( bi->sql_db_env, dbh,
sth, rc );
SQLFreeStmt( sth, SQL_DROP );
......@@ -1406,12 +1419,12 @@ backsql_add( Operation *op, SlapReply *rs )
bi->sql_insentry_stmt, op->ora_e->e_name.bv_val, 0 );
#ifdef BACKSQL_ARBITRARY_KEY
Debug( LDAP_DEBUG_TRACE, " for oc_map_id=%ld, "
"parent_id=%s, keyval=%ld\n",
oc->bom_id, parent_id.eid_id.bv_val, new_keyval );
"p_id=%s, keyval=%ld\n",
oc->bom_id, bsi.bsi_base_id.eid_id.bv_val, new_keyval );
#else /* ! BACKSQL_ARBITRARY_KEY */
Debug( LDAP_DEBUG_TRACE, " for oc_map_id=%ld, "
"parent_id=%ld, keyval=%ld\n",
oc->bom_id, parent_id.eid_id, new_keyval );
"p_id=%ld, keyval=%ld\n",
oc->bom_id, bsi.bsi_base_id.eid_id, new_keyval );
#endif /* ! BACKSQL_ARBITRARY_KEY */
rc = SQLExecute( sth );
if ( rc != SQL_SUCCESS ) {
......@@ -1430,26 +1443,29 @@ backsql_add( Operation *op, SlapReply *rs )
goto done;
}
/* FIXME: need ldap_entries.id of newly added entry */
SQLFreeStmt( sth, SQL_DROP );
if ( at_objectClass ) {
rs->sr_err = backsql_add_attr( op, rs, dbh, oc, at_objectClass, new_keyval );
rs->sr_err = backsql_add_attr( op, rs, dbh, oc,
at_objectClass, new_keyval );
if ( rs->sr_err != LDAP_SUCCESS ) {
e = op->ora_e;
goto done;
}
}
SQLFreeStmt( sth, SQL_DROP );
done:;
/*
* Commit only if all operations succeed
*/
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
SQLTransact( SQL_NULL_HENV, dbh, SQL_COMMIT );
if ( sth != SQL_NULL_HSTMT ) {
SQLUSMALLINT CompletionType = SQL_ROLLBACK;
} else {
SQLTransact( SQL_NULL_HENV, dbh, SQL_ROLLBACK );
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
CompletionType = SQL_COMMIT;
}
SQLTransact( SQL_NULL_HENV, dbh, CompletionType );
}
/*
......@@ -1497,7 +1513,10 @@ done:;
{
ch_free( realdn.bv_val );
}
(void)backsql_free_entryID( op, &parent_id, 0 );
if ( !BER_BVISNULL( &bsi.bsi_base_id.eid_ndn ) ) {
(void)backsql_free_entryID( op, &bsi.bsi_base_id, 0 );
}
if ( !BER_BVISNULL( &p.e_nname ) ) {
entry_clean( &p );
......
......@@ -76,13 +76,16 @@
* 1. id_query.patch applied (with changes)
* 2. shortcut.patch applied (reworked)
* 3. create_hint.patch applied
* 4. count_query.patch rejected (conflicts with other features)
* 4. count_query.patch applied (reworked)
* 5. returncodes.patch applied (with sanity checks)
* 6. connpool.patch under evaluation
* 7. modoc.patch under evaluation
* 8. miscfixes.patch applied (reworked; FIXME: other
* operations may need to load the
* entire entry for ACL purposes)
* 7. modoc.patch under evaluation (requires
* manageDSAit and "manage"
* access privileges)
* 8. miscfixes.patch applied (reworked; other
* operations need to load the
* entire entry for ACL purposes;
* see ITS#3480, now fixed)
*
* original description:
......@@ -195,6 +198,16 @@ typedef struct {
*/
#undef BACKSQL_TRACE
/*
* define to enable values counting for attributes
*/
#define BACKSQL_COUNTQUERY
/*
* define to enable prettification/validation of values
*/
#define BACKSQL_PRETTY_VALIDATE
/*
* define to enable varchars as unique keys in user tables
*
......@@ -333,6 +346,9 @@ typedef struct backsql_at_map_rec {
/* for optimization purposes attribute load query
* is preconstructed from parts on schemamap load time */
char *bam_query;
#ifdef BACKSQL_COUNTQUERY
char *bam_countquery;
#endif /* BACKSQL_COUNTQUERY */
/* following flags are bitmasks (first bit used for add_proc,
* second - for delete_proc) */
/* order of parameters for procedures above;
......
......@@ -79,6 +79,14 @@ backsql_compare( Operation *op, SlapReply *rs )
goto return_results;
}
if ( get_assert( op ) &&
( test_filter( op, &e, get_assertion( op ) )
!= LDAP_COMPARE_TRUE ) )
{
rs->sr_err = LDAP_ASSERTION_FAILED;
goto return_results;
}
if ( is_at_operational( op->oq_compare.rs_ava->aa_desc->ad_type ) ) {
SlapReply nrs = { 0 };
......
......@@ -87,14 +87,13 @@ backsql_delete( Operation *op, SlapReply *rs )
RETCODE rc;
int prc = LDAP_SUCCESS;
backsql_oc_map_rec *oc = NULL;
backsql_srch_info bsi;
backsql_srch_info bsi = { 0 };
backsql_entryID e_id = { 0 };
Entry d = { 0 }, p = { 0 }, *e = NULL;
struct berval pdn = BER_BVNULL;
int manageDSAit = get_manageDSAit( op );
/* first parameter no */
SQLUSMALLINT pno;
SQLUSMALLINT CompletionType = SQL_ROLLBACK;
Debug( LDAP_DEBUG_TRACE, "==>backsql_delete(): deleting entry \"%s\"\n",
op->o_req_ndn.bv_val, 0, 0 );
......@@ -114,12 +113,12 @@ backsql_delete( Operation *op, SlapReply *rs )
* Get the entry
*/
bsi.bsi_e = &d;
rc = backsql_init_search( &bsi, &op->o_req_ndn,
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
LDAP_SCOPE_BASE,
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
switch ( rc ) {
switch ( rs->sr_err ) {
case LDAP_SUCCESS:
break;
......@@ -144,6 +143,22 @@ backsql_delete( Operation *op, SlapReply *rs )
Debug( LDAP_DEBUG_TRACE, "backsql_delete(): "
"could not retrieve deleteDN ID - no such entry\n",
0, 0, 0 );
if ( !BER_BVISNULL( &d.e_nname ) ) {
/* FIXME: should always be true! */
e = &d;
} else {
e = NULL;
}
goto done;
}
if ( get_assert( op ) &&
( test_filter( op, &d, get_assertion( op ) )
!= LDAP_COMPARE_TRUE ) )
{
rs->sr_err = LDAP_ASSERTION_FAILED;
e = &d;
goto done;
}
......@@ -204,12 +219,12 @@ backsql_delete( Operation *op, SlapReply *rs )
dnParent( &op->o_req_ndn, &pdn );
bsi.bsi_e = &p;
e_id = bsi.bsi_base_id;
rc = backsql_init_search( &bsi, &pdn,
rs->sr_err = backsql_init_search( &bsi, &pdn,
LDAP_SCOPE_BASE,
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
BACKSQL_ISF_GET_ENTRY );
if ( rc != LDAP_SUCCESS ) {
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_delete(): "
"could not retrieve deleteDN ID - no such entry\n",
0, 0, 0 );
......@@ -471,22 +486,20 @@ backsql_delete( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_SUCCESS;
done:;
/*
* Commit only if all operations succeed
*
* FIXME: backsql_add() does not fail if add operations
* are not available for some attributes, or if
* a multiple value add actually results in a replace,
* or if a single operation on an attribute fails
* for any reason
*/
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
CompletionType = SQL_COMMIT;
if ( sth != SQL_NULL_HSTMT ) {
SQLUSMALLINT CompletionType = SQL_ROLLBACK;
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
CompletionType = SQL_COMMIT;
}
SQLTransact( SQL_NULL_HENV, dbh, CompletionType );
}
SQLTransact( SQL_NULL_HENV, dbh, CompletionType );
done:;
#ifdef SLAP_ACL_HONOR_DISCLOSE
if ( e != NULL ) {
if ( !access_allowed( op, e, slap_schema.si_ad_entry, NULL,
......@@ -501,7 +514,6 @@ done:;
}
}
}
#endif /* SLAP_ACL_HONOR_DISCLOSE */
send_ldap_result( op, rs );
......
......@@ -455,7 +455,21 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
RETCODE rc;
SQLHSTMT sth = SQL_NULL_HSTMT;
BACKSQL_ROW_NTS row;
int i;
unsigned long i,
k = 0,
oldcount = 0;
#ifdef BACKSQL_COUNTQUERY
unsigned long count,
countsize = sizeof( count ),
j;
Attribute *attr = NULL;
slap_mr_normalize_func *normfunc = NULL;
#endif /* BACKSQL_COUNTQUERY */
#ifdef BACKSQL_PRETTY_VALIDATE
slap_syntax_validate_func *validate = NULL;
slap_syntax_transform_func *pretty = NULL;
#endif /* BACKSQL_PRETTY_VALIDATE */
assert( at );
assert( bsi );
......@@ -472,9 +486,141 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
bsi->bsi_c_eid->eid_keyval );
#endif /* ! BACKSQL_ARBITRARY_KEY */
#ifdef BACKSQL_PRETTY_VALIDATE
validate = at->bam_ad->ad_type->sat_syntax->ssyn_validate;
pretty = at->bam_ad->ad_type->sat_syntax->ssyn_pretty;
if ( validate == NULL && pretty == NULL ) {
return 1;
}
#endif /* BACKSQL_PRETTY_VALIDATE */
#ifdef BACKSQL_COUNTQUERY
if ( at->bam_ad->ad_type->sat_equality ) {
normfunc = at->bam_ad->ad_type->sat_equality->smr_normalize;
}
/* Count how many rows will be returned. This avoids memory
* fragmentation that can result from loading the values in
* one by one and using realloc()
*/
rc = backsql_Prepare( bsi->bsi_dbh, &sth, at->bam_countquery, 0 );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error preparing count query: %s\n",
at->bam_countquery, 0, 0 );
backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc );
return 1;
}
rc = backsql_BindParamID( sth, 1, SQL_PARAM_INPUT,
&bsi->bsi_c_eid->eid_keyval );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error binding key value parameter\n", 0, 0, 0 );
SQLFreeStmt( sth, SQL_DROP );
return 1;
}
rc = SQLExecute( sth );
if ( ! BACKSQL_SUCCESS( rc ) ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error executing attribute count query '%s'\n",
at->bam_countquery, 0, 0 );
backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc );
SQLFreeStmt( sth, SQL_DROP );
return 1;
}
SQLBindCol( sth, (SQLUSMALLINT)1, SQL_C_LONG,
(SQLPOINTER)&count,
(SQLINTEGER)sizeof( count ),
&countsize );
rc = SQLFetch( sth );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error fetch results of count query: %s\n",
at->bam_countquery, 0, 0 );
backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc );
SQLFreeStmt( sth, SQL_DROP );
return 1;
}
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"number of values in query: %d\n", count, 0, 0 );
SQLFreeStmt( sth, SQL_DROP );
if ( count == 0 ) {
return 1;
}
attr = attr_find( bsi->bsi_e->e_attrs, at->bam_ad );
if ( attr != NULL ) {
BerVarray tmp;
if ( attr->a_vals != NULL ) {
for ( ; !BER_BVISNULL( &attr->a_vals[ oldcount ] ); oldcount++ )
/* just count */ ;
}
tmp = ch_realloc( attr->a_vals, ( oldcount + count + 1 ) * sizeof( struct berval ) );
if ( tmp == NULL ) {
return 1;
}
attr->a_vals = tmp;
memset( &attr->a_vals[ oldcount ], 0, ( count + 1 ) * sizeof( struct berval ) );
if ( normfunc ) {
tmp = ch_realloc( attr->a_nvals, ( oldcount + count + 1 ) * sizeof( struct berval ) );
if ( tmp == NULL ) {
return 1;
}
attr->a_nvals = tmp;
memset( &attr->a_nvals[ oldcount ], 0, ( count + 1 ) * sizeof( struct berval ) );
} else {
attr->a_nvals = attr->a_vals;
}
} else {
Attribute **ap;
/* Make space for the array of values */
attr = (Attribute *) ch_malloc( sizeof( Attribute ) );
attr->a_desc = at->bam_ad;
attr->a_flags = 0;
attr->a_next = NULL;
attr->a_vals = ch_calloc( count + 1, sizeof( struct berval ) );
if ( attr->a_vals == NULL ) {
Debug( LDAP_DEBUG_TRACE, "Out of memory!\n", 0,0,0 );
ch_free( attr );
return 1;
}
memset( attr->a_vals, 0, ( count + 1 ) * sizeof( struct berval ) );
if ( normfunc ) {
attr->a_nvals = ch_calloc( count + 1, sizeof( struct berval ) );
if ( attr->a_nvals == NULL ) {
ch_free( attr->a_vals );
ch_free( attr );
return 1;
} else {
memset( attr->a_nvals, 0, ( count + 1 ) * sizeof( struct berval ) );
}
} else {
attr->a_nvals = attr->a_vals;
}
for ( ap = &bsi->bsi_e->e_attrs; (*ap) != NULL; ap = &(*ap)->a_next )
/* goto last */ ;
*ap = attr;
}
#endif /* BACKSQL_COUNTQUERY */
rc = backsql_Prepare( bsi->bsi_dbh, &sth, at->bam_query, 0 );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_values(): "
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error preparing query: %s\n", at->bam_query, 0, 0 );
backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc );
return 1;
......@@ -483,18 +629,18 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
rc = backsql_BindParamID( sth, 1, SQL_PARAM_INPUT,
&bsi->bsi_c_eid->eid_keyval );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_values(): "
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"error binding key value parameter\n", 0, 0, 0 );
return 1;
}
#ifdef BACKSQL_TRACE
#ifdef BACKSQL_ARBITRARY_KEY
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_values(): "
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"query=\"%s\" keyval=%s\n", at->bam_query,
bsi->bsi_c_eid->eid_keyval.bv_val, 0 );
#else /* !BACKSQL_ARBITRARY_KEY */
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_values(): "
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
"query=\"%s\" keyval=%d\n", at->bam_query,
bsi->bsi_c_eid->eid_keyval, 0 );
#endif /* ! BACKSQL_ARBITRARY_KEY */
......@@ -502,7 +648,7 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
rc = SQLExecute( sth );
if ( ! BACKSQL_SUCCESS( rc ) ) {
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_values(): "
Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "