Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v3 1/2] sql: add missing diag_set on failure when working inside os_unix.c
Date: Thu, 24 Dec 2020 16:59:37 +0000	[thread overview]
Message-ID: <20201224165937.GD14559@tarantool.org> (raw)
In-Reply-To: <9af9fff1-81d7-f7ce-ca7e-171f551dfc72@tarantool.org>

On 24 Dec 17:00, Vladislav Shpilevoy wrote:
> Hi! Thanks for the fixes!
> 
> See 1 comment below. After that the patchset will LGTM, and
> you can send it to Nikita on a second review.

Right away I can say that it would be super nice to see corresponding test
(using error injections I gueess). Otherwise we can't say for sure that
all this stubs are working...
 
> > diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c
> > index d64f1bd..07461f5 100644
> > --- a/src/box/sql/os_unix.c
> > +++ b/src/box/sql/os_unix.c
> > @@ -873,6 +908,12 @@ unixWrite(sql_file * id, const void *pBuf, int amt, sql_int64 offset)
> >              /* lastErrno set by seekAndWrite */
> >              return -1;
> >          } else {
> > +            /* Wrote to file less than planned. */
> > +            const char *err = tt_sprintf("wrote less (%i bytes) "
> > +                             "than planned (%i bytes) "
> > +                             "to file: %s",
> > +                             wrote, amt, pFile->zPath);
> > +            diag_set(ClientError, ER_SQL_EXECUTE, err);
> 
> Planned wasn't amt, because amt is modified in the loop above. Also
> 'wrote' will be -1 here, because this branch is taked on ENOSPC and
> write() returned -1.
> 
> Perpahs it is enough to say that didn't have enough space to write
> 'amt' bytes (this is how much was left to write).
> 
> >              storeLastErrno(pFile, 0);    /* not a system error */
> >              return -1;
> >          }

  reply	other threads:[~2020-12-24 16:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 23:09 [Tarantool-patches] [PATCH v3 0/2] Fix working with VDBE Leonid Vasiliev
2020-12-16 23:09 ` [Tarantool-patches] [PATCH v3 1/2] sql: add missing diag_set on failure when working inside os_unix.c Leonid Vasiliev
2020-12-20 16:02   ` Vladislav Shpilevoy
2020-12-23 23:27     ` Leonid Vasiliev
2020-12-24 16:00       ` Vladislav Shpilevoy
2020-12-24 16:59         ` Nikita Pettik [this message]
2020-12-16 23:09 ` [Tarantool-patches] [PATCH v3 2/2] sql: add panic() call in sql_execute() on complete failure Leonid Vasiliev
2020-12-20 16:02   ` Vladislav Shpilevoy
2020-12-23 22:38     ` Leonid Vasiliev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201224165937.GD14559@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v3 1/2] sql: add missing diag_set on failure when working inside os_unix.c' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox