Change integer indexing to ordered only, no backward compatibility

This commit is contained in:
Howard Chu 2007-11-25 13:19:08 +00:00
parent e8d7074802
commit 8a8a05d811
3 changed files with 12 additions and 29 deletions

View file

@ -1019,10 +1019,7 @@ config_generic(ConfigArgs *c) {
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;
@ -1162,8 +1159,7 @@ config_generic(ConfigArgs *c) {
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:
@ -1510,15 +1506,10 @@ config_generic(ConfigArgs *c) {
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;

View file

@ -62,8 +62,7 @@ unsigned int index_substr_if_maxlen = SLAP_INDEX_SUBSTR_IF_MAXLEN_DEFAULT;
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;
@ -2130,11 +2129,6 @@ integerIndexer(
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 */
}
@ -2210,11 +2204,6 @@ integerFilter(
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 );
@ -4799,14 +4788,14 @@ static slap_mrule_defs_rec mrule_defs[] = {
{"( 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" },

View file

@ -252,6 +252,9 @@ typedef struct slap_ssf_set {
#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 */