Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: szudin@tarantool.org
Subject: [tarantool-patches] Re: [PATCH v4 2/2] sql: remove busy handler
Date: Wed, 13 Feb 2019 15:54:22 +0300	[thread overview]
Message-ID: <0BB0EDBA-D5B7-4F39-9B44-5F2EA45973CF@tarantool.org> (raw)
In-Reply-To: <f23cee8a-1c77-da10-43e2-92537ef7b402@tarantool.org>


> On 13 Feb 2019, at 10:10, Stanislav Zudin <szudin@tarantool.org> wrote:
> On 12.02.2019 20:05, n.pettik wrote:
>>> -	 *
>>> -	 * Call sqlite3_busy_timeout(db, N).  Return the current
>>> -	 * timeout value * if one is set.  If no busy handler
>>> -	 * or a different busy handler is set * then 0 is
>>> -	 * returned.  Setting the busy_timeout to 0 or negative *
>>> -	 * disables the timeout.
>>> -	 */
>>> -	/* case PragTyp_BUSY_TIMEOUT */
>>> 	default:{
>>> -			assert(pPragma->ePragTyp == PragTyp_BUSY_TIMEOUT);
>>> -			if (zRight) {
>>> -				sqlite3_busy_timeout(db, sqlite3Atoi(zRight));
>>> -			}
>>> -			returnSingleInt(v, db->busyTimeout);
>>> -			break;
>>> +		/* We shouldn't get here. */
>>> +		diag_set(ClientError, ER_UNKNOWN);
>>> +		pParse->rc = SQL_TARANTOOL_ERROR;
>>> +		pParse->nErr++;
>>> +		goto pragma_out;
>> If we really can’t reach here under no circumstances
>> (which seems to be true - pragmaLocate checks this) then
>> it’s better to place unreachable(); assert. Fix this please.
> Please find the fix below.

Ok, squash it, fix remove closes #… directive from first commit
message and then patch-set LGTM.

> 
>  src/box/sql/pragma.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
> index 62ff1f2b2..1b456e0b5 100644
> --- a/src/box/sql/pragma.c
> +++ b/src/box/sql/pragma.c
> @@ -643,13 +643,8 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */
>          break;
>      }
> 
> -    default:{
> -        /* We shouldn't get here. */
> -        diag_set(ClientError, ER_UNKNOWN);
> -        pParse->rc = SQL_TARANTOOL_ERROR;
> -        pParse->nErr++;
> -        goto pragma_out;
> -        }
> +    default:
> +        unreachable();
>      }
> 
>      /* The following block is a no-op unless SQLITE_DEBUG is
> -- 
> 2.17.1
> 

  reply	other threads:[~2019-02-13 12:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12  7:31 [tarantool-patches] [PATCH v4 1/2] sql: remove useless pragmas Stanislav Zudin
2019-02-12  7:31 ` [tarantool-patches] [PATCH v4 2/2] sql: remove busy handler Stanislav Zudin
2019-02-12 17:05   ` [tarantool-patches] " n.pettik
2019-02-13  7:10     ` Stanislav Zudin
2019-02-13 12:54       ` n.pettik [this message]
2019-02-12 17:05 ` [tarantool-patches] Re: [PATCH v4 1/2] sql: remove useless pragmas n.pettik
2019-02-18 10:28 ` Kirill Yukhin

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=0BB0EDBA-D5B7-4F39-9B44-5F2EA45973CF@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=szudin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v4 2/2] sql: remove busy handler' \
    /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