c->value_int = index_substr_if_minlen;
break;
case CFG_IX_INTLEN:
- if ( index_intlen )
- c->value_int = index_intlen;
- else
- rc = 1;
+ c->value_int = index_intlen;
break;
case CFG_SORTVALS: {
ADlist *sv;
break;
case CFG_IX_INTLEN:
- index_intlen = 0;
- slap_schema.si_mr_integerMatch->smr_usage &= ~SLAP_MR_ORDERED_INDEX;
+ index_intlen = SLAP_INDEX_INTLEN_DEFAULT;
break;
case CFG_ACL:
break;
case CFG_IX_INTLEN:
- if ( !c->value_int ) {
- slap_schema.si_mr_integerMatch->smr_usage &= ~SLAP_MR_ORDERED_INDEX;
- } else {
- if ( c->value_int < 4 )
- c->value_int = 4;
- else if ( c->value_int > 255 )
- c->value_int = 255;
- slap_schema.si_mr_integerMatch->smr_usage |= SLAP_MR_ORDERED_INDEX;
- }
+ if ( c->value_int < SLAP_INDEX_INTLEN_DEFAULT )
+ c->value_int = SLAP_INDEX_INTLEN_DEFAULT;
+ else if ( c->value_int > 255 )
+ c->value_int = 255;
index_intlen = c->value_int;
break;
unsigned int index_substr_any_len = SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT;
unsigned int index_substr_any_step = SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT;
-/* Default to no ordered integer indexing */
-unsigned int index_intlen = 0;
+unsigned int index_intlen = SLAP_INDEX_INTLEN_DEFAULT;
ldap_pvt_thread_mutex_t ad_undef_mutex;
ldap_pvt_thread_mutex_t oc_undef_mutex;
BerVarray keys;
int i, rc;
- if ( !index_intlen ) {
- return octetStringIndexer( use, flags, syntax, mr,
- prefix, values, keysp, ctx );
- }
-
for( i=0; !BER_BVISNULL( &values[i] ); i++ ) {
/* just count them */
}
struct berval *value;
int rc;
- if ( !index_intlen ) {
- return octetStringFilter( use, flags, syntax, mr,
- prefix, assertedValue, keysp, ctx );
- }
-
value = (struct berval *) assertedValue;
keys = slap_sl_malloc( sizeof( struct berval ) * 2, ctx );
{"( 2.5.13.14 NAME 'integerMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )",
- SLAP_MR_EQUALITY | SLAP_MR_EXT, NULL,
+ SLAP_MR_EQUALITY | SLAP_MR_EXT | SLAP_MR_ORDERED_INDEX, NULL,
NULL, NULL, integerMatch,
integerIndexer, integerFilter,
NULL },
{"( 2.5.13.15 NAME 'integerOrderingMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )",
- SLAP_MR_ORDERING, NULL,
+ SLAP_MR_ORDERING | SLAP_MR_ORDERED_INDEX, NULL,
NULL, NULL, integerMatch,
NULL, NULL,
"integerMatch" },
#define SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT 4
#define SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT 2
+/* default for ordered integer index keys */
+#define SLAP_INDEX_INTLEN_DEFAULT 4
+
#define SLAP_INDEX_FLAGS 0xF000UL
#define SLAP_INDEX_NOSUBTYPES 0x1000UL /* don't use index w/ subtypes */
#define SLAP_INDEX_NOTAGS 0x2000UL /* don't use index w/ tags */