]> git.sur5r.net Git - openldap/commitdiff
minor cleanup
authorPierangelo Masarati <ando@openldap.org>
Mon, 15 Nov 2004 22:10:10 +0000 (22:10 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 15 Nov 2004 22:10:10 +0000 (22:10 +0000)
14 files changed:
servers/slapd/back-sql/add.c
servers/slapd/back-sql/api.c
servers/slapd/back-sql/bind.c
servers/slapd/back-sql/compare.c
servers/slapd/back-sql/config.c
servers/slapd/back-sql/delete.c
servers/slapd/back-sql/entry-id.c
servers/slapd/back-sql/modify.c
servers/slapd/back-sql/modrdn.c
servers/slapd/back-sql/operational.c
servers/slapd/back-sql/schema-map.c
servers/slapd/back-sql/search.c
servers/slapd/back-sql/sql-wrap.c
servers/slapd/back-sql/util.c

index 19fd90ef7209772a5648f74d471f10c73c5b7fbe..fa3fc29c983b742a3f93e8ed77644a7ff3ffce4d 100644 (file)
@@ -20,8 +20,6 @@
 
 #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 ]) ) ) \
        )
@@ -273,14 +272,14 @@ backsql_modify_internal(
 
                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;
@@ -404,6 +403,10 @@ add_only:;
                        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++ )
@@ -1418,5 +1421,3 @@ done:;
        return ( ( rs->sr_err == LDAP_SUCCESS ) ? op->o_noop : 1 );
 }
 
-#endif /* SLAPD_SQL */
-
index 3119ceb9507e302009b19b766baf440e44a47009..5eb71b8d67cf8e14eba6929cd9758cae0c12c8d9 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -140,5 +138,3 @@ backsql_api_odbc2dn( Operation *op, SlapReply *rs, struct berval *dn )
        return 0;
 }
 
-#endif /* SLAPD_SQL */
-
index 7b9f8dcd3fa5fbafc858fe17cb70b8c48d6c41bf..4e5bccb73bb40ccae5514553dfd2ba8d3ca8acef 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -151,5 +149,3 @@ error_return:;
        return 0;
 }
  
-#endif /* SLAPD_SQL */
-
index 1f64cc749c06453eb99195932a1d34ffdddbd7b5..5178e67928d91788e1fc796d609803d7d4a2b39d 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -168,5 +166,3 @@ return_results:;
        }
 }
  
-#endif /* SLAPD_SQL */
-
index afc0dcf09a40cfec777dfe4805f38eb2ae080055..0068e8269c91422e516214422c78d5b8890faa70 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include "ac/string.h"
 #include <sys/types.h>
@@ -652,5 +650,3 @@ create_baseObject(
        return 0;
 }
 
-#endif /* SLAPD_SQL */
-
index f9e14f0cad120b5af7e963e8ef1138051d8fa546..fbe4f1a869bf8011dccd5a2c4faa685133a8f3e4 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -396,5 +394,3 @@ done:;
        return ( ( rs->sr_err == LDAP_SUCCESS ) ? op->o_noop : 1 );
 }
 
-#endif /* SLAPD_SQL */
-
index 1153bd0ec7ee7bd352f22b8a0644d59a57f968f1..fafde1782d89d700cd1c9fb5a731479c2e882067 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -605,5 +603,3 @@ done:;
        return LDAP_SUCCESS;
 }
 
-#endif /* SLAPD_SQL */
-
index 168d4cc8bbc5487c99e069d43d1bade913eb3eb4..c73ba2431c38596e2d29082d55aea45787245568 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -125,5 +123,3 @@ backsql_modify( Operation *op, SlapReply *rs )
        return op->o_noop;
 }
 
-#endif /* SLAPD_SQL */
-
index f57d6e67e45602b80a3bb8696a3cd862aaf1d08a..6e01e5aa2ea75d0f631b77c138c03515644415e9 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -463,5 +461,3 @@ modrdn_return:;
        return op->o_noop;
 }
 
-#endif /* SLAPD_SQL */
-
index fec92869cf588aee59cf87c49a3e158267c65c30..9df0eb0c86a86917ecbb3113cb9c7fcf33466e7d 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -227,5 +225,3 @@ backsql_operational(
        return rc;
 }
 
-#endif /* SLAPD_SQL */
-
index a0325b37f7a8fafdb89bd7b2a639bcbfcc2e5ce7..7c115bd224826eb9a7872c324e38f5ae0ba339ff 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -928,5 +926,3 @@ backsql_destroy_schema_map( backsql_info *bi )
        return 0;
 }
 
-#endif /* SLAPD_SQL */
-
index c6e2ee521296557c18b96398de59cbbfead81246..10af5af114131244ad71a99e6be19a1a08b19e3b 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -673,6 +671,19 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                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
@@ -1970,5 +1981,3 @@ done:;
        return 0;
 }
 
-#endif /* SLAPD_SQL */
-
index a7a30384e65a7937e605eece9949987b5a46339c..d5da0886a9977acd3b2809ba80bbb0e9988bceab 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include "ac/string.h"
 #include <sys/types.h>
@@ -469,5 +467,3 @@ backsql_get_db_conn( Operation *op, SQLHDBC *dbh )
        return LDAP_SUCCESS;
 }
 
-#endif /* SLAPD_SQL */
-
index 0bf710427bb2371d08bcbeaeb7cde93360c8687c..cc4f6ded4ce64a47cfd13303c4107921fc052f07 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "portable.h"
 
-#ifdef SLAPD_SQL
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "ac/string.h"
@@ -577,6 +575,3 @@ backsql_entryUUID_decode(
        return LDAP_SUCCESS;
 }
 
-
-#endif /* SLAPD_SQL */
-