Commit 9a4004fe authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 860c4019
...@@ -178,13 +178,23 @@ func (b *Backend) Load(ctx context.Context, xid zodb.Xid) (*proto.AnswerObject, ...@@ -178,13 +178,23 @@ func (b *Backend) Load(ctx context.Context, xid zodb.Xid) (*proto.AnswerObject,
if err != nil { if err != nil {
if err == sql.ErrNoRows { if err == sql.ErrNoRows {
// XXX see if object exists at all // nothing found - check whether object exists at all
err = &zodb.NoDataError{ var __ zodb.Oid
Oid: xid.Oid, err := b.query1(ctx,
DeletedAt: 0, // XXX hardcoded "SELECT oid FROM obj WHERE partition=? AND oid=? LIMIT 1",
} pid, xid.Oid) .Scan(&__)
switch {
case err == nil:
err = &zodb.NoDataError{
Oid: xid.Oid,
DeletedAt: 0, // XXX hardcoded
}
case err == sql.ErrNoRows:
err = &zodb.NoObjectError{Oid: xid.Oid}
err = &zodb.NoObjectError{Oid: xid.Oid} }
} }
return nil, err return nil, err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment