1
Vote

Index Types have wrong values

description

Enum used is the same for pages and indexes. Int values are wrong for indexes.
 

 
[Flags]
public enum IndexTypes
{
    Heap = 1,
    Clustered = 2,
    NonClustered = 4,
    Leaf = 8,
    Node = 16,
    TableClustered = 32,
    NonClusteredLeaf = NonClustered | Leaf
}
I changed in source code the mapping in AllocationUnitLayer.cs
 

 
int index_type = Convert.ToInt32(row["index_type"]);
                    if (index_type == 0)
                        layer.IndexType = IndexTypes.Heap;
                    else if (index_type == 1)
                        layer.IndexType = IndexTypes.Clustered;
                    else if (index_type == 2)
                        layer.IndexType = IndexTypes.NonClustered;
                    else
                        //the previous code I've found here
                        layer.IndexType = (IndexTypes)index_type;

file attachments

comments