mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-27 10:00:57 +00:00
ESENT: fix the index creation failure #277
This commit is contained in:
parent
dfef7a622f
commit
0cb0f9303d
|
|
@ -15,7 +15,6 @@ namespace WelsonJS.Launcher
|
|||
private string entryFileName;
|
||||
private string scriptName;
|
||||
private const string timestampFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
private static MetadataStore metadataStore;
|
||||
|
||||
public InstancesForm()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -105,20 +105,22 @@ namespace WelsonJS.Launcher
|
|||
Api.JetAddColumn(_session, tableid, col.Name, coldef, null, 0, out _);
|
||||
}
|
||||
|
||||
string indexName = "primary";
|
||||
string indexKey = $"+{_primaryKey}\0\0"; // Primary key ASC
|
||||
string indexKey = $"+{_primaryKey.Name}\0";
|
||||
int keyLength = Encoding.ASCII.GetByteCount(indexKey + "\0"); // double null-terminated
|
||||
string fullKeyDescription = indexKey + "\0";
|
||||
|
||||
Api.JetCreateIndex(
|
||||
_session,
|
||||
tableid,
|
||||
indexName,
|
||||
"primary",
|
||||
CreateIndexGrbit.IndexPrimary | CreateIndexGrbit.IndexUnique,
|
||||
indexKey,
|
||||
indexKey.Length,
|
||||
100);
|
||||
fullKeyDescription,
|
||||
keyLength,
|
||||
100
|
||||
);
|
||||
|
||||
Api.JetCloseTable(_session, tableid);
|
||||
Api.JetCommitTransaction(_session, CommitTransactionGrbit.None);
|
||||
Api.JetCloseTable(_session, tableid);
|
||||
}
|
||||
|
||||
private void CacheColumns()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user