This commit is contained in:
Nuno Cruces
2023-03-07 14:19:22 +00:00
parent dfcdbf9c4c
commit f5747f19fb
9 changed files with 173 additions and 132 deletions

View File

@@ -66,19 +66,20 @@ func (c *Conn) backupInit(dst uint32, dstName string, src uint32, srcName string
dstPtr := c.arena.string(dstName)
srcPtr := c.arena.string(srcName)
other := dst
if c.handle == dst {
other = src
}
r := c.call(c.api.backupInit,
uint64(dst), uint64(dstPtr),
uint64(src), uint64(srcPtr))
if r[0] == 0 {
defer c.closeDB(other)
r = c.call(c.api.errcode, uint64(dst))
return nil, c.module.error(r[0], dst)
}
other := dst
if c.handle == dst {
other = src
}
return &Backup{
c: c,
otherc: other,