[tarantool-patches] Re: [PATCH v1 1/1] sql: rework SQL errors of type "expected column count"

n.pettik korablev at tarantool.org
Thu Jun 6 22:22:49 MSK 2019


>>> /*
>>> * !IMPORTANT! Please follow instructions at start of the file
>>> diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
>>> index ba7eea5..8cf4d2e 100644
>>> --- a/src/box/sql/expr.c
>>> +++ b/src/box/sql/expr.c
>>> @@ -2958,28 +2958,22 @@ sqlCodeSubselect(Parse * pParse,	/* Parsing context */
>>> * Expr pIn is an IN(...) expression. This function checks that the
>>> * sub-select on the RHS of the IN() operator has the same number of
>>> * columns as the vector on the LHS. Or, if the RHS of the IN() is not
>>> - * a sub-query, that the LHS is a vector of size 1.
>>> + * a sub-query, that the LHS must be a vector of size 1.
>> 
>> What is the point of changing this comment?
>> 
> In SQlite it wasn't possible to write something like
> "SELECT (1,2) in ..." so if length of the vector were more
> than 1 it means it was received using subselect. It isn't
> so in our case since we can work with such statements.
> To emphasize this, I changed the comment.

‘… is a vector…’ -> ‘… must be a vector…'

In context of comment they mean the same ->
meaningless change. 

> New patch:
> 
> From 32b665f9ad9dacc16a492c55396dd843f9a355e9 Mon Sep 17 00:00:00 2001
> Date: Sat, 18 May 2019 13:15:58 +0300
> Subject: [PATCH] sql: rework SQL errors of type "expected column count"
> 
> Before this patch, errors of type "expected column count" were
> divided into several different errors, and they all had an
> ER_SQL_PARSER_GENERIC error code. This patch creates a new error
> code for these errors.
> 
> In addition, at some point it became possible to use vectors as
> the left value in the IN operator. Since this was previously
> impossible, it led to a segmentation error.

This doesn’t seem to be decent description, at least to me.
Please, provide description of problem in details: since it
was assertion fault I guess it deserves to be explained.

Let me help you:

In SQL it is allowed to use vector expressions, i.e.
* brief description of vector expressions *.
For instance, * example of using vector expressions *
Accidentally, routines handling IN operator and vector
expressions contained bug. * Bug description *
Let’s fix it in the following way. * Fix description *


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190606/acc26d8c/attachment.html>


More information about the Tarantool-patches mailing list