#include "portable.h"
-#ifdef SLAPD_SQL
-
#include <stdio.h>
#include <sys/types.h>
#include "ac/string.h"
/*
* Skip:
- * - the first occurrence of objectClass, which is used
- * to determine how to build the SQL entry (FIXME ?!?)
+ * - null values (e.g. delete modification)
+ * - single occurrence of objectClass, because it is already used
+ * to determine how to build the SQL entry
* - operational attributes
- * - empty attributes (FIXME ?!?)
+ * - empty attributes
*/
-#define backsql_attr_skip(ad,vals) \
+#define backsql_attr_skip(ad, vals) \
( \
( (ad) == slap_schema.si_ad_objectClass \
- && BER_BVISNULL( &((vals)[ 1 ]) ) ) \
+ && (vals) && BER_BVISNULL( &((vals)[ 1 ]) ) ) \
|| is_at_operational( (ad)->ad_type ) \
|| ( (vals) && BER_BVISNULL( &((vals)[ 0 ]) ) ) \
)
BerVarray sm_values;
#if 0
- /* NOTE: some time we'll have to pass
+ /* NOTE: some day we'll have to pass
* the normalized values as well */
BerVarray nvalues;
#endif
backsql_at_map_rec *at = NULL;
struct berval *at_val;
int i;
- /* first parameter no, parameter order */
+ /* first parameter position, parameter order */
SQLUSMALLINT pno, po;
/* procedure return code */
int prc;
Debug( LDAP_DEBUG_TRACE, " backsql_modify_internal(): "
"adding new values for attribute \"%s\"\n",
at->bam_ad->ad_cname.bv_val, 0, 0 );
+
+ /* can't add a NULL val array */
+ assert( sm_values != NULL );
+
for ( i = 0, at_val = sm_values;
!BER_BVISNULL( at_val );
i++, at_val++ )
return ( ( rs->sr_err == LDAP_SUCCESS ) ? op->o_noop : 1 );
}
-#endif /* SLAPD_SQL */
-
#include "portable.h"
-#ifdef SLAPD_SQL
-
#include <stdio.h>
#include <sys/types.h>
#include "ac/string.h"
rc = 1;
goto done;
+ } else if ( ad == slap_schema.si_ad_entryCSN ) {
+ /*
+ * TODO: introduce appropriate entryCSN filtering
+ * to support syncrepl as producer...
+ */
+ if ( bsi->bsi_op->o_sync_mode != SLAP_SYNC_REFRESH ) {
+ /* unsupported at present... */
+ bsi->bsi_status = LDAP_OTHER;
+ rc = -1;
+ goto done;
+ }
+
+
} else if ( ad == slap_schema.si_ad_hasSubordinates || ad == NULL ) {
/*
* FIXME: this is not robust; e.g. a filter
return 0;
}
-#endif /* SLAPD_SQL */
-