Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 4/4] sql: move SQL statistics to server
Date: Mon, 14 May 2018 15:54:09 +0300	[thread overview]
Message-ID: <1b473c97-3975-4679-c260-2ff7269d0a6a@tarantool.org> (raw)
In-Reply-To: <81C6752B-7CC6-4AED-9199-5471204C18CF@tarantool.org>

Hello. Thanks for fixes!

On 14/05/2018 14:52, n.pettik wrote:
> 

>> I wish it was my task, huge malloc formatting is very interesting.
> 
> I wish I could understand whether this is sarcasm or not...

Not sarcasm.

> 
>>> diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c
>>> index 57cac437c..4f21cd25f 100644
>>> --- a/src/box/sql/analyze.c
>>> +++ b/src/box/sql/analyze.c
>>> +decode_stat_string(const char *stat_string, int stat_size, tRowcnt *stat_exact,
>>> +		   LogEst *stat_log) {
>>> +	char *z = (char *) stat_string;
>>
>> 4. Why do you need this cast?
> 
> Since implicit cast discards const modifier and leads to compilation error.

No, I checked that. The code below is compiled ok. So you can remove the cast and
z variable.

diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c
index 4f21cd25f..061fcc7ab 100644
--- a/src/box/sql/analyze.c
+++ b/src/box/sql/analyze.c
@@ -1230,7 +1230,7 @@ struct analysis_index_info {
  static void
  decode_stat_string(const char *stat_string, int stat_size, tRowcnt *stat_exact,
                    LogEst *stat_log) {
-       char *z = (char *) stat_string;
+       const char *z = stat_string;
         if (z == NULL)
                 z = "";
         for (int i = 0; *z && i < stat_size; i++) {

  reply	other threads:[~2018-05-14 12:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 20:29 [tarantool-patches] [PATCH 0/4] Move original SQLite's " Nikita Pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 1/4] sql: optimize compilation of SELECT COUNT(*) Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 2/4] sql: add average tuple size calculation Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 3/4] sql: refactor usages of table's tuple count Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 4/4] sql: move SQL statistics to server Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-05-11 22:00       ` Vladislav Shpilevoy
2018-05-14 11:52         ` n.pettik
2018-05-14 12:54           ` Vladislav Shpilevoy [this message]
2018-05-14 13:55             ` n.pettik
2018-05-14 14:12 ` [tarantool-patches] Re: [PATCH 0/4] Move original SQLite's " Vladislav Shpilevoy
2018-05-15 13:42   ` 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=1b473c97-3975-4679-c260-2ff7269d0a6a@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 4/4] sql: move SQL statistics to server' \
    /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