C# JET/Esent:SeekEQ找不到具有多列索引和通配符的匹配项
我有一个5列的表,有一个2列的主索引。假设索引定义为(C# JET/Esent:SeekEQ找不到具有多列索引和通配符的匹配项,c#,jet,esent,extensible-storage-engine,C#,Jet,Esent,Extensible Storage Engine,我有一个5列的表,有一个2列的主索引。假设索引定义为(Col1,Col2) 在下面的代码段中,Api.TrySeek返回false,我不确定原因: Api.JetSetCurrentIndex(session, table, null); // this should match on Col1 = colVal1 and Col2 = * Api.MakeKey(session, table, colVal1, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullC
Col1
,Col2
)
在下面的代码段中,Api.TrySeek返回false,我不确定原因:
Api.JetSetCurrentIndex(session, table, null);
// this should match on Col1 = colVal1 and Col2 = *
Api.MakeKey(session, table, colVal1, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnStartLimit);
if (Api.TrySeek(session, table, SeekGrbit.SeekEQ)) // why is this false??
{
Api.MakeKey(session, table, colVal1, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
if (Api.TrySetIndexRange(session, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
{
<loop through entries in index range>
Api.JetSetCurrentIndex(会话、表、空);
//这应该匹配Col1=colVal1和Col2=*
MakeKey(会话、表、colVal1、MakeKeyGrbit.NewKey | makeygrbit.FullColumnStartLimit);
if(Api.TrySeek(session,table,SeekGrbit.SeekEQ))//为什么为false??
{
MakeKey(会话、表、colVal1、MakeKeyGrbit.NewKey | makeygrbit.FullColumnEndLimit);
if(Api.TrySetIndexRange(会话、表、SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
{
但是,如果我使用SeekGrbit.SeekGE,它将返回true。有人能解释一下原因吗?SeekEQ
不适用于通配符列,但SeekGE
可以吗
在循环中,我仔细检查了所有条目是否都有Col1==colVal1
,以排除它只是在Col1>colVal1
中查找条目的可能性