Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Ivan Koptelov <ivan.koptelov@tarantool.org>,
	Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v8.5] sql: add index_def to struct Index
Date: Tue, 3 Jul 2018 15:13:06 +0300	[thread overview]
Message-ID: <fdd79c68-984f-d2a0-50f5-73176a9566a6@tarantool.org> (raw)
In-Reply-To: <9a6283bc-a947-9070-8a92-22d84ff759ae@tarantool.org>

Hello. Thanks for the fixes!

On 03/07/2018 12:46, Ivan Koptelov wrote:
> Thank for the review. Previous mail contains patch with an error. Here it is fixed.
>> Hello. Thanks for the fixes! See my 6 comments below.
>>
>> And I have pushed more fixes on the branch. Please,
>> look and squash.
>>
>>> Now every sqlite struct Index is created with tnt struct
>>> index_def inside. This allows us to use tnt index_def
>>> in work with sqlite indexes in the same manner as with
>>> tnt index and is a step to remove sqlite Index with
>>> tnt index.
>>> Fields coll_array, coll_id_array, aiColumn, sort_order
>>> and zName are removed from Index. All usages of this
>>> fields changed to usage of corresponding index_def
>>> fields.
>>> index_is_unique(), sql_index_collation() and
>>> index_column_count() are removed with calls of
>>> index_def corresponding fields.
>>>
>>> Closes: #3369
>>>
>>> ---
>>> Branch:
>>> https://github.com/tarantool/tarantool/tree/sb/gh-3369-use-index-def-in-select-and-where
>>> Issue:https://github.com/tarantool/tarantool/issues/3369
>>>
>>>   src/box/sql.c                        |  54 ++-
>>>   src/box/sql/analyze.c                |  85 ++---
>>>   src/box/sql/build.c                  | 713 +++++++++++++++++------------------
>>>   src/box/sql/delete.c                 |  10 +-
>>>   src/box/sql/expr.c                   |  61 +--
>>>   src/box/sql/fkey.c                   | 132 +++----
>>>   src/box/sql/insert.c                 | 145 ++++---
>>>   src/box/sql/pragma.c                 |  30 +-
>>>   src/box/sql/select.c                 |   2 +-
>>>   src/box/sql/sqliteInt.h              | 111 ++----
>>>   src/box/sql/update.c                 |  39 +-
>>>   src/box/sql/vdbeaux.c                |   2 +-
>>>   src/box/sql/vdbemem.c                |  21 +-
>>>   src/box/sql/where.c                  | 180 ++++-----
>>>   src/box/sql/wherecode.c              | 102 ++---
>>>   test/sql-tap/colname.test.lua        |   4 +-
>>>   test/sql/message-func-indexes.result |   8 +-
>>>   17 files changed, 821 insertions(+), 878 deletions(-)
>>>
>>> -
>>> -/** Return true if given index is unique and not nullable. */
>>> -bool
>>> -index_is_unique_not_null(const Index *idx)
>>
>> 4. Same as on the previous review. Still is used in a pair of places.
> Are you sure? I searched through the whole project and didn't find it.
> There is only a variable with the same name in one place.

Sorry, my fault. It is just a variable.

> diff --git a/src/box/sql/where.c b/src/box/sql/where.c
> index 85143ed20..7ca02095f 100644
> --- a/src/box/sql/where.c
> +++ b/src/box/sql/where.c
> @@ -3058,6 +3064,8 @@ whereLoopAddBtree(WhereLoopBuilder * pBuilder,	/* WHERE clause information */
>   		if (pSrc->pIBIndex)
>   			break;
>   	}
> +	if (&sPk == pProbe && sPk.def != NULL)
> +		index_def_delete(sPk.def);

It will not be deleted since pProbe is changed in the cycle above.
I have checked it by putting assert(false) under this 'if'.
And I have already fixed it on the branch.

>   	return rc;
>   }
>   

I have pushed my last fixes on the branch. Please, look, squash and then
LGTM. Nikita, please, review after the squash.

  reply	other threads:[~2018-07-03 12:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13  7:30 [tarantool-patches] Re: [PATCH v3] " Ivan Koptelov
2018-06-18 18:45 ` Kirill Shcherbatov
2018-06-21 12:57   ` [tarantool-patches] Re: [PATCH v4] " Ivan Koptelov
2018-06-22  8:46     ` Kirill Shcherbatov
2018-06-27 17:46       ` [tarantool-patches] Re: [PATCH v5] " Ivan Koptelov
2018-06-27 17:57         ` Kirill Shcherbatov
2018-06-28 18:49           ` Vladislav Shpilevoy
2018-06-29 13:49             ` [tarantool-patches] Re: [PATCH v6] " Ivan Koptelov
2018-06-29 20:46               ` Vladislav Shpilevoy
     [not found]                 ` <146c3bd4-e9e6-f943-5a42-c6db966d1c9c@tarantool.org>
2018-07-03  9:00                   ` [tarantool-patches] Re: [PATCH v8] " Ivan Koptelov
2018-07-03  9:46                 ` [tarantool-patches] Re: [PATCH v8.5] " Ivan Koptelov
2018-07-03 12:13                   ` Vladislav Shpilevoy [this message]
2018-07-03 11:37                 ` [tarantool-patches] Re: [PATCH v9] " Ivan Koptelov
2018-07-03 23:54                   ` n.pettik
2018-07-04  0:08                     ` Vladislav Shpilevoy
2018-07-04  9:17                       ` n.pettik
2018-07-04 15:55                     ` [tarantool-patches] Re: [PATCH v11] " Ivan Koptelov
2018-07-04 19:28                       ` n.pettik
2018-07-05 14:50                         ` Ivan Koptelov
2018-07-06  0:51                           ` n.pettik
2018-07-08 14:17                             ` [tarantool-patches] Re: [PATCH v2] " Ivan Koptelov
2018-07-04 10:46                   ` [tarantool-patches] Re: [PATCH v9] " Kirill Yukhin
2018-07-04 12:10                     ` 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=fdd79c68-984f-d2a0-50f5-73176a9566a6@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=ivan.koptelov@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v8.5] sql: add index_def to struct Index' \
    /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