From 7c8543ef7df3088bf0b65bcc67dc580fc75b9fe4 Mon Sep 17 00:00:00 2001 From: MichaelGrafnetter Date: Sat, 23 Jan 2016 19:02:41 +0100 Subject: [PATCH] Fixed a bug in temporary index loading. --- Changelog.txt | 3 +++ Src/DSInternals.DataStore/DirectorySchema.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index e8cba3c..5912ee9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.11 +- Fixed a bug in temporary index loading. + Version 2.10 - Added support for the NTLM-Strong-NTOWF package in Supplemental Credentials (new in Windows Server 2016 TP4) - Added support for initial databases diff --git a/Src/DSInternals.DataStore/DirectorySchema.cs b/Src/DSInternals.DataStore/DirectorySchema.cs index cbd7754..937d931 100644 --- a/Src/DSInternals.DataStore/DirectorySchema.cs +++ b/Src/DSInternals.DataStore/DirectorySchema.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Globalization; + using System.Linq; using DSInternals.Common.Data; using Microsoft.Database.Isam; using DSInternals.Common; @@ -17,6 +18,7 @@ private const string AttributeColIndexPrefix = "INDEX_"; private const string SystemColSuffix = "_col"; private const string SystemColIndexSuffix = "_index"; + private const char IndexNameComponentSeparator = '_'; private IDictionary attributesByInternalId; private IDictionary attributesByName; @@ -382,7 +384,8 @@ // Strip any suffix or prefix from index if(indexName.StartsWith(AttributeColIndexPrefix)) { - indexName = indexName.Substring(AttributeColIndexPrefix.Length, indexName.Length - AttributeColIndexPrefix.Length); + // The index name can start with INDEX_ or INDEX_T_ (e.g. INDEX_T_9EBE46C2), so we get the last component + indexName = indexName.Split(IndexNameComponentSeparator).Last(); } if(indexName.EndsWith(SystemColIndexSuffix)) {