<div dir="ltr">I'm sorry have just noticed few mistakes.<div>Changed it:</div><div><br></div><div><br></div><div><div>diff --git a/src/box/sql/build.c b/src/box/sql/build.c</div><div>index 92f3cb6..c6185e4 100644</div><div>--- a/src/box/sql/build.c</div><div>+++ b/src/box/sql/build.c</div><div>@@ -2129,18 +2129,36 @@ sqliteViewResetAll(sqlite3 * db)</div><div>  * Remove entries from the _sql_stat1 and _sql_stat4</div><div>  * system spaces after a DROP INDEX or DROP TABLE command.</div><div>  *</div><div>- * @param pParse Parsing context.</div><div>- * @param zType Type of entry to be deleted:</div><div>- * <span style="white-space:pre">                </span>'idx' or 'tbl' string literal.</div><div>- * @param zName Name of index or table.</div><div>+ * @param parse      The parsing context.</div><div>+ * @param table_name The table to be dropped or</div><div>+ *                   the table that contains index to be dropped.</div><div>+ * @param idx_name   Index to be dropped.</div><div>  */</div><div> static void</div><div>-sql_clear_stat_spaces(Parse * pParse, const char *zType, const char *zName)</div><div>+sql_clear_stat_spaces(Parse *parse, const char *table_name,</div><div>+<span style="white-space:pre">         </span>      const char *idx_name)</div><div> {</div><div>-<span style="white-space:pre">     </span>sqlite3NestedParse(pParse, "DELETE FROM \"_sql_stat1\" WHERE \"%s\"=%Q",</div><div>-<span style="white-space:pre">                       </span>   zType, zName);</div><div>-<span style="white-space:pre">  </span>sqlite3NestedParse(pParse, "DELETE FROM \"_sql_stat4\" WHERE \"%s\"=%Q",</div><div>-<span style="white-space:pre">                       </span>   zType, zName);</div><div>+<span style="white-space:pre">  </span>if (idx_name != NULL) {</div><div>+<span style="white-space:pre">              </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre">                            </span>   "DELETE FROM \"_sql_stat1\" "</div><div>+<span style="white-space:pre">                               </span>   "WHERE (\"idx\"=%Q AND "</div><div>+<span style="white-space:pre">                            </span>   "\"tbl\"=%Q)",</div><div>+<span style="white-space:pre">                              </span>   idx_name, table_name);</div><div>+<span style="white-space:pre">          </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre">                            </span>   "DELETE FROM \"_sql_stat4\" "</div><div>+<span style="white-space:pre">                               </span>   "WHERE (\"idx\"=%Q AND "</div><div>+<span style="white-space:pre">                            </span>   "\"tbl\"=%Q)",</div><div>+<span style="white-space:pre">                              </span>   idx_name, table_name);</div><div>+<span style="white-space:pre">  </span>} else {</div><div>+<span style="white-space:pre">             </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre">                            </span>   "DELETE FROM \"_sql_stat1\" "</div><div>+<span style="white-space:pre">                               </span>   "WHERE \"tbl\"=%Q",</div><div>+<span style="white-space:pre">                         </span>   table_name);</div><div>+<span style="white-space:pre">            </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre">                            </span>   "DELETE FROM \"_sql_stat4\" "</div><div>+<span style="white-space:pre">                               </span>   "WHERE \"tbl\"=%Q",</div><div>+<span style="white-space:pre">                         </span>   table_name);</div><div>+<span style="white-space:pre">    </span>}</div><div> }</div></div></div><br><div class="gmail_quote"><div dir="ltr">вс, 15 апр. 2018 г. в 9:09, Hollow111 <<a href="mailto:hollow653@gmail.com">hollow653@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello. Changes have been made. <div>Diff:</div><div><br></div><div><div>diff --git a/src/box/sql/build.c b/src/box/sql/build.c</div><div>index 92f3cb6..ce5878c 100644</div><div>--- a/src/box/sql/build.c</div><div>+++ b/src/box/sql/build.c</div><div>@@ -2129,18 +2129,32 @@ sqliteViewResetAll(sqlite3 * db)</div><div>  * Remove entries from the _sql_stat1 and _sql_stat4</div><div>  * system spaces after a DROP INDEX or DROP TABLE command.</div><div>  *</div><div>- * @param pParse Parsing context.</div><div>- * @param zType Type of entry to be deleted:</div><div>- * <span style="white-space:pre-wrap">           </span>'idx' or 'tbl' string literal.</div><div>- * @param zName Name of index or table.</div><div>+ * @param parse      The parsing context.</div><div>+ * @param table_name The table to be dropped or</div><div>+ *                   the table that contains index to be dropped.</div><div>+ * @param idx_name   Index to be dropped.</div><div>  */</div><div> static void</div><div>-sql_clear_stat_spaces(Parse * pParse, const char *zType, const char *zName)</div><div>+sql_clear_stat_spaces(Parse *parse, const char *table_name,</div><div>+<span style="white-space:pre-wrap">            </span>      const char *idx_name)</div><div> {</div><div>-<span style="white-space:pre-wrap">        </span>sqlite3NestedParse(pParse, "DELETE FROM \"_sql_stat1\" WHERE \"%s\"=%Q",</div><div>-<span style="white-space:pre-wrap">                  </span>   zType, zName);</div><div>-<span style="white-space:pre-wrap">     </span>sqlite3NestedParse(pParse, "DELETE FROM \"_sql_stat4\" WHERE \"%s\"=%Q",</div><div>-<span style="white-space:pre-wrap">                  </span>   zType, zName);</div><div>+<span style="white-space:pre-wrap">     </span>if (idx_name != NULL) {</div><div>+<span style="white-space:pre-wrap">         </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre-wrap">                               </span>   "DELETE FROM \"_sql_stat1\" WHERE (\"idx\"=%Q AND "</div><div>+<span style="white-space:pre-wrap">                          </span>   "\"tbl\"=%Q)",</div><div>+<span style="white-space:pre-wrap">                         </span>   idx_name, table_name);</div><div>+<span style="white-space:pre-wrap">             </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre-wrap">                               </span>   "DELETE FROM \"_sql_stat4\" WHERE (\"idx\"=%Q AND "</div><div>+<span style="white-space:pre-wrap">                          </span>   "\"tbl\"=%Q)",</div><div>+<span style="white-space:pre-wrap">                         </span>   idx_name, table_name);</div><div>+<span style="white-space:pre-wrap">     </span>} else {</div><div>+<span style="white-space:pre-wrap">                </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre-wrap">                               </span>   "DELETE FROM \"_sql_stat1\" WHERE \"tbl\"=%Q",</div><div>+<span style="white-space:pre-wrap">                               </span>   table_name);</div><div>+<span style="white-space:pre-wrap">               </span>sqlite3NestedParse(parse,</div><div>+<span style="white-space:pre-wrap">                               </span>   "DELETE FROM \"_sql_stat4\" WHERE \"tbl\"=%Q",</div><div>+<span style="white-space:pre-wrap">                               </span>   table_name);</div><div>+<span style="white-space:pre-wrap">       </span>}</div><div> }</div><div> </div><div> /**</div><div>@@ -2325,7 +2339,7 @@ sql_drop_table(struct Parse *parse_context, struct SrcList *table_name_list,</div><div> <span style="white-space:pre-wrap">      </span> *    tuple with corresponding space_id from _space.</div><div> <span style="white-space:pre-wrap"> </span> */</div><div> </div><div>-<span style="white-space:pre-wrap">    </span>sql_clear_stat_spaces(parse_context, "tbl", space_name);</div><div>+<span style="white-space:pre-wrap">      </span>sql_clear_stat_spaces(parse_context, space_name, NULL);</div><div> <span style="white-space:pre-wrap">        </span>struct Table *tab = sqlite3HashFind(&db->pSchema->tblHash, space_name);</div><div> <span style="white-space:pre-wrap">      </span>sqlite3FkDropTable(parse_context, table_name_list, tab);</div><div> <span style="white-space:pre-wrap">       </span>sql_code_drop_table(parse_context, space, is_view);</div><div>@@ -3328,7 +3342,7 @@ sql_drop_index(struct Parse *parse_context, struct SrcList *index_name_list,</div><div> <span style="white-space:pre-wrap">   </span> * But firstly, delete statistics since schema</div><div> <span style="white-space:pre-wrap"> </span> * changes after DDL.</div><div> <span style="white-space:pre-wrap">  </span> */</div><div>-<span style="white-space:pre-wrap">     </span>sql_clear_stat_spaces(parse_context, "idx", index->def->name);</div><div>+<span style="white-space:pre-wrap">  </span>sql_clear_stat_spaces(parse_context, table_name, index->def->name);</div><div> <span style="white-space:pre-wrap">      </span>int record_reg = ++parse_context->nMem;</div><div> <span style="white-space:pre-wrap">     </span>int space_id_reg = ++parse_context->nMem;</div><div> <span style="white-space:pre-wrap">   </span>sqlite3VdbeAddOp2(v, OP_Integer, space_id, space_id_reg);</div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">сб, 14 апр. 2018 г. в 11:13, n.pettik <<a href="mailto:korablev@tarantool.org" target="_blank">korablev@tarantool.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On 14 Apr 2018, at 07:29, Hollow111 <<a href="mailto:hollow653@gmail.com" target="_blank">hollow653@gmail.com</a>> wrote:</div><br class="m_-5580406336371012260m_-8035918818939284073Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hello. I'd like to ask about 'one kind of corrections”.</div></div></blockquote><br><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>Arguments which you carry to the next line, should start right below previous:<br><br>void f(x int, ….<br>         <span class="m_-5580406336371012260m_-8035918818939284073Apple-converted-space"> </span>y char, ….<br>         <span class="m_-5580406336371012260m_-8035918818939284073Apple-converted-space"> </span>z double …);<br></blockquote><div><br></div><div>I couldnt find this in <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline"><span> </span>"C style guide" (<a href="https://tarantool.io/en/doc/2.0/dev_guide/c_style_guide.html" target="_blank">https://tarantool.io/en/doc/2.0/dev_guide/c_style_guide.html</a>)</span></div><div>Moreover according to this guide:</div><div>"Outside of comments, documentation and except in Kconfig, spaces are never used for indentation...".</div><div>Which means we're supposed to violate this rule</div></div></div></div></div></blockquote><div><br></div><div>In fact, they are used. Probably, we should update and clarify this point in docs.</div><div>You use tabs as much as possible. To precisely align argument lists, you have</div><div>to use spaces:</div><div><br></div><div><div>return_value very_long_function_name_bla_bla_bla(int first_argument,</div><div><span class="m_-5580406336371012260m_-8035918818939284073Apple-tab-span" style="white-space:pre-wrap">                                          </span> int second_argument)</div><div><br></div><div>To make ’second_argument’ be under first, you should use 8 tabs + 1 space.</div><div>Overall, you can inspect other source files from box/ to understand how</div><div>source files should be formatted. Also, I advise you to make spaces and tabs visible.</div><div>For instance, see how it was done in box/space.c 106 : space_create()</div></div><br><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div class="gmail_quote"><div>in case first argument is positioned not on the same range </div><div>from left corner of screen as any amount of 8-character tabs. </div><div>Maybe I'm wrong at smth but I'd like to have an explanation.</div></div></div></div></div></blockquote></div><br></div></blockquote></div></blockquote></div>