From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B25CA24377 for ; Mon, 14 May 2018 08:54:13 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eYBRxzLrmANk for ; Mon, 14 May 2018 08:54:13 -0400 (EDT) Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E4C9824368 for ; Mon, 14 May 2018 08:54:12 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 4/4] sql: move SQL statistics to server References: <291aa5961a366c81ffa7ea465636125617a78dad.1524515002.git.korablev@tarantool.org> <1dd6cfc3-25f1-8184-df64-2e1638ad55a0@tarantool.org> <8E69DCFF-0088-4FCD-A4CA-E3C98DEF7274@tarantool.org> <1f4a08f6-366d-8d0c-ec5c-9e8e33a766ee@tarantool.org> <81C6752B-7CC6-4AED-9199-5471204C18CF@tarantool.org> From: Vladislav Shpilevoy Message-ID: <1b473c97-3975-4679-c260-2ff7269d0a6a@tarantool.org> Date: Mon, 14 May 2018 15:54:09 +0300 MIME-Version: 1.0 In-Reply-To: <81C6752B-7CC6-4AED-9199-5471204C18CF@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: "n.pettik" , tarantool-patches@freelists.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++) {