To mdbx dupfixed (#1371)

This commit is contained in:
Alex Sharov 2020-11-23 11:18:21 +07:00 committed by GitHub
parent ccd1ad5832
commit 67de2a3a46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,6 +328,8 @@ func toMdbx(ctx context.Context, from, to string) error {
appendFunc := c.Append
if b.Flags&dbutils.DupSort != 0 && !b.AutoDupSortKeysConversion {
appendFunc = c.(ethdb.CursorDupSort).AppendDup
} else if b.Flags&dbutils.DupFixed != 0 && !b.AutoDupSortKeysConversion {
appendFunc = c.(ethdb.CursorDupFixed).AppendDup
}
srcC := srcTx.Cursor(name)
@ -358,9 +360,8 @@ func toMdbx(ctx context.Context, from, to string) error {
appendFunc = c.Append
if b.Flags&dbutils.DupSort != 0 && !b.AutoDupSortKeysConversion {
appendFunc = c.(ethdb.CursorDupSort).AppendDup
}
if b.Flags&dbutils.DupFixed != 0 && !b.AutoDupSortKeysConversion {
appendFunc = c.(ethdb.CursorDupSort).AppendDup
} else if b.Flags&dbutils.DupFixed != 0 && !b.AutoDupSortKeysConversion {
appendFunc = c.(ethdb.CursorDupFixed).AppendDup
}
}
}
@ -370,7 +371,7 @@ func toMdbx(ctx context.Context, from, to string) error {
if err != nil {
return err
}
_, err = dstTx.Sequence(name, currentID+1)
_, err = dstTx.Sequence(name, currentID)
if err != nil {
return err
}