<HTML><BODY><p>Hello! Thank you for review! New patch at the end of the letter.</p><br><div class="moz-cite-prefix">On 10/01/2018 02:40 AM, n.pettik wrote:</div><blockquote cite="mid:70A5C3C7-8069-4FF0-A653-46B3B82C9716@tarantool.org">Sorry for quite late respond, I sincerely regret it.<div> </div><div>Patch LGTM (except for several minor nits).</div><div><br><div><div><blockquote><div><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">diff --git a/src/box/sql.c b/src/box/sql.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">index b158c50..87f2088 100644</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">--- a/src/box/sql.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+++ b/src/box/sql.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -1217,21 +1217,21 @@ void tarantoolSqlite3LoadSchema(struct init_data *init)</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> sql_init_callback(init, TARANTOOL_SYS_SQL_STAT1_NAME,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> BOX_SQL_STAT1_ID, 0,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "CREATE TABLE \""TARANTOOL_SYS_SQL_STAT1_NAME</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "\"(\"tbl\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "\"idx\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "\"(\"space_id\" INT,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "\"index_id\" INT,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "\"stat\" not null,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "PRIMARY KEY(\"tbl\", \"idx\"))");</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "PRIMARY KEY(\"space_id\", \"index_id\"))");</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> sql_init_callback(init, TARANTOOL_SYS_SQL_STAT4_NAME,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> BOX_SQL_STAT4_ID, 0,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "CREATE TABLE \""TARANTOOL_SYS_SQL_STAT4_NAME</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "\"(\"tbl\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "\"idx\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "\"(\"space_id\" INT,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "\"index_id\" INT,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "\"neq\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "\"nlt\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "\"ndlt\" text,"</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> "\"sample\","</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- "PRIMARY KEY(\"tbl\", \"idx\", \"sample\"))");</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ "PRIMARY KEY(\"space_id\", \"index_id\", \"sample\"))”);</span></div></blockquote><div> </div><div>Note: after you rebase on fresh 2.0, these fixes will disappear, since</div><div>we don’t add system spaces to separate hash anymore.</div></div></div></div></blockquote>Rebased, fixed.<br><blockquote cite="mid:70A5C3C7-8069-4FF0-A653-46B3B82C9716@tarantool.org"><div><div><div><br><blockquote><div><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">index 76ae153..6938dcb 100644</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">--- a/src/box/sql/analyze.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+++ b/src/box/sql/analyze.c</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -38,8 +38,8 @@</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> *</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> * The following system tables are or have been supported:</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> *</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- * CREATE TABLE _sql_stat1(tbl, idx, stat);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- * CREATE TABLE _sql_stat4(tbl, idx, nEq, nLt, nDLt, sample);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ * CREATE TABLE _sql_stat1(space_id, index_id, stat);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ * CREATE TABLE _sql_stat4(space_id, index_id, nEq, nLt, nDLt, sample);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> *</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> * For most applications, _sql_stat1 provides all the statistics required</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> * for the query planner to make good choices.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -47,7 +47,7 @@</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> * Format of _sql_stat1:</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> *</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> * There is normally one row per index, with the index identified by the</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- * name in the idx column. The tbl column is the name of the table to</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ * name in the index_id column. The space_id column is the name of the table to</span></div></blockquote><div> </div><div>Nit: * id in the index_id column. The space_id column is the id of the space to</div></div></div></div></blockquote>Fixed.<br><blockquote cite="mid:70A5C3C7-8069-4FF0-A653-46B3B82C9716@tarantool.org"><div><div><div><div> </div><blockquote><div><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -1410,27 +1405,14 @@ load_stat_from_space(struct sqlite3 *db, const char *sql_select_prepare,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> goto finalize;</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> uint32_t current_idx_count = 0;</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> while (sqlite3_step(stmt) == SQLITE_ROW) {</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- const char *space_name = (char *)sqlite3_column_text(stmt, 0);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- if (space_name == NULL)</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- continue;</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- const char *index_name = (char *)sqlite3_column_text(stmt, 1);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- if (index_name == NULL)</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- continue;</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- uint32_t sample_count = sqlite3_column_int(stmt, 2);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- uint32_t space_id = box_space_id_by_name(space_name,</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- strlen(space_name));</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">- assert(space_id != BOX_ID_NIL);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ uint32_t space_id = sqlite3_column_int(stmt, 0);</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+ assert(space_id != BOX_ID_NIL && space_id != 0);</span></div></blockquote><div> </div><div>Above you have mentioned that space_id now can’t be equal to BOX_ID_NIL:</div><div> </div><div><blockquote><blockquote><blockquote>@@ -1246,24 +1246,14 @@ analysis_loader(void *data, int argc, char **argv, char **unused)<br>struct analysis_index_info *info = (struct analysis_index_info *) data;<br>assert(info->stats != NULL);<br>struct index_stat *stat = &info->stats[info->index_count++];<br>-uint32_t space_id = box_space_id_by_name(argv[0], strlen(argv[0]));<br>+uint32_t space_id = atoll(argv[0]);</blockquote>I would add assertion like:<br>assert(space_id != 0);<br>Since atoll in case of fail returns 0 and BOX_ID_NIL != 0.</blockquote><span style="float: none; display: inline !important;" data-mce-style="float: none; display: inline !important;">Actually now we cannot get BOX_ID_NIL, but we can get 0. Changed "if"</span><br><span style="float: none; display: inline !important;" data-mce-style="float: none; display: inline !important;">that placed next line after "atoll”.</span></blockquote></div><div>So, why do you check within assertion that condition? I mean there is no crime,</div><div>but does it make sense? The same for other similar checks.</div></div></div></div></blockquote>Fixed.<br><blockquote cite="mid:70A5C3C7-8069-4FF0-A653-46B3B82C9716@tarantool.org"><div><div><div><br><blockquote><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">--- a/test/sql/sql-statN-index-drop.test.lua</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+++ b/test/sql/sql-statN-index-drop.test.lua</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -14,15 +14,15 @@ box.sql.execute("INSERT INTO t2 VALUES(1, 2);")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> box.sql.execute("ANALYZE;")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Checking the data.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat4\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat1\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4" join "_space" on "_sql_stat4"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","stat" FROM "_sql_stat1" join "_space" on "_sql_stat1"."space_id" = "_space"."id";’)</span></blockquote><div> </div><div>Nit: I don’t think that in this test (and the rest below) we need to fetch</div><div>name of space instead of its id. Lets leave this test as it was before.</div></div></div></div></blockquote>Removed space id/name from result of executed queries.<br><blockquote cite="mid:70A5C3C7-8069-4FF0-A653-46B3B82C9716@tarantool.org"><div><div><div><br><blockquote><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Dropping an index.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> box.sql.execute("DROP INDEX i1 ON t1;")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Checking the DROP INDEX results.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat4\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat1\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4" join "_space" on "_sql_stat4"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","stat" FROM "_sql_stat1" join "_space" on "_sql_stat1"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> --Cleaning up.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> box.sql.execute("DROP TABLE t1;")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">@@ -41,15 +41,15 @@ box.sql.execute("INSERT INTO t2 VALUES(1, 2);")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> box.sql.execute("ANALYZE;")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Checking the data.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat4\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat1\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4" join "_space" on "_sql_stat4"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","stat" FROM "_sql_stat1" join "_space" on "_sql_stat1"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Dropping an index.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> box.sql.execute("DROP INDEX i1 ON t2;")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"> -- Checking the DROP INDEX results.</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat4\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">-box.sql.execute("SELECT * FROM \"_sql_stat1\";")</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4" join "_space" on "_sql_stat4"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" data-mce-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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+box.sql.execute('SELECT "name","index_id","stat" FROM "_sql_stat1" join "_space" on "_sql_stat1"."space_id" = "_space"."id";')</span><br 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; -webkit-text-stroke-width: 0px;" data-mce-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; -webkit-text-stroke-width: 0px;"><br></blockquote></div></div></div></blockquote><br> New patch:<br> commit dd448807244e22a07c642bceda923d35865e406f<br> Author: Mergen Imeev <imeevma@gmail.com><br> Date: Fri Aug 31 12:37:48 2018 +0300<br> <br> sql: hold in stat tables space/index id instead of name<br> <br> To avoid problems with table and index renaming it is good idea<br> to save ids of tables and indexes instead of their names. Ids of<br> tables and indexes are fixed values.<br> <br> Closes #3242<br> Closes #2962<br> <br> diff --git a/src/box/bootstrap.snap b/src/box/bootstrap.snap<br> index 6573938..a30f72e 100644<br> Binary files a/src/box/bootstrap.snap and b/src/box/bootstrap.snap differ<br> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua<br> index d9c2ae4..bc18b49 100644<br> --- a/src/box/lua/upgrade.lua<br> +++ b/src/box/lua/upgrade.lua<br> @@ -520,11 +520,11 @@ local function upgrade_to_2_1_0()<br> _index:insert{_trigger.id, 1, 'space_id', 'tree', { unique = false },<br> {{1, 'unsigned'}}}<br> <br> - local stat1_ft = {{name='tbl', type='string'},<br> - {name='idx', type='string'},<br> + local stat1_ft = {{name='space_id', type='unsigned'},<br> + {name='index_id', type='unsigned'},<br> {name='stat', type='string'}}<br> - local stat4_ft = {{name='tbl', type='string'},<br> - {name='idx', type='string'},<br> + local stat4_ft = {{name='space_id', type='unsigned'},<br> + {name='index_id', type='unsigned'},<br> {name='neq', type='string'},<br> {name='nlt', type='string'},<br> {name='ndlt', type='string'},<br> @@ -536,7 +536,7 @@ local function upgrade_to_2_1_0()<br> <br> log.info("create index primary on _sql_stat1")<br> _index:insert{box.schema.SQL_STAT1_ID, 0, 'primary', 'tree',<br> - {unique = true}, {{0, 'string'}, {1, 'string'}}}<br> + {unique = true}, {{0, 'unsigned'}, {1, 'unsigned'}}}<br> <br> log.info("create space _sql_stat4")<br> _space:insert{box.schema.SQL_STAT4_ID, ADMIN, '_sql_stat4', 'memtx', 0,<br> @@ -544,7 +544,7 @@ local function upgrade_to_2_1_0()<br> <br> log.info("create index primary on _sql_stat4")<br> _index:insert{box.schema.SQL_STAT4_ID, 0, 'primary', 'tree',<br> - {unique = true}, {{0, 'string'}, {1, 'string'},<br> + {unique = true}, {{0, 'unsigned'}, {1, 'unsigned'},<br> {5, 'scalar'}}}<br> <br> local fk_constr_ft = {{name='name', type='string'},<br> diff --git a/src/box/schema.cc b/src/box/schema.cc<br> index 2d2be26..e2c59fb 100644<br> --- a/src/box/schema.cc<br> +++ b/src/box/schema.cc<br> @@ -380,17 +380,17 @@ schema_init()<br> &alter_space_on_replace_index, &on_stmt_begin_index);<br> <br> /* _sql_stat1 - a simpler statistics on space, seen in SQL. */<br> - key_parts[0].fieldno = 0; /* space name */<br> - key_parts[0].type = FIELD_TYPE_STRING;<br> - key_parts[1].fieldno = 1; /* index name */<br> - key_parts[1].type = FIELD_TYPE_STRING;<br> + key_parts[0].fieldno = 0; /* space id */<br> + key_parts[0].type = FIELD_TYPE_UNSIGNED;<br> + key_parts[1].fieldno = 1; /* index id */<br> + key_parts[1].type = FIELD_TYPE_UNSIGNED;<br> sc_space_new(BOX_SQL_STAT1_ID, "_sql_stat1", key_parts, 2, NULL, NULL);<br> <br> /* _sql_stat4 - extensive statistics on space, seen in SQL. */<br> - key_parts[0].fieldno = 0; /* space name */<br> - key_parts[0].type = FIELD_TYPE_STRING;<br> - key_parts[1].fieldno = 1; /* index name */<br> - key_parts[1].type = FIELD_TYPE_STRING;<br> + key_parts[0].fieldno = 0; /* space id */<br> + key_parts[0].type = FIELD_TYPE_UNSIGNED;<br> + key_parts[1].fieldno = 1; /* index id */<br> + key_parts[1].type = FIELD_TYPE_UNSIGNED;<br> key_parts[2].fieldno = 5; /* sample */<br> key_parts[2].type = FIELD_TYPE_SCALAR;<br> sc_space_new(BOX_SQL_STAT4_ID, "_sql_stat4", key_parts, 3, NULL, NULL);<br> diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c<br> index 01e2ad1..7fc7f89 100644<br> --- a/src/box/sql/analyze.c<br> +++ b/src/box/sql/analyze.c<br> @@ -38,8 +38,8 @@<br> *<br> * The following system tables are or have been supported:<br> *<br> - * CREATE TABLE _sql_stat1(tbl, idx, stat);<br> - * CREATE TABLE _sql_stat4(tbl, idx, nEq, nLt, nDLt, sample);<br> + * CREATE TABLE _sql_stat1(space_id, index_id, stat);<br> + * CREATE TABLE _sql_stat4(space_id, index_id, nEq, nLt, nDLt, sample);<br> *<br> * For most applications, _sql_stat1 provides all the statistics required<br> * for the query planner to make good choices.<br> @@ -47,7 +47,7 @@<br> * Format of _sql_stat1:<br> *<br> * There is normally one row per index, with the index identified by the<br> - * name in the idx column. The tbl column is the name of the table to<br> + * id in the index_id column. The space_id column is the id of the space to<br> * which the index belongs. In each such row, the stat column will be<br> * a string consisting of a list of integers. The first integer in this<br> * list is the number of rows in the index. (This is the same as the<br> @@ -66,9 +66,9 @@<br> * "unordered" keyword is present, then the query planner assumes that<br> * the index is unordered and will not use the index for a range query.<br> *<br> - * If the _sql_stat1.idx column is NULL, then the _sql_stat1.stat<br> + * If the _sql_stat1.index_id column is NULL, then the _sql_stat1.stat<br> * column contains a single integer which is the (estimated) number of<br> - * rows in the table identified by _sql_stat1.tbl.<br> + * rows in the table identified by _sql_stat1.space_id.<br> *<br> * Format for _sql_stat4:<br> *<br> @@ -78,9 +78,9 @@<br> * queries.<br> *<br> * The _sql_stat4 table contains multiple entries for each index.<br> - * The idx column names the index and the tbl column is the table of the<br> - * index. If the idx and tbl columns are the same, then the sample is<br> - * of the INTEGER PRIMARY KEY. The sample column is a blob which is the<br> + * The index_id column names the index and the space_id column is the space of<br> + * the index. If the index_id is equal to 0, then the sample<br> + * is of the INTEGER PRIMARY KEY. The sample column is a blob which is the<br> * binary encoding of a key from the index. The nEq column is a<br> * list of integers. The first integer is the approximate number<br> * of entries in the index whose left-most column exactly matches<br> @@ -124,11 +124,12 @@<br> * @param parse Parsing context.<br> * @param stat_cursor Open the _sql_stat1 table on this cursor.<br> * you should allocate |stat_names| cursors before call.<br> - * @param table_name Delete records of this table if specified.<br> + * @param space_id Delete records of this table if id is not<br> + * BOX_ID_NIL.<br> */<br> static void<br> vdbe_emit_stat_space_open(struct Parse *parse, int stat_cursor,<br> - const char *table_name)<br> + uint32_t space_id)<br> {<br> const char *stat_names[] = {"_sql_stat1", "_sql_stat4"};<br> const uint32_t stat_ids[] = {BOX_SQL_STAT1_ID, BOX_SQL_STAT4_ID};<br> @@ -136,10 +137,9 @@ vdbe_emit_stat_space_open(struct Parse *parse, int stat_cursor,<br> assert(v != NULL);<br> assert(sqlite3VdbeDb(v) == parse->db);<br> for (uint i = 0; i < lengthof(stat_names); ++i) {<br> - const char *space_name = stat_names[i];<br> - if (table_name != NULL) {<br> - vdbe_emit_stat_space_clear(parse, space_name, NULL,<br> - table_name);<br> + if (space_id != BOX_ID_NIL) {<br> + vdbe_emit_stat_space_clear(parse, stat_names[i],<br> + space_id, BOX_ID_NIL);<br> } else {<br> sqlite3VdbeAddOp1(v, OP_Clear, stat_ids[i]);<br> }<br> @@ -787,10 +787,10 @@ vdbe_emit_analyze_space(struct Parse *parse, struct space *space,<br> int key_reg = ++parse->nMem;<br> /* Temporary use register. */<br> int tmp_reg = ++parse->nMem;<br> - /* Register containing table name. */<br> - int tab_name_reg = ++parse->nMem;<br> - /* Register containing index name. */<br> - int idx_name_reg = ++parse->nMem;<br> + /* Register containing space id. */<br> + int space_id_reg = ++parse->nMem;<br> + /* Register containing index id. */<br> + int index_id_reg = ++parse->nMem;<br> /* Value for the stat column of _sql_stat1. */<br> int stat1_reg = ++parse->nMem;<br> /* MUST BE LAST (see below). */<br> @@ -810,7 +810,7 @@ vdbe_emit_analyze_space(struct Parse *parse, struct space *space,<br> const char *tab_name = space_name(space);<br> sqlite3VdbeAddOp4(v, OP_OpenRead, tab_cursor, 0, 0, (void *) space,<br> P4_SPACEPTR);<br> - sqlite3VdbeLoadString(v, tab_name_reg, space->def->name);<br> + sqlite3VdbeAddOp2(v, OP_Integer, space->def->id, space_id_reg);<br> for (uint32_t j = 0; j < space->index_count; ++j) {<br> struct index *idx = space->index[j];<br> const char *idx_name;<br> @@ -824,8 +824,8 @@ vdbe_emit_analyze_space(struct Parse *parse, struct space *space,<br> else<br> idx_name = idx->def->name;<br> int part_count = idx->def->key_def->part_count;<br> - /* Populate the register containing the index name. */<br> - sqlite3VdbeLoadString(v, idx_name_reg, idx_name);<br> + /* Populate the register containing the index id. */<br> + sqlite3VdbeAddOp2(v, OP_Integer, idx->def->iid, index_id_reg);<br> VdbeComment((v, "Analysis for %s.%s", tab_name, idx_name));<br> /*<br> * Pseudo-code for loop that calls stat_push():<br> @@ -1000,9 +1000,8 @@ vdbe_emit_analyze_space(struct Parse *parse, struct space *space,<br> sqlite3VdbeAddOp2(v, OP_Next, idx_cursor, next_row_addr);<br> /* Add the entry to the stat1 table. */<br> callStatGet(v, stat4_reg, STAT_GET_STAT1, stat1_reg);<br> - assert("BBB"[0] == AFFINITY_TEXT);<br> - sqlite3VdbeAddOp4(v, OP_MakeRecord, tab_name_reg, 3, tmp_reg,<br> - "BBB", 0);<br> + sqlite3VdbeAddOp4(v, OP_MakeRecord, space_id_reg, 3, tmp_reg,<br> + "DDB", 0);<br> sqlite3VdbeAddOp2(v, OP_IdxInsert, stat_cursor, tmp_reg);<br> /* Add the entries to the stat4 table. */<br> int eq_reg = stat1_reg;<br> @@ -1035,7 +1034,7 @@ vdbe_emit_analyze_space(struct Parse *parse, struct space *space,<br> }<br> sqlite3VdbeAddOp3(v, OP_MakeRecord, col_reg, part_count,<br> sample_reg);<br> - sqlite3VdbeAddOp3(v, OP_MakeRecord, tab_name_reg, 6, tmp_reg);<br> + sqlite3VdbeAddOp3(v, OP_MakeRecord, space_id_reg, 6, tmp_reg);<br> sqlite3VdbeAddOp2(v, OP_IdxReplace, stat_cursor + 1, tmp_reg);<br> /* P1==1 for end-of-loop. */<br> sqlite3VdbeAddOp2(v, OP_Goto, 1, next_addr);<br> @@ -1092,7 +1091,7 @@ sql_analyze_database(struct Parse *parser)<br> sql_set_multi_write(parser, false);<br> int stat_cursor = parser->nTab;<br> parser->nTab += 2;<br> - vdbe_emit_stat_space_open(parser, stat_cursor, NULL);<br> + vdbe_emit_stat_space_open(parser, stat_cursor, BOX_ID_NIL);<br> struct analyze_data anal_data = { parser, stat_cursor };<br> space_foreach(sql_space_foreach_analyze, (void *) &anal_data);<br> loadAnalysis(parser);<br> @@ -1116,7 +1115,7 @@ vdbe_emit_analyze_table(struct Parse *parse, struct space *space)<br> */<br> int stat_cursor = parse->nTab;<br> parse->nTab += 2;<br> - vdbe_emit_stat_space_open(parse, stat_cursor, space->def->name);<br> + vdbe_emit_stat_space_open(parse, stat_cursor, space->def->id);<br> vdbe_emit_analyze_space(parse, space, stat_cursor);<br> loadAnalysis(parse);<br> }<br> @@ -1252,24 +1251,14 @@ analysis_loader(void *data, int argc, char **argv, char **unused)<br> struct analysis_index_info *info = (struct analysis_index_info *) data;<br> assert(info->stats != NULL);<br> struct index_stat *stat = &info->stats[info->index_count++];<br> - uint32_t space_id = box_space_id_by_name(argv[0], strlen(argv[0]));<br> - if (space_id == BOX_ID_NIL)<br> + uint32_t space_id = atoll(argv[0]);<br> + if (space_id == 0)<br> return -1;<br> struct space *space = space_by_id(space_id);<br> assert(space != NULL);<br> struct index *index;<br> - uint32_t iid = box_index_id_by_name(space_id, argv[1], strlen(argv[1]));<br> - /*<br> - * Convention is if index's name matches with space's<br> - * one, then it is primary index.<br> - */<br> - if (iid != BOX_ID_NIL) {<br> - index = space_index(space, iid);<br> - } else {<br> - if (sqlite3_stricmp(argv[0], argv[1]) != 0)<br> - return -1;<br> - index = space_index(space, 0);<br> - }<br> + uint32_t iid = atoll(argv[1]);<br> + index = space_index(space, iid);<br> assert(index != NULL);<br> /*<br> * Additional field is used to describe total<br> @@ -1383,8 +1372,12 @@ sample_compare(const void *a, const void *b, void *arg)<br> * Arguments must point to SQL statements that return<br> * data equivalent to the following:<br> *<br> - * prepare: SELECT tbl,idx,count(*) FROM _sql_stat4 GROUP BY tbl,idx;<br> - * load: SELECT tbl,idx,neq,nlt,ndlt,sample FROM _sql_stat4;<br> + * prepare:<br> + * SELECT space_id,index_id,count(*) FROM _sql_stat4<br> + * GROUP BY space_id,index_id;<br> + * load:<br> + * SELECT space_id,index_id,neq,nlt,ndlt,sample<br> + * FROM _sql_stat4;<br> *<br> * 'prepare' statement is used to allocate enough memory for<br> * statistics (i.e. arrays lt, dt, dlt and avg_eq). 'load' query<br> @@ -1416,27 +1409,14 @@ load_stat_from_space(struct sqlite3 *db, const char *sql_select_prepare,<br> goto finalize;<br> uint32_t current_idx_count = 0;<br> while (sqlite3_step(stmt) == SQLITE_ROW) {<br> - const char *space_name = (char *)sqlite3_column_text(stmt, 0);<br> - if (space_name == NULL)<br> - continue;<br> - const char *index_name = (char *)sqlite3_column_text(stmt, 1);<br> - if (index_name == NULL)<br> - continue;<br> - uint32_t sample_count = sqlite3_column_int(stmt, 2);<br> - uint32_t space_id = box_space_id_by_name(space_name,<br> - strlen(space_name));<br> - assert(space_id != BOX_ID_NIL);<br> + uint32_t space_id = sqlite3_column_int(stmt, 0);<br> + assert(space_id != 0);<br> struct space *space = space_by_id(space_id);<br> assert(space != NULL);<br> - struct index *index;<br> - uint32_t iid = box_index_id_by_name(space_id, index_name,<br> - strlen(index_name));<br> - if (sqlite3_stricmp(space_name, index_name) == 0 &&<br> - iid == BOX_ID_NIL)<br> - index = space_index(space, 0);<br> - else<br> - index = space_index(space, iid);<br> + uint32_t iid = sqlite3_column_int(stmt, 1);<br> + struct index *index = space_index(space, iid);<br> assert(index != NULL);<br> + uint32_t sample_count = sqlite3_column_int(stmt, 2);<br> uint32_t column_count = index->def->key_def->part_count;<br> struct index_stat *stat = &stats[current_idx_count];<br> stat->sample_field_count = column_count;<br> @@ -1488,27 +1468,12 @@ load_stat_from_space(struct sqlite3 *db, const char *sql_select_prepare,<br> struct index *prev_index = NULL;<br> current_idx_count = 0;<br> while (sqlite3_step(stmt) == SQLITE_ROW) {<br> - const char *space_name = (char *)sqlite3_column_text(stmt, 0);<br> - if (space_name == NULL)<br> - continue;<br> - const char *index_name = (char *)sqlite3_column_text(stmt, 1);<br> - if (index_name == NULL)<br> - continue;<br> - uint32_t space_id = box_space_id_by_name(space_name,<br> - strlen(space_name));<br> - assert(space_id != BOX_ID_NIL);<br> + uint32_t space_id = sqlite3_column_int(stmt, 0);<br> + assert(space_id != 0);<br> struct space *space = space_by_id(space_id);<br> assert(space != NULL);<br> - struct index *index;<br> - uint32_t iid = box_index_id_by_name(space_id, index_name,<br> - strlen(index_name));<br> - if (iid != BOX_ID_NIL) {<br> - index = space_index(space, iid);<br> - } else {<br> - if (sqlite3_stricmp(space_name, index_name) != 0)<br> - return -1;<br> - index = space_index(space, 0);<br> - }<br> + uint32_t iid = sqlite3_column_int(stmt, 1);<br> + struct index *index = space_index(space, iid);<br> assert(index != NULL);<br> uint32_t column_count = index->def->key_def->part_count;<br> if (index != prev_index) {<br> @@ -1572,28 +1537,13 @@ load_stat_to_index(struct sqlite3 *db, const char *sql_select_load,<br> return -1;<br> uint32_t current_idx_count = 0;<br> while (sqlite3_step(stmt) == SQLITE_ROW) {<br> - const char *space_name = (char *)sqlite3_column_text(stmt, 0);<br> - if (space_name == NULL)<br> - continue;<br> - const char *index_name = (char *)sqlite3_column_text(stmt, 1);<br> - if (index_name == NULL)<br> - continue;<br> - uint32_t space_id = box_space_id_by_name(space_name,<br> - strlen(space_name));<br> - if (space_id == BOX_ID_NIL)<br> + uint32_t space_id = sqlite3_column_int(stmt, 0);<br> + if (space_id == 0)<br> return -1;<br> struct space *space = space_by_id(space_id);<br> assert(space != NULL);<br> - struct index *index;<br> - uint32_t iid = box_index_id_by_name(space_id, index_name,<br> - strlen(index_name));<br> - if (iid != BOX_ID_NIL) {<br> - index = space_index(space, iid);<br> - } else {<br> - if (sqlite3_stricmp(space_name, index_name) != 0)<br> - return -1;<br> - index = space_index(space, 0);<br> - }<br> + uint32_t iid = sqlite3_column_int(stmt, 1);<br> + struct index *index = space_index(space, iid);<br> assert(index != NULL);<br> free(index->def->opts.stat);<br> index->def->opts.stat = stats[current_idx_count++];<br> @@ -1736,7 +1686,7 @@ sql_analysis_load(struct sqlite3 *db)<br> info.stats = stats;<br> info.index_count = 0;<br> const char *load_stat1 =<br> - "SELECT \"tbl\",\"idx\",\"stat\" FROM \"_sql_stat1\"";<br> + "SELECT \"space_id\",\"index_id\",\"stat\" FROM \"_sql_stat1\"";<br> /* Load new statistics out of the _sql_stat1 table. */<br> if (sqlite3_exec(db, load_stat1, analysis_loader, &info, 0) != 0)<br> goto fail;<br> @@ -1749,10 +1699,10 @@ sql_analysis_load(struct sqlite3 *db)<br> * statistics. Result rows are given in a form:<br> * <table name>, <index name>, <count of samples><br> */<br> - const char *init_query = "SELECT \"tbl\",\"idx\",count(*) FROM "<br> - "\"_sql_stat4\" GROUP BY \"tbl\",\"idx\"";<br> + const char *init_query = "SELECT \"space_id\",\"index_id\",count(*) FROM "<br> + "\"_sql_stat4\" GROUP BY \"space_id\",\"index_id\"";<br> /* Query for loading statistics into in-memory structs. */<br> - const char *load_query = "SELECT \"tbl\",\"idx\",\"neq\",\"nlt\","<br> + const char *load_query = "SELECT \"space_id\",\"index_id\",\"neq\",\"nlt\","<br> "\"ndlt\",\"sample\" FROM \"_sql_stat4\"";<br> /* Load the statistics from the _sql_stat4 table. */<br> if (load_stat_from_space(db, init_query, load_query, stats) != 0)<br> @@ -1796,8 +1746,8 @@ sql_analysis_load(struct sqlite3 *db)<br> * Ordered query is needed to be sure that indexes come<br> * in the same order as in previous SELECTs.<br> */<br> - const char *order_query = "SELECT \"tbl\",\"idx\" FROM "<br> - "\"_sql_stat4\" GROUP BY \"tbl\",\"idx\"";<br> + const char *order_query = "SELECT \"space_id\",\"index_id\" FROM "<br> + "\"_sql_stat4\" GROUP BY \"space_id\",\"index_id\"";<br> if (load_stat_to_index(db, order_query, heap_stats) != 0)<br> goto fail;<br> if (box_txn_commit() != 0)<br> diff --git a/src/box/sql/build.c b/src/box/sql/build.c<br> index 43be777..c5a98e8 100644<br> --- a/src/box/sql/build.c<br> +++ b/src/box/sql/build.c<br> @@ -1629,75 +1629,43 @@ sql_store_select(struct Parse *parse_context, struct Select *select)<br> parse_context->parsed_ast.select = select_copy;<br> }<br> <br> -/**<br> - * Create expression record "@col_name = '@col_value'".<br> - *<br> - * @param parse The parsing context.<br> - * @param col_name Name of column.<br> - * @param col_value Name of row.<br> - * @retval not NULL on success.<br> - * @retval NULL on failure.<br> - */<br> -static struct Expr *<br> -sql_id_eq_str_expr(struct Parse *parse, const char *col_name,<br> - const char *col_value)<br> -{<br> - struct sqlite3 *db = parse->db;<br> -<br> - struct Expr *col_name_expr = sqlite3Expr(db, TK_ID, col_name);<br> - if (col_name_expr == NULL)<br> - return NULL;<br> - struct Expr *col_value_expr = sqlite3Expr(db, TK_STRING, col_value);<br> - if (col_value_expr == NULL) {<br> - sql_expr_delete(db, col_name_expr, false);<br> - return NULL;<br> - }<br> - return sqlite3PExpr(parse, TK_EQ, col_name_expr, col_value_expr);<br> -}<br> -<br> void<br> vdbe_emit_stat_space_clear(struct Parse *parse, const char *stat_table_name,<br> - const char *idx_name, const char *table_name)<br> + uint32_t space_id, uint32_t index_id)<br> {<br> - assert(idx_name != NULL || table_name != NULL);<br> struct sqlite3 *db = parse->db;<br> assert(!db->mallocFailed);<br> struct SrcList *src_list = sql_alloc_src_list(db);<br> if (src_list != NULL)<br> src_list->a[0].zName = sqlite3DbStrDup(db, stat_table_name);<br> - struct Expr *where = NULL;<br> - if (idx_name != NULL) {<br> - struct Expr *expr = sql_id_eq_str_expr(parse, "idx", idx_name);<br> - if (expr != NULL)<br> - where = sqlite3ExprAnd(db, expr, where);<br> - }<br> - if (table_name != NULL) {<br> - struct Expr *expr = sql_id_eq_str_expr(parse, "tbl", table_name);<br> - if (expr != NULL)<br> - where = sqlite3ExprAnd(db, expr, where);<br> - }<br> - /**<br> - * On memory allocation error sql_table delete_from<br> - * releases memory for its own.<br> - */<br> - sql_table_delete_from(parse, src_list, where);<br> + struct Expr *expr = NULL;<br> + struct Expr *col = sqlite3Expr(db, TK_ID, "space_id");<br> + struct Expr *val = sqlite3ExprInteger(db, space_id);<br> + if (col != NULL && val != NULL)<br> + expr = sqlite3PExpr(parse, TK_EQ, col, val);<br> + if (index_id != BOX_ID_NIL && expr != NULL) {<br> + col = sqlite3Expr(db, TK_ID, "index_id");<br> + val = sqlite3ExprInteger(db, index_id);<br> + expr = sqlite3ExprAnd(db, sqlite3PExpr(parse, TK_EQ, col, val),<br> + expr);<br> + }<br> + sql_table_delete_from(parse, src_list, expr);<br> }<br> <br> /**<br> * Remove entries from the _sql_stat1 and _sql_stat4<br> * system spaces after a DROP INDEX or DROP TABLE command.<br> *<br> - * @param parse The parsing context.<br> - * @param table_name The table to be dropped or<br> - * the table that contains index to be dropped.<br> - * @param idx_name Index to be dropped.<br> + * @param parse The parsing context.<br> + * @param space_id Id of table to be dropped or table that<br> + * contains index to be dropped.<br> + * @param index_id Id of index to be dropped.<br> */<br> static void<br> -sql_clear_stat_spaces(struct Parse *parse, const char *table_name,<br> - const char *idx_name)<br> +sql_clear_stat_spaces(struct Parse *parse, uint32_t space_id, uint32_t index_id)<br> {<br> - vdbe_emit_stat_space_clear(parse, "_sql_stat4", idx_name, table_name);<br> - vdbe_emit_stat_space_clear(parse, "_sql_stat1", idx_name, table_name);<br> + vdbe_emit_stat_space_clear(parse, "_sql_stat4", space_id, index_id);<br> + vdbe_emit_stat_space_clear(parse, "_sql_stat1", space_id, index_id);<br> }<br> <br> /**<br> @@ -1915,7 +1883,7 @@ sql_drop_table(struct Parse *parse_context, struct SrcList *table_name_list,<br> goto exit_drop_table;<br> }<br> }<br> - sql_clear_stat_spaces(parse_context, space_name, NULL);<br> + sql_clear_stat_spaces(parse_context, space->def->id, BOX_ID_NIL);<br> sql_code_drop_table(parse_context, space, is_view);<br> <br> exit_drop_table:<br> @@ -2776,7 +2744,8 @@ sql_drop_index(struct Parse *parse_context, struct SrcList *index_name_list,<br> * But firstly, delete statistics since schema<br> * changes after DDL.<br> */<br> - sql_clear_stat_spaces(parse_context, table_name, index->def->name);<br> + sql_clear_stat_spaces(parse_context, space->def->id, index->def->iid);<br> +<br> int record_reg = ++parse_context->nMem;<br> int space_id_reg = ++parse_context->nMem;<br> sqlite3VdbeAddOp2(v, OP_Integer, space_id, space_id_reg);<br> diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h<br> index e8078b4..453b7d4 100644<br> --- a/src/box/sql/sqliteInt.h<br> +++ b/src/box/sql/sqliteInt.h<br> @@ -4858,11 +4858,13 @@ vdbe_emit_halt_with_presence_test(struct Parse *parser, int space_id,<br> *<br> * @param parse The parsing context.<br> * @param stat_table_name System stat table name.<br> - * @param idx_name Index name.<br> - * @param table_name Table name.<br> + * @param table_id Id of table of which analysis will be deleted.<br> + * @param index_id Id of index of which analysis will be deleted.<br> + * If index_id is BOX_ID_NIL than analysis of all indexes<br> + * of selected table will be deleted.<br> */<br> void<br> vdbe_emit_stat_space_clear(struct Parse *parse, const char *stat_table_name,<br> - const char *idx_name, const char *table_name);<br> + uint32_t table_id, uint32_t index_id);<br> <br> #endif /* SQLITEINT_H */<br> diff --git a/test/box-py/bootstrap.result b/test/box-py/bootstrap.result<br> index 506aca3..b5850c2 100644<br> --- a/test/box-py/bootstrap.result<br> +++ b/test/box-py/bootstrap.result<br> @@ -74,11 +74,12 @@ box.space._space:select{}<br> 'type': 'unsigned'}]]<br> - [340, 1, '_space_sequence', 'memtx', 0, {}, [{'name': 'id', 'type': 'unsigned'},<br> {'name': 'sequence_id', 'type': 'unsigned'}, {'name': 'is_generated', 'type': 'boolean'}]]<br> - - [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'stat', 'type': 'string'}]]<br> - - [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'neq', 'type': 'string'}, {'name': 'nlt', 'type': 'string'},<br> - {'name': 'ndlt', 'type': 'string'}, {'name': 'sample', 'type': 'scalar'}]]<br> + - [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'stat', 'type': 'string'}]]<br> + - [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'neq', 'type': 'string'},<br> + {'name': 'nlt', 'type': 'string'}, {'name': 'ndlt', 'type': 'string'}, {'name': 'sample',<br> + 'type': 'scalar'}]]<br> - [356, 1, '_fk_constraint', 'memtx', 0, {}, [{'name': 'name', 'type': 'string'},<br> {'name': 'child_id', 'type': 'unsigned'}, {'name': 'parent_id', 'type': 'unsigned'},<br> {'name': 'is_deferred', 'type': 'boolean'}, {'name': 'match', 'type': 'string'},<br> @@ -134,9 +135,9 @@ box.space._index:select{}<br> - [330, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]<br> - [340, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]<br> - [340, 1, 'sequence', 'tree', {'unique': false}, [[1, 'unsigned']]]<br> - - [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string']]]<br> - - [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string'], [<br> - 5, 'scalar']]]<br> + - [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned']]]<br> + - [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned'],<br> + [5, 'scalar']]]<br> - [356, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'unsigned']]]<br> - [356, 1, 'child_id', 'tree', {'unique': false}, [[1, 'unsigned']]]<br> ...<br> diff --git a/test/box/access_misc.result b/test/box/access_misc.result<br> index 4ffeb38..83e9d3e 100644<br> --- a/test/box/access_misc.result<br> +++ b/test/box/access_misc.result<br> @@ -813,11 +813,12 @@ box.space._space:select()<br> 'type': 'unsigned'}]]<br> - [340, 1, '_space_sequence', 'memtx', 0, {}, [{'name': 'id', 'type': 'unsigned'},<br> {'name': 'sequence_id', 'type': 'unsigned'}, {'name': 'is_generated', 'type': 'boolean'}]]<br> - - [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'stat', 'type': 'string'}]]<br> - - [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'neq', 'type': 'string'}, {'name': 'nlt', 'type': 'string'},<br> - {'name': 'ndlt', 'type': 'string'}, {'name': 'sample', 'type': 'scalar'}]]<br> + - [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'stat', 'type': 'string'}]]<br> + - [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'neq', 'type': 'string'},<br> + {'name': 'nlt', 'type': 'string'}, {'name': 'ndlt', 'type': 'string'}, {'name': 'sample',<br> + 'type': 'scalar'}]]<br> - [356, 1, '_fk_constraint', 'memtx', 0, {}, [{'name': 'name', 'type': 'string'},<br> {'name': 'child_id', 'type': 'unsigned'}, {'name': 'parent_id', 'type': 'unsigned'},<br> {'name': 'is_deferred', 'type': 'boolean'}, {'name': 'match', 'type': 'string'},<br> diff --git a/test/box/alter.result b/test/box/alter.result<br> index 9a1086e..86e8c3a 100644<br> --- a/test/box/alter.result<br> +++ b/test/box/alter.result<br> @@ -228,9 +228,9 @@ _index:select{}<br> - [330, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]<br> - [340, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]<br> - [340, 1, 'sequence', 'tree', {'unique': false}, [[1, 'unsigned']]]<br> - - [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string']]]<br> - - [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string'], [<br> - 5, 'scalar']]]<br> + - [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned']]]<br> + - [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned'],<br> + [5, 'scalar']]]<br> - [356, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'unsigned']]]<br> - [356, 1, 'child_id', 'tree', {'unique': false}, [[1, 'unsigned']]]<br> ...<br> diff --git a/test/sql-tap/analyze1.test.lua b/test/sql-tap/analyze1.test.lua<br> index 2d8eed9..df433de 100755<br> --- a/test/sql-tap/analyze1.test.lua<br> +++ b/test/sql-tap/analyze1.test.lua<br> @@ -65,7 +65,7 @@ test:do_execsql_test(<br> test:do_execsql_test(<br> "analyze-1.7",<br> [[<br> - SELECT * FROM "_sql_stat1" WHERE "idx" IS NOT NULL<br> + SELECT * FROM "_sql_stat1" WHERE "index_id" IS NOT NULL<br> ]], {<br> -- <analyze-1.7><br> -- </analyze-1.7><br> @@ -84,7 +84,7 @@ test:do_catchsql_test(<br> test:do_execsql_test(<br> "analyze-1.9",<br> [[<br> - SELECT * FROM "_sql_stat1" WHERE "idx" IS NOT NULL<br> + SELECT * FROM "_sql_stat1" WHERE "index_id" IS NOT NULL<br> ]], {<br> -- <analyze-1.9><br> -- </analyze-1.9><br> @@ -119,7 +119,7 @@ test:do_execsql_test(<br> [[<br> CREATE INDEX t1i1 ON t1(a);<br> ANALYZE t1;<br> - SELECT * FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT * FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-2.1><br> -- </analyze-2.1><br> @@ -130,7 +130,7 @@ test:do_execsql_test(<br> [[<br> CREATE INDEX t1i2 ON t1(b);<br> ANALYZE t1;<br> - SELECT * FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT * FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-2.2><br> -- </analyze-2.2><br> @@ -141,7 +141,7 @@ test:do_execsql_test(<br> [[<br> CREATE INDEX t1i3 ON t1(a,b);<br> ANALYZE;<br> - SELECT * FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT * FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-2.3><br> -- </analyze-2.3><br> @@ -157,10 +157,10 @@ test:do_execsql_test(<br> INSERT INTO t1 VALUES(1, 1,2);<br> INSERT INTO t1 VALUES(2, 1,3);<br> ANALYZE t1;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.1><br> - "T1", "2 1", "T1I1", "2 2", "T1I2", "2 1", "T1I3", "2 2 1"<br> + 0, "2 1", 1, "2 2", 2, "2 1", 3, "2 2 1"<br> -- </analyze-3.1><br> })<br> <br> @@ -170,10 +170,10 @@ test:do_execsql_test(<br> INSERT INTO t1 VALUES(3, 1,4);<br> INSERT INTO t1 VALUES(4, 1,5);<br> ANALYZE t1;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.2><br> - "T1", "4 1", "T1I1", "4 4", "T1I2", "4 1", "T1I3", "4 4 1"<br> + 0, "4 1", 1, "4 4", 2, "4 1", 3, "4 4 1"<br> -- </analyze-3.2><br> })<br> <br> @@ -182,10 +182,10 @@ test:do_execsql_test(<br> [[<br> INSERT INTO t1 (a,b) VALUES(2,5);<br> ANALYZE;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.3><br> - "T1","5 1", "T1I1", "5 3", "T1I2", "5 2", "T1I3", "5 3 1"<br> + 0,"5 1", 1, "5 3", 2, "5 2", 3, "5 3 1"<br> -- </analyze-3.3><br> })<br> <br> @@ -198,10 +198,10 @@ test:do_execsql_test(<br> CREATE INDEX t2i2 ON t2(b);<br> CREATE INDEX t2i3 ON t2(a,b);<br> ANALYZE;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.4><br> - "T1","5 1","T1I1","5 3","T1I2","5 2","T1I3","5 3 1","T2","5 1","T2I1","5 3","T2I2","5 2","T2I3","5 3 1"<br> + 0,"5 1",0,"5 1",1,"5 3",1,"5 3",2,"5 2",2,"5 2",3,"5 3 1",3,"5 3 1"<br> -- </analyze-3.4><br> })<br> <br> @@ -210,10 +210,10 @@ test:do_execsql_test(<br> [[<br> DROP INDEX t2i3 ON t2;;<br> ANALYZE t1;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.5><br> - "T1","5 1","T1I1","5 3","T1I2","5 2","T1I3","5 3 1","T2","5 1","T2I1","5 3","T2I2","5 2"<br> + 0,"5 1",0,"5 1",1,"5 3",1,"5 3",2,"5 2",2,"5 2",3,"5 3 1"<br> -- </analyze-3.5><br> })<br> <br> @@ -221,10 +221,10 @@ test:do_execsql_test(<br> "analyze-3.6",<br> [[<br> ANALYZE t2;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.6><br> - "T1","5 1","T1I1","5 3","T1I2","5 2","T1I3","5 3 1","T2","5 1","T2I1","5 3","T2I2","5 2"<br> + 0,"5 1",0,"5 1",1,"5 3",1,"5 3",2,"5 2",2,"5 2",3,"5 3 1"<br> -- </analyze-3.6><br> })<br> <br> @@ -233,10 +233,10 @@ test:do_execsql_test(<br> [[<br> DROP INDEX t2i2 ON t2;<br> ANALYZE t2;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.7><br> - "T1","5 1","T1I1","5 3","T1I2","5 2","T1I3","5 3 1","T2","5 1","T2I1","5 3"<br> + 0,"5 1",0,"5 1",1,"5 3",1,"5 3",2,"5 2",3,"5 3 1"<br> -- </analyze-3.7><br> })<br> <br> @@ -250,7 +250,7 @@ test:do_execsql_test(<br> CREATE INDEX t3i3 ON t3(d,b,c,a);<br> DROP TABLE t1;<br> DROP TABLE t2;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.8> <br> -- </analyze-3.8><br> @@ -260,10 +260,10 @@ test:do_execsql_test(<br> "analyze-3.9",<br> [[<br> ANALYZE;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-3.9><br> - "T3","5 1","T3I1","5 3","T3I2","5 3 1 1 1","T3I3","5 5 2 1 1"<br> + 0,"5 1",1,"5 3",2,"5 3 1 1 1",3,"5 5 2 1 1"<br> -- </analyze-3.9><br> })<br> <br> @@ -277,7 +277,7 @@ test:do_execsql_test(<br> -- INSERT INTO [silly " name] (a,b,c) VALUES(1, 2, 3);<br> -- INSERT INTO [silly " name] (a,b,c) VALUES(4, 5, 6);<br> -- ANALYZE;<br> --- SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> +-- SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> -- ]], {<br> -- -- <analyze-3.10><br> -- "another foolish ' name", "2 1", "foolish ' name", "2 1 1", "t3i1", "5 3", "t3i2", "5 3 1 1 1", "t3i3", "5 5 2 1 1"<br> @@ -288,7 +288,7 @@ test:do_execsql_test(<br> -- "analyze-3.11",<br> -- [[<br> -- DROP INDEX "foolish ' name";<br> --- SELECT "idx", "stat" FROM sqlite_stat1 ORDER BY "idx";<br> +-- SELECT "index_id", "stat" FROM sqlite_stat1 ORDER BY "index_id";<br> -- ]], {<br> -- -- <analyze-3.11><br> -- "another foolish ' name", "2 1", "t3i1", "5 3", "t3i2", "5 3 1 1 1", "t3i3", "5 5 2 1 1"<br> @@ -299,7 +299,7 @@ test:do_execsql_test(<br> -- "analyze-3.11",<br> -- [[<br> -- DROP TABLE "silly "" name";<br> --- SELECT "idx", "stat" FROM sqlite_stat1 ORDER BY "idx";<br> +-- SELECT "index_id", "stat" FROM sqlite_stat1 ORDER BY "index_id";<br> -- ]], {<br> -- -- <analyze-3.11><br> -- "t3i1", "5 3", "t3i2", "5 3 1 1 1", "t3i3", "5 5 2 1 1"<br> @@ -317,31 +317,33 @@ test:do_execsql_test(<br> CREATE INDEX t4i2 ON t4(y);<br> INSERT INTO t4 SELECT id,a,b,c FROM t3;<br> ANALYZE;<br> - SELECT "idx", "stat" FROM "_sql_stat1" ORDER BY "idx";<br> + SELECT "index_id", "stat" FROM "_sql_stat1" ORDER BY "index_id";<br> ]], {<br> -- <analyze-4.0><br> - "T3", "5 1", "T3I1", "5 3", "T3I2", "5 3 1 1 1", "T3I3", "5 5 2 1 1", "T4", "5 1", "T4I1", "5 3", "T4I2", "5 2"<br> + 0, "5 1", 0, "5 1", 1, "5 3", 1, "5 3", 2, "5 3 1 1 1", 2, "5 2", 3, "5 5 2 1 1"<br> -- </analyze-4.0><br> })<br> <br> +t4 = box.space.T4<br> +<br> test:do_execsql_test(<br> "analyze-4.1",<br> - [[<br> + string.format([[<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1" VALUES('t4', 't4i1', 'nonsense');<br> - INSERT INTO "_sql_stat1" VALUES('t4', 't4i2', '432653287412874653284129847632');<br> + INSERT INTO "_sql_stat1" VALUES(%i, %i, 'nonsense');<br> + INSERT INTO "_sql_stat1" VALUES(%i, %i, '432653287412874653284129847632');<br> SELECT * FROM t4 WHERE x = 1234;<br> - ]], {<br> + ]], t4.id, t4.index['T4I1'].id, t4.id, t4.index['T4I2'].id), {<br> -- <analyze-4.1><br> -- </analyze-4.1><br> })<br> <br> test:do_execsql_test(<br> "analyze-4.2",<br> - [[<br> - INSERT INTO "_sql_stat1" VALUES('t4', 'xyzzy', '0 1 2 3');<br> + string.format([[<br> + INSERT INTO "_sql_stat1" VALUES(%i, 12345, '0 1 2 3');<br> SELECT * FROM t4 WHERE x = 1234;<br> - ]], {<br> + ]], t4.id), {<br> -- <analyze-4.2><br> -- </analyze-4.2><br> })<br> @@ -367,20 +369,20 @@ test:do_execsql_test(<br> INSERT INTO t3 (a,b,c,d) SELECT a+64, b+64, c+64, d+64 FROM t3;<br> INSERT INTO t4 (x,y,z) SELECT a, b, c FROM t3;<br> ANALYZE;<br> - SELECT DISTINCT "tbl" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT COUNT(DISTINCT "space_id") FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.0><br> - "T3", "T4"<br> + 2<br> -- </analyze-5.0><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.0.1",<br> [[<br> - SELECT DISTINCT "idx" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT "index_id" FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.0><br> - "T3", "T3I1", "T3I2", "T3I3", "T4", "T4I1", "T4I2"<br> + 0, 0, 1, 1, 2, 2, 3<br> -- </analyze-5.0><br> })<br> <br> @@ -389,20 +391,20 @@ stat = "_sql_stat4"<br> test:do_execsql_test(<br> "analyze-5.1",<br> string.format([[<br> - SELECT DISTINCT "idx" FROM "%s" ORDER BY 1;<br> - ]], stat, stat), {<br> + SELECT DISTINCT "index_id" FROM "%s" ORDER BY 1;<br> + ]], stat), {<br> -- <analyze-5.1><br> - "T3", "T3I1", "T3I2", "T3I3", "T4", "T4I1", "T4I2"<br> + 0, 1, 2, 3<br> -- </analyze-5.1><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.1.1",<br> string.format([[<br> - SELECT DISTINCT "tbl" FROM "%s" ORDER BY 1;<br> - ]], stat, stat), {<br> + SELECT COUNT(DISTINCT "space_id") FROM "%s" ORDER BY 1;<br> + ]], stat), {<br> -- <analyze-5.1><br> - "T3", "T4"<br> + 2<br> -- </analyze-5.1><br> })<br> <br> @@ -411,40 +413,40 @@ test:do_execsql_test(<br> [[<br> DROP INDEX t3i2 ON t3;<br> ANALYZE;<br> - SELECT DISTINCT "idx" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT "index_id" FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.2><br> - "T3", "T3I1", "T3I3", "T4", "T4I1", "T4I2"<br> + 0, 0, 1, 1, 2, 3<br> -- </analyze-5.2><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.2.1",<br> [[<br> - SELECT DISTINCT "tbl" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT COUNT(DISTINCT "space_id") FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.2><br> - "T3", "T4"<br> + 2<br> -- </analyze-5.2><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.3",<br> string.format([[<br> - SELECT DISTINCT "idx" FROM "%s" ORDER BY 1;<br> + SELECT DISTINCT "index_id" FROM "%s" ORDER BY 1;<br> ]], stat, stat), {<br> -- <analyze-5.3><br> - "T3", "T3I1", "T3I3", "T4", "T4I1", "T4I2"<br> + 0, 1, 2, 3<br> -- </analyze-5.3><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.3.1",<br> string.format([[<br> - SELECT DISTINCT "tbl" FROM "%s" ORDER BY 1;<br> - ]], stat, stat), {<br> + SELECT COUNT(DISTINCT "space_id") FROM "%s" ORDER BY 1;<br> + ]], stat, stat, stat), {<br> -- <analyze-5.3><br> - "T3", "T4"<br> + 2<br> -- </analyze-5.3><br> })<br> <br> @@ -453,40 +455,40 @@ test:do_execsql_test(<br> [[<br> DROP TABLE IF EXISTS t3;<br> ANALYZE;<br> - SELECT DISTINCT "idx" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT DISTINCT "index_id" FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.4><br> - "T4", "T4I1", "T4I2"<br> + 0, 1, 2<br> -- </analyze-5.4><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.4.1",<br> [[<br> - SELECT DISTINCT "tbl" FROM "_sql_stat1" ORDER BY 1;<br> + SELECT COUNT(DISTINCT "space_id") FROM "_sql_stat1" ORDER BY 1;<br> ]], {<br> -- <analyze-5.4><br> - "T4"<br> + 1<br> -- </analyze-5.4><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.5",<br> string.format([[<br> - SELECT DISTINCT "idx" FROM "%s" ORDER BY 1;<br> + SELECT DISTINCT "index_id" FROM "%s" ORDER BY 1;<br> ]], stat), {<br> -- <analyze-5.5><br> - "T4", "T4I1", "T4I2"<br> + 0, 1, 2<br> -- </analyze-5.5><br> })<br> <br> test:do_execsql_test(<br> "analyze-5.5.1",<br> string.format([[<br> - SELECT DISTINCT "tbl" FROM "%s" ORDER BY 1;<br> - ]], stat), {<br> + SELECT COUNT(DISTINCT "space_id") FROM "%s" ORDER BY 1;<br> + ]], stat, stat), {<br> -- <analyze-5.5><br> - "T4"<br> + 1<br> -- </analyze-5.5><br> })<br> <br> @@ -516,33 +518,35 @@ test:do_test(<br> -- </analyze-6.1.1><br> })<br> <br> +t1 = box.space.T1<br> +<br> test:do_execsql_test(<br> "analyze-6.1.2",<br> - [[<br> - SELECT * FROM "_sql_stat1" where "tbl"='T1' and "idx"='I1' LIMIT 1;<br> - ]], {<br> + string.format([[<br> + SELECT "index_id", "stat" FROM "_sql_stat1" where "space_id"=%i and "index_id"=%i LIMIT 1;<br> + ]], t1.id, t1.index['I1'].id), {<br> -- <analyze-6.1.2><br> - "T1", "I1", "221 221 221 221 2"<br> + 1, "221 221 221 221 2"<br> -- </analyze-6.1.2><br> })<br> <br> test:do_execsql_test(<br> "analyze-6.1.3",<br> - [[<br> - SELECT "tbl", "idx", "neq", "nlt", "ndlt" FROM "_sql_stat4" where "tbl"='T1' and "idx"='I1' ORDER BY "nlt" LIMIT 1;<br> - ]], {<br> + string.format([[<br> + SELECT "index_id", "neq", "nlt", "ndlt" FROM "_sql_stat4" where "space_id"=%i and "index_id"=%i ORDER BY "nlt" LIMIT 1;<br> + ]], t1.id, t1.index['I1'].id), {<br> -- <analyze-6.1.3><br> - "T1", "I1", "221 221 221 1", "0 0 0 10", "0 0 0 10"<br> + 1, "221 221 221 1", "0 0 0 10", "0 0 0 10"<br> -- </analyze-6.1.3><br> })<br> <br> test:do_execsql_test(<br> "analyze-6.1.4",<br> - [[<br> - SELECT "tbl", "idx", "neq", "nlt", "ndlt" FROM "_sql_stat4" where "tbl"='T1' and "idx"='I1' ORDER BY "nlt" DESC LIMIT 1;<br> - ]], {<br> + string.format([[<br> + SELECT "index_id", "neq", "nlt", "ndlt" FROM "_sql_stat4" where "space_id"=%i and "index_id"=%i ORDER BY "nlt" DESC LIMIT 1;<br> + ]], t1.id, t1.index['I1'].id), {<br> -- <analyze-6.1.4><br> - "T1", "I1", "221 221 221 1", "0 0 0 99", "0 0 0 99"<br> + 1, "221 221 221 1", "0 0 0 99", "0 0 0 99"<br> -- </analyze-6.1.4><br> })<br> <br> diff --git a/test/sql-tap/analyze4.test.lua b/test/sql-tap/analyze4.test.lua<br> index c2cc190..d64cba8 100755<br> --- a/test/sql-tap/analyze4.test.lua<br> +++ b/test/sql-tap/analyze4.test.lua<br> @@ -49,15 +49,19 @@ test:do_test(<br> -- </analyze4-1.0><br> })<br> <br> +t1 = box.space.T1<br> +<br> -- Verify that the t1b index shows that it does not narrow down the<br> -- search any at all.<br> --<br> test:do_execsql_test(<br> "analyze4-1.1",<br> - [[ SELECT "idx", "stat" FROM "_sql_stat1" WHERE "tbl"='T1' ORDER BY "idx"; ]],<br> + string.format([[<br> + SELECT "index_id", "stat" FROM "_sql_stat1" WHERE "space_id"=%i ORDER BY "index_id";<br> + ]], t1.id),<br> {<br> -- <analyze4-1.1><br> - "T1","128 1", "T1A", "128 1", "T1B", "128 128"<br> + 0,"128 1", 1, "128 1", 2, "128 128"<br> -- </analyze4-1.1><br> })<br> <br> @@ -68,16 +72,16 @@ test:do_execsql_test(<br> test:do_test(<br> "analyze4-1.2",<br> function()<br> - return test:execsql([[<br> - UPDATE t1 SET b='x' WHERE a%2;<br> + return test:execsql(string.format([[<br> + UPDATE t1 SET b='x' WHERE a%%2;<br> -- pragma vdbe_debug=1;<br> ANALYZE;<br> -- pragma vdbe_debug=0;<br> - SELECT "idx", "stat" FROM "_sql_stat1" WHERE "tbl"='T1' ORDER BY "idx";<br> - ]])<br> + SELECT "index_id", "stat" FROM "_sql_stat1" WHERE "space_id"=%i ORDER BY "index_id";<br> + ]], t1.id))<br> end, {<br> -- <analyze4-1.2><br> - "T1", "128 1", "T1A", "128 1", "T1B", "128 64"<br> + 0, "128 1", 1, "128 1", 2, "128 64"<br> -- </analyze4-1.2><br> })<br> <br> @@ -85,37 +89,42 @@ test:do_test(<br> -- Create a multi-column indices using t1.b and verify that ANALYZE <br> -- processes them correctly.<br> --<br> +<br> +test:execsql([[<br> + -- Tarantool doesn't suppoort ALTER stmt yet.<br> + -- UPDATE t1 SET b=NULL;<br> + --ALTER TABLE t1 ADD COLUMN c;<br> + --ALTER TABLE t1 ADD COLUMN d;<br> + -- So, re-create the table and its contents<br> + DROP TABLE t1;<br> + CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c DEFAULT NULL,d DEFAULT NULL);<br> + CREATE INDEX t1a ON t1(a);<br> + CREATE INDEX t1b ON t1(b);<br> + INSERT INTO t1 (a,b) VALUES(1,NULL);<br> + INSERT INTO t1 (a,b) SELECT a+1, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+2, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+4, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+8, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+16, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+32, b FROM t1;<br> + INSERT INTO t1 (a,b) SELECT a+64, b FROM t1;<br> +<br> + UPDATE t1 SET c=a/4, d=a/2;<br> + CREATE INDEX t1bcd ON t1(b,c,d);<br> + CREATE INDEX t1cdb ON t1(c,d,b);<br> + CREATE INDEX t1cbd ON t1(c,b,d);<br> + ANALYZE;<br> +]])<br> +<br> +t1 = box.space.T1<br> +<br> test:do_execsql_test(<br> "analyze4-1.3",<br> - [[<br> - -- Tarantool doesn't suppoort ALTER stmt yet.<br> - -- UPDATE t1 SET b=NULL;<br> - --ALTER TABLE t1 ADD COLUMN c;<br> - --ALTER TABLE t1 ADD COLUMN d;<br> - -- So, re-create the table and its contents<br> - DROP TABLE t1;<br> - CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c DEFAULT NULL,d DEFAULT NULL);<br> - CREATE INDEX t1a ON t1(a);<br> - CREATE INDEX t1b ON t1(b);<br> - INSERT INTO t1 (a,b) VALUES(1,NULL);<br> - INSERT INTO t1 (a,b) SELECT a+1, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+2, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+4, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+8, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+16, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+32, b FROM t1;<br> - INSERT INTO t1 (a,b) SELECT a+64, b FROM t1;<br> -<br> - UPDATE t1 SET c=a/4, d=a/2;<br> - CREATE INDEX t1bcd ON t1(b,c,d);<br> - CREATE INDEX t1cdb ON t1(c,d,b);<br> - CREATE INDEX t1cbd ON t1(c,b,d);<br> - ANALYZE;<br> - SELECT "idx", "stat" FROM "_sql_stat1" WHERE "tbl"='T1' ORDER BY "idx";<br> - ]]<br> - , {<br> + string.format([[<br> + SELECT "index_id", "stat" FROM "_sql_stat1" WHERE "space_id"=%i ORDER BY "index_id";<br> + ]], t1.id), {<br> -- <analyze4-1.3><br> - "T1","128 1", "T1A", "128 1", "T1B", "128 128", "T1BCD", "128 128 4 2", "T1CBD", "128 4 4 2", "T1CDB", "128 4 2 2"<br> + 0,"128 1", 1, "128 1", 2, "128 128", 3, "128 128 4 2", 4, "128 4 2 2", 5, "128 4 4 2"<br> -- </analyze4-1.3><br> })<br> <br> diff --git a/test/sql-tap/analyze5.test.lua b/test/sql-tap/analyze5.test.lua<br> index d68bd3c..ece26e4 100755<br> --- a/test/sql-tap/analyze5.test.lua<br> +++ b/test/sql-tap/analyze5.test.lua<br> @@ -114,10 +114,11 @@ test:do_test(<br> <br> -- DISTINCT idx, sample -- lindex(test_decode(sample),0)<br> -- WHERE idx='t1u' ORDER BY nlt;<br> - return test:execsql([[ SELECT DISTINCT msgpack_decode("sample")<br> - FROM "_sql_stat4"<br> - WHERE "idx"='T1U'<br> - ORDER BY "nlt"]])<br> + return test:execsql(string.format([[<br> + SELECT DISTINCT msgpack_decode("sample")<br> + FROM "_sql_stat4"<br> + WHERE "index_id"= %i<br> + ORDER BY "nlt"]], box.space.T1.index['T1U'].id))<br> end, {<br> -- <analyze5-1.0><br> "alpha", "bravo", "charlie", "delta"<br> @@ -143,10 +144,10 @@ test:do_test(<br> test:do_test(<br> "analyze5-1.2",<br> function()<br> - return test:execsql([[SELECT "idx", count(*) FROM "_sql_stat4" GROUP BY 1 ORDER BY 1]])<br> + return test:execsql([[SELECT "index_id", count(*) FROM "_sql_stat4" GROUP BY 1 ORDER BY 1]])<br> end, {<br> -- <analyze5-1.2><br> - "T1",24,"T1T",4,"T1U",4,"T1V",1,"T1W",4,"T1X",4,"T1Y",2,"T1Z",4<br> + 0,24,1,4,2,4,3,1,4,4,5,4,6,2,7,4<br> -- </analyze5-1.2><br> })<br> <br> diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua<br> index 05ed501..075cc69 100755<br> --- a/test/sql-tap/analyze9.test.lua<br> +++ b/test/sql-tap/analyze9.test.lua<br> @@ -1,6 +1,6 @@<br> #!/usr/bin/env tarantool<br> test = require("sqltester")<br> -test:plan(121)<br> +test:plan(120)<br> <br> testprefix = "analyze9"<br> <br> @@ -62,29 +62,29 @@ msgpack_decode_sample = function(txt)<br> end<br> <br> box.internal.sql_create_function("msgpack_decode_sample", msgpack_decode_sample)<br> +t1 = box.space.T1<br> <br> test:do_execsql_test(<br> 1.2,<br> - [[<br> - SELECT "tbl","idx","neq","nlt","ndlt",msgpack_decode_sample("sample") FROM "_sql_stat4" where "idx" = 'I1';<br> - ]], {<br> + string.format([[<br> + SELECT "index_id","neq","nlt","ndlt",msgpack_decode_sample("sample") FROM "_sql_stat4" where "index_id" = %i;<br> + ]], t1.index['I1'].id), {<br> -- <1.2><br> - "T1", "I1", "1 1", "0 0", "0 0", "(0) (0)", "T1", "I1", "1 1", "1 1", "1 1", "(1) (1)", <br> - "T1", "I1", "1 1", "2 2", "2 2", "(2) (2)", "T1", "I1", "1 1", "3 3", "3 3", "(3) (3)", <br> - "T1", "I1", "1 1", "4 4", "4 4", "(4) (4)"<br> + 1, "1 1", "0 0", "0 0", "(0) (0)", 1, "1 1", "1 1", "1 1", "(1) (1)",<br> + 1, "1 1", "2 2", "2 2", "(2) (2)", 1, "1 1", "3 3", "3 3", "(3) (3)",<br> + 1, "1 1", "4 4", "4 4", "(4) (4)"<br> -- </1.2><br> })<br> <br> test:do_execsql_test(<br> 1.3,<br> - [[<br> - SELECT "tbl","idx","neq","nlt","ndlt",msgpack_decode_sample("sample") FROM "_sql_stat4" where "idx" = 'T1';<br> -<br> - ]], {<br> + string.format([[<br> + SELECT "index_id","neq","nlt","ndlt",msgpack_decode_sample("sample") FROM "_sql_stat4" where "index_id" = %i;<br> + ]], t1.index[0].id), {<br> -- <1.3><br> - 'T1', 'T1', '1', '0', '0', '(0)', 'T1', 'T1', '1', '1', '1', '(1)', <br> - 'T1', 'T1', '1', '2', '2', '(2)', 'T1', 'T1', '1', '3', '3', '(3)', <br> - 'T1', 'T1', '1', '4', '4', '(4)'<br> + 0, '1', '0', '0', '(0)', 0, '1', '1', '1', '(1)',<br> + 0, '1', '2', '2', '(2)', 0, '1', '3', '3', '(3)',<br> + 0, '1', '4', '4', '(4)'<br> -- </1.3><br> })<br> <br> @@ -101,10 +101,10 @@ test:do_execsql_test(<br> INSERT INTO t1 VALUES(22.0, 'some text');<br> CREATE INDEX i1 ON t1(a, b);<br> ANALYZE;<br> - SELECT msgpack_decode_sample("sample") FROM "_sql_stat4";<br> + SELECT msgpack_decode_sample("sample") FROM "_sql_stat4" ORDER BY 1;<br> ]], {<br> -- <2.1><br> - "some text 14", "22 some text", "some text", 22<br> + 22, "22 some text", "some text", "some text 14"<br> -- </2.1><br> })<br> <br> @@ -116,6 +116,7 @@ test:do_execsql_test(<br> CREATE TABLE t2(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);<br> CREATE INDEX i2 ON t2(a, b);<br> ]])<br> +t2 = box.space.T2<br> <br> test:do_test(<br> 3.2,<br> @@ -184,10 +185,10 @@ test:do_execsql_test(<br> -- <br> test:do_execsql_test(<br> "3.3.2",<br> - [[<br> + string.format([[<br> ANALYZE;<br> - SELECT lrange("neq", 1, 1) FROM "_sql_stat4" WHERE "idx" = 'I2';<br> - ]], generate_tens_str(24))<br> + SELECT lrange("neq", 1, 1) FROM "_sql_stat4" WHERE "space_id" = %i and "index_id" = %i;<br> + ]], t2.id, t2.index['I2'].id) , generate_tens_str(24))<br> <br> ---------------------------------------------------------------------------<br> -- <br> @@ -232,6 +233,7 @@ test:do_execsql_test(<br> CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c);<br> CREATE INDEX i1 ON t1(c, b, a);<br> ]])<br> +t1 = box.space.T1<br> <br> insert_filler_rows_n = function(iStart, nCopy, nVal)<br> for i = 0, nVal-1 do<br> @@ -282,10 +284,10 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> 4.3,<br> - [[<br> + string.format([[<br> SELECT "neq", lrange("nlt", 1, 3), lrange("ndlt", 1, 3), lrange(msgpack_decode_sample("sample"), 1, 3) <br> - FROM "_sql_stat4" WHERE "idx" = 'I1' ORDER BY "sample" LIMIT 16;<br> - ]], {<br> + FROM "_sql_stat4" WHERE "space_id" = %i and "index_id" = %i ORDER BY "sample" LIMIT 16;<br> + ]], t1.id, t1.index['I1'].id), {<br> -- <4.3><br> "10 10 10","0 0 0","0 0 0","0 0 0","10 10 10","10 10 10","1 1 1","1 1 1","10 10 10","20 20 20",<br> "2 2 2","2 2 2","10 10 10","30 30 30","3 3 3","3 3 3","10 10 10","40 40 40","4 4 4","4 4 4",<br> @@ -299,10 +301,10 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> 4.4,<br> - [[<br> + string.format([[<br> SELECT "neq", lrange("nlt", 1, 3), lrange("ndlt", 1, 3), lrange(msgpack_decode_sample("sample"), 1, 3) <br> - FROM "_sql_stat4" WHERE "idx" = 'I1' ORDER BY "sample" DESC LIMIT 2;<br> - ]], {<br> + FROM "_sql_stat4" WHERE "space_id" = %i and "index_id" = %i ORDER BY "sample" DESC LIMIT 2;<br> + ]], t1.id, t1.index['I1'].id), {<br> -- <4.4><br> "2 1 1","295 296 296","120 122 125","201 4 h","5 3 1","290 290 291","119 119 120","200 1 b"<br> -- </4.4><br> @@ -364,11 +366,12 @@ test:do_test(<br> test:do_execsql_test(<br> 4.9,<br> [[<br> - SELECT msgpack_decode_sample("sample") FROM "_sql_stat4";<br> + SELECT msgpack_decode_sample("sample") FROM "_sql_stat4" ORDER BY 1;<br> ]], {<br> -- <4.9><br> - "x", 1110, 2230, 2750, 3350, 4090, 4470, 4980, 5240, 5280, 5290, 5590, 5920, <br> - 5930, 6220, 6710, 7000, 7710, 7830, 7970, 8890, 8950, 9240, 9250, 9680<br> + 1110, 2230, 2750, 3350, 4090, 4470, 4980, 5240, 5280, 5290, 5590, 5920,<br> + 5930, 6220, 6710, 7000, 7710, 7830, 7970, 8890, 8950, 9240, 9250, 9680,<br> + "x"<br> -- </4.9><br> })<br> <br> @@ -394,6 +397,8 @@ test:do_execsql_test(<br> INSERT INTO "_sql_stat4" SELECT * FROM x1;<br> ANALYZE;<br> ]])<br> +t1 = box.space.T1<br> +x1 = box.space.X1<br> <br> test:do_execsql_test(<br> 6.2,<br> @@ -407,7 +412,7 @@ test:do_execsql_test(<br> --<br> test:do_execsql_test(<br> 7.1,<br> - [[<br> + string.format([[<br> DROP TABLE IF EXISTS t1;<br> CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);<br> CREATE INDEX i1 ON t1(a, b);<br> @@ -418,9 +423,9 @@ test:do_execsql_test(<br> INSERT INTO t1 VALUES(null, 5, 5);<br> ANALYZE;<br> UPDATE "_sql_stat4" SET "sample" = '' WHERE "sample" =<br> - (SELECT "sample" FROM "_sql_stat4" WHERE "tbl" = 't1' AND "idx" = 'i1' LIMIT 1);<br> + (SELECT "sample" FROM "_sql_stat4" WHERE "space_id" = %i AND "index_id" = %i LIMIT 1);<br> ANALYZE;<br> - ]])<br> + ]], t1.id, t1.index['I1'].id))<br> <br> -- Doesn't work due to the fact that in Tarantool rowid has been removed,<br> -- and tbl, idx and sample have been united into primary key.<br> @@ -1014,15 +1019,15 @@ test:do_execsql_test(<br> --<br> test:do_execsql_test(<br> 15.1,<br> - [[<br> + string.format([[<br> DROP TABLE IF EXISTS x1;<br> CREATE TABLE x1(a PRIMARY KEY, b, UNIQUE(a, b));<br> INSERT INTO x1 VALUES(1, 2);<br> INSERT INTO x1 VALUES(3, 4);<br> INSERT INTO x1 VALUES(5, 6);<br> ANALYZE;<br> - INSERT INTO "_sql_stat4" VALUES('x1', 'abc', '', '', '', '');<br> - ]])<br> + INSERT INTO "_sql_stat4" VALUES(%i, 12345, '', '', '', '');<br> + ]], x1.id))<br> <br> test:do_execsql_test(<br> 15.2,<br> @@ -1037,7 +1042,7 @@ test:do_execsql_test(<br> test:do_execsql_test(<br> 15.3,<br> [[<br> - INSERT INTO "_sql_stat4" VALUES('42', '42', '42', '42', '42', 42);<br> + INSERT INTO "_sql_stat4" VALUES(42, 42, '42', '42', '42', 42);<br> ]])<br> <br> test:do_execsql_test(<br> @@ -1054,7 +1059,7 @@ test:do_execsql_test(<br> 15.7,<br> [[<br> ANALYZE;<br> - UPDATE "_sql_stat1" SET "tbl" = 'no such tbl';<br> + UPDATE "_sql_stat1" SET "space_id" = "space_id" + 123456;<br> ]])<br> <br> test:do_execsql_test(<br> @@ -1067,25 +1072,6 @@ test:do_execsql_test(<br> -- </15.8><br> })<br> <br> --- Tarantool: this test seems to be useless. There's no reason<br> --- for these fields to be nullable.<br> --- test:do_execsql_test(<br> --- 15.9,<br> --- [[<br> --- ANALYZE;<br> --- UPDATE "_sql_stat4" SET "neq" = NULL, "nlt" = NULL, "ndlt" = NULL;<br> --- ]])<br> -<br> -test:do_execsql_test(<br> - 15.10,<br> - [[<br> - SELECT * FROM x1;<br> - ]], {<br> - -- <15.10><br> - 1, 2, 3, 4, 5, 6<br> - -- </15.10><br> - })<br> -<br> -- This is just for coverage....<br> test:do_execsql_test(<br> 15.11,<br> @@ -1135,6 +1121,7 @@ test:do_test(<br> -- <17.1><br> -- </17.1><br> })<br> +t1 = box.space.T1<br> <br> test:do_execsql_test(<br> 17.2,<br> @@ -1197,7 +1184,7 @@ test:do_test(<br> test:execsql(string.format("INSERT INTO t1 VALUES(%s, 0);", i))<br> end<br> test:execsql("ANALYZE")<br> - return test:execsql([[ SELECT count(*) FROM "_sql_stat4" WHERE "idx" = 'I1'; ]])<br> + return test:execsql(string.format('SELECT count(*) FROM "_sql_stat4" WHERE "space_id" = %i AND "index_id" = %i;', box.space.T1.id, box.space.T1.index['I1'].id))<br> end, {<br> -- <18.1><br> 9<br> @@ -1239,12 +1226,13 @@ test:do_execsql_test(<br> -- </20.2><br> })<br> <br> +t1 = box.space.T1<br> for i = 0, 15 do<br> test:do_test(<br> "20.3."..i,<br> function()<br> return test:execsql(string.format(<br> - [[SELECT count(*) FROM "_sql_stat4" WHERE "idx" = 'I1' AND lrange(msgpack_decode_sample("sample"), 1, 1) = '%s']], i))<br> + [[SELECT count(*) FROM "_sql_stat4" WHERE "space_id" = %i AND "index_id" = %i AND lrange(msgpack_decode_sample("sample"), 1, 1) = '%s']], t1.id, t1.index['I1'].id, i))<br> end, {<br> 1<br> })<br> diff --git a/test/sql-tap/analyzeC.test.lua b/test/sql-tap/analyzeC.test.lua<br> index a3cea70..e772d71 100755<br> --- a/test/sql-tap/analyzeC.test.lua<br> +++ b/test/sql-tap/analyzeC.test.lua<br> @@ -30,9 +30,7 @@ testprefix = "analyzeC"<br> -- Baseline case. Range queries work OK. Indexes can be used for<br> -- ORDER BY.<br> <br> -test:do_execsql_test(<br> - 1.0,<br> - [[<br> +test:execsql([[<br> DROP TABLE IF EXISTS t1;<br> CREATE TABLE t1(a PRIMARY KEY, b, c, d);<br> INSERT INTO t1(a,b,c,d) VALUES(1,1,2,3),(2,7,8,9),(3,4,5,6),(4,10,11,12),(5,4,8,12),(6,1,11,111);<br> @@ -40,10 +38,17 @@ test:do_execsql_test(<br> CREATE INDEX t1c ON t1(c);<br> ANALYZE;<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1"("tbl","idx","stat") VALUES('t1','t1b','12345 2'),('t1','t1c','12345 4');<br> + ]]<br> +)<br> +t1 = box.space.T1<br> +<br> +test:do_execsql_test(<br> + 1.0,<br> + string.format([[<br> + INSERT INTO "_sql_stat1"("space_id","index_id","stat") VALUES(%i,1,'12345 2'),(%i,2,'12345 4');<br> ANALYZE;<br> SELECT b,c,d, '#' FROM t1 WHERE b BETWEEN 3 AND 8 ORDER BY d;<br> - ]], {<br> + ]], t1.id, t1.id), {<br> -- <1.0><br> 4, 5, 6, "#", 7, 8, 9, "#", 4, 8, 12, "#"<br> -- </1.0><br> @@ -85,11 +90,12 @@ test:do_execsql_test(<br> --<br> test:do_execsql_test(<br> 2.0,<br> + string.format(<br> [[<br> - UPDATE "_sql_stat1" SET "stat"='12345 2 unordered' WHERE "idx"='t1b';<br> + UPDATE "_sql_stat1" SET "stat"='12345 2 unordered' WHERE "index_id"=%i;<br> ANALYZE;<br> SELECT b, c, d, '#' FROM t1 WHERE b BETWEEN 3 AND 8 ORDER BY d;<br> - ]], {<br> + ]], box.space.T1.index['T1B'].id), {<br> -- <2.0><br> 4, 5, 6, "#", 7, 8, 9, "#", 4, 8, 12, "#"<br> -- </2.0><br> @@ -130,11 +136,12 @@ test:do_execsql_test(<br> --<br> test:do_execsql_test(<br> 3.0,<br> + string.format(<br> [[<br> - UPDATE "_sql_stat1" SET "stat"='12345 2 whatever=5 unordered xyzzy=11' WHERE "idx"='t1b';<br> + UPDATE "_sql_stat1" SET "stat"='12345 2 whatever=5 unordered xyzzy=11' WHERE "index_id"=%i;<br> ANALYZE;<br> SELECT b, c, d, '#' FROM t1 WHERE b BETWEEN 3 AND 8 ORDER BY d;<br> - ]], {<br> + ]], box.space.T1.index['T1B'].id), {<br> -- <3.0><br> 4, 5, 6, "#", 7, 8, 9, "#", 4, 8, 12, "#"<br> -- </3.0><br> @@ -173,17 +180,22 @@ test:do_execsql_test(<br> <br> -- The sz=NNN parameter determines which index to scan<br> --<br> -test:do_execsql_test(<br> - 4.0,<br> - [[<br> +<br> +test:execsql([[<br> DROP INDEX t1b ON t1;<br> CREATE INDEX t1bc ON t1(b,c);<br> CREATE INDEX t1db ON t1(d,b);<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1"("tbl","idx","stat") VALUES('t1','t1bc','12345 3 2 sz=10'),('t1','t1db','12345 3 2 sz=20');<br> + ]]<br> +)<br> +<br> +test:do_execsql_test(<br> + 4.0,<br> + string.format([[<br> + INSERT INTO "_sql_stat1"("space_id","index_id","stat") VALUES(%i,%i,'12345 3 2 sz=10'),(%i,%i,'12345 3 2 sz=20');<br> ANALYZE;<br> SELECT count(b) FROM t1;<br> - ]], {<br> + ]], t1.id, t1.index['T1BC'].id, t1.id, t1.index['T1DB'].id), {<br> -- <4.0><br> 6<br> -- </4.0><br> @@ -201,12 +213,13 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> 4.2,<br> + string.format(<br> [[<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1"("tbl","idx","stat") VALUES('t1','t1bc','12345 3 2 sz=20'),('t1','t1db','12345 3 2 sz=10');<br> + INSERT INTO "_sql_stat1"("space_id","index_id","stat") VALUES(%i,%i,'12345 3 2 sz=20'),(%i,%i,'12345 3 2 sz=10');<br> ANALYZE;<br> SELECT count(b) FROM t1;<br> - ]], {<br> + ]], t1.id, t1.index['T1BC'].id, t1.id, t1.index['T1DB'].id), {<br> -- <4.2><br> 6<br> -- </4.2><br> @@ -227,14 +240,14 @@ test:do_execsql_test(<br> --<br> test:do_execsql_test(<br> 5.0,<br> - [[<br> + string.format([[<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1"("tbl","idx","stat")<br> - VALUES('t1','t1bc','12345 3 2 x=5 sz=10 y=10'),<br> - ('t1','t1db','12345 3 2 whatever sz=20 junk');<br> + INSERT INTO "_sql_stat1"("space_id","index_id","stat")<br> + VALUES(%i,%i,'12345 3 2 x=5 sz=10 y=10'),<br> + (%i,%i,'12345 3 2 whatever sz=20 junk');<br> ANALYZE;<br> SELECT count(b) FROM t1;<br> - ]], {<br> + ]], t1.id, t1.index['T1BC'].id, t1.id, t1.index['T1DB'].id), {<br> -- <5.0><br> 6<br> -- </5.0><br> @@ -253,12 +266,12 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> 5.2,<br> - [[<br> + string.format([[<br> DELETE FROM "_sql_stat1";<br> - INSERT INTO "_sql_stat1"("tbl","idx","stat") VALUES('t1','t1db','12345 3 2 x=5 sz=10 y=10'), ('t1','t1bc','12345 3 2 whatever sz=20 junk');<br> + INSERT INTO "_sql_stat1"("space_id","index_id","stat") VALUES(%i,%i,'12345 3 2 x=5 sz=10 y=10'), (%i,%i,'12345 3 2 whatever sz=20 junk');<br> ANALYZE;<br> SELECT count(b) FROM t1;<br> - ]], {<br> + ]], t1.id, t1.index['T1BC'].id, t1.id, t1.index['T1DB'].id), {<br> -- <5.2><br> 6<br> -- </5.2><br> diff --git a/test/sql-tap/analyzeD.test.lua b/test/sql-tap/analyzeD.test.lua<br> index ef6aced..9d89933 100755<br> --- a/test/sql-tap/analyzeD.test.lua<br> +++ b/test/sql-tap/analyzeD.test.lua<br> @@ -153,9 +153,9 @@ test:do_catchsql_test(<br> <br> test:do_execsql_test(<br> "analyzeD-1.10",<br> - [[<br> - SELECT * FROM "_sql_stat4" WHERE "tbl" = 'v';<br> - ]], {<br> + string.format([[<br> + SELECT * FROM "_sql_stat4" WHERE "space_id" = %i;<br> + ]], box.space.V.id), {<br> -- <analyzeD-1.10><br> <br> -- <analyzeD-1.10><br> @@ -163,9 +163,9 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> "analyzeD-1.11",<br> - [[<br> - SELECT * FROM "_sql_stat1" WHERE "tbl" = 'v';<br> - ]], {<br> + string.format([[<br> + SELECT * FROM "_sql_stat1" WHERE "space_id" = %i;<br> + ]], box.space.V.id), {<br> -- <analyzeD-1.11><br> <br> -- <analyzeD-1.11><br> @@ -183,9 +183,9 @@ test:do_catchsql_test(<br> <br> test:do_execsql_test(<br> "analyzeD-1.13",<br> - [[<br> - SELECT * FROM "_sql_stat4" WHERE "tbl" = 'v';<br> - ]], {<br> + string.format([[<br> + SELECT * FROM "_sql_stat4" WHERE "space_id" = %i;<br> + ]], box.space.V.id), {<br> -- <analyzeD-1.13><br> <br> -- <analyzeD-1.13><br> @@ -193,9 +193,9 @@ test:do_execsql_test(<br> <br> test:do_execsql_test(<br> "analyzeD-1.14",<br> - [[<br> - SELECT * FROM "_sql_stat1" WHERE "tbl" = 'v';<br> - ]], {<br> + string.format([[<br> + SELECT * FROM "_sql_stat1" WHERE "space_id" = %i;<br> + ]], box.space.V.id), {<br> -- <analyzeD-1.14><br> <br> -- <analyzeD-1.14><br> diff --git a/test/sql-tap/gh-3350-skip-scan.test.lua b/test/sql-tap/gh-3350-skip-scan.test.lua<br> index 301b04a..917c74c 100755<br> --- a/test/sql-tap/gh-3350-skip-scan.test.lua<br> +++ b/test/sql-tap/gh-3350-skip-scan.test.lua<br> @@ -77,9 +77,7 @@ test:do_execsql_test(<br> }<br> )<br> <br> -test:do_execsql_test(<br> - "skip-scan-1.4",<br> - [[<br> +test:execsql([[<br> DROP TABLE IF EXISTS t1;<br> CREATE TABLE t1(id INTEGER PRIMARY KEY, a TEXT, b INT, c INT, d INT);<br> CREATE INDEX t1abc ON t1(a,b,c);<br> @@ -96,10 +94,17 @@ test:do_execsql_test(<br> ANALYZE;<br> DELETE FROM "_sql_stat1";<br> DELETE FROM "_sql_stat4";<br> - INSERT INTO "_sql_stat1" VALUES('T1','T1ABC','10000 5000 2000 10');<br> + ]]<br> +)<br> +<br> +test:do_execsql_test(<br> + "skip-scan-1.4",<br> + string.format(<br> + [[<br> + INSERT INTO "_sql_stat1" VALUES(%i,%i,'10000 5000 2000 10');<br> ANALYZE t2;<br> SELECT a,b,c,d FROM t1 WHERE b=345;<br> - ]], {<br> + ]], box.space.T1.id, box.space.T1.index['T1ABC'].id), {<br> "abc", 345, 7, 8, "def", 345, 9, 10<br> }<br> )<br> diff --git a/test/sql/sql-statN-index-drop.result b/test/sql/sql-statN-index-drop.result<br> index a751eca..8e8a1b2 100644<br> --- a/test/sql/sql-statN-index-drop.result<br> +++ b/test/sql/sql-statN-index-drop.result<br> @@ -31,36 +31,36 @@ box.sql.execute("ANALYZE;")<br> ---<br> ...<br> -- Checking the data.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> ---<br> -- - ['T1', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T1', 'T1', '1', '0', '0', !!binary kQE=]<br> - - ['T2', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T2', 'T2', '1', '0', '0', !!binary kQE=]<br> +- - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> + - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> ...<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> ---<br> -- - ['T1', 'I1', '1 1']<br> - - ['T1', 'T1', '1 1']<br> - - ['T2', 'I1', '1 1']<br> - - ['T2', 'T2', '1 1']<br> +- - [0, '1 1']<br> + - [1, '1 1']<br> + - [0, '1 1']<br> + - [1, '1 1']<br> ...<br> -- Dropping an index.<br> box.sql.execute("DROP INDEX i1 ON t1;")<br> ---<br> ...<br> -- Checking the DROP INDEX results.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> ---<br> -- - ['T1', 'T1', '1', '0', '0', !!binary kQE=]<br> - - ['T2', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T2', 'T2', '1', '0', '0', !!binary kQE=]<br> +- - [0, '1', '0', '0', !!binary kQE=]<br> + - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> ...<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> ---<br> -- - ['T1', 'T1', '1 1']<br> - - ['T2', 'I1', '1 1']<br> - - ['T2', 'T2', '1 1']<br> +- - [0, '1 1']<br> + - [0, '1 1']<br> + - [1, '1 1']<br> ...<br> --Cleaning up.<br> box.sql.execute("DROP TABLE t1;")<br> @@ -93,36 +93,36 @@ box.sql.execute("ANALYZE;")<br> ---<br> ...<br> -- Checking the data.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> ---<br> -- - ['T1', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T1', 'T1', '1', '0', '0', !!binary kQE=]<br> - - ['T2', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T2', 'T2', '1', '0', '0', !!binary kQE=]<br> +- - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> + - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> ...<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> ---<br> -- - ['T1', 'I1', '1 1']<br> - - ['T1', 'T1', '1 1']<br> - - ['T2', 'I1', '1 1']<br> - - ['T2', 'T2', '1 1']<br> +- - [0, '1 1']<br> + - [1, '1 1']<br> + - [0, '1 1']<br> + - [1, '1 1']<br> ...<br> -- Dropping an index.<br> box.sql.execute("DROP INDEX i1 ON t2;")<br> ---<br> ...<br> -- Checking the DROP INDEX results.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> ---<br> -- - ['T1', 'I1', '1', '0', '0', !!binary kQI=]<br> - - ['T1', 'T1', '1', '0', '0', !!binary kQE=]<br> - - ['T2', 'T2', '1', '0', '0', !!binary kQE=]<br> +- - [0, '1', '0', '0', !!binary kQE=]<br> + - [1, '1', '0', '0', !!binary kQI=]<br> + - [0, '1', '0', '0', !!binary kQE=]<br> ...<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> ---<br> -- - ['T1', 'I1', '1 1']<br> - - ['T1', 'T1', '1 1']<br> - - ['T2', 'T2', '1 1']<br> +- - [0, '1 1']<br> + - [1, '1 1']<br> + - [0, '1 1']<br> ...<br> --Cleaning up.<br> box.sql.execute("DROP TABLE t1;")<br> diff --git a/test/sql/sql-statN-index-drop.test.lua b/test/sql/sql-statN-index-drop.test.lua<br> index fe7e15b..af13c8c 100644<br> --- a/test/sql/sql-statN-index-drop.test.lua<br> +++ b/test/sql/sql-statN-index-drop.test.lua<br> @@ -14,15 +14,15 @@ box.sql.execute("INSERT INTO t2 VALUES(1, 2);")<br> box.sql.execute("ANALYZE;")<br> <br> -- Checking the data.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> <br> -- Dropping an index.<br> box.sql.execute("DROP INDEX i1 ON t1;")<br> <br> -- Checking the DROP INDEX results.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> <br> --Cleaning up.<br> box.sql.execute("DROP TABLE t1;")<br> @@ -41,15 +41,15 @@ box.sql.execute("INSERT INTO t2 VALUES(1, 2);")<br> box.sql.execute("ANALYZE;")<br> <br> -- Checking the data.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> <br> -- Dropping an index.<br> box.sql.execute("DROP INDEX i1 ON t2;")<br> <br> -- Checking the DROP INDEX results.<br> -box.sql.execute("SELECT * FROM \"_sql_stat4\";")<br> -box.sql.execute("SELECT * FROM \"_sql_stat1\";")<br> +box.sql.execute('SELECT "index_id","neq","nlt","ndlt","sample" FROM "_sql_stat4";')<br> +box.sql.execute('SELECT "index_id","stat" FROM "_sql_stat1";')<br> <br> --Cleaning up.<br> box.sql.execute("DROP TABLE t1;")<br> diff --git a/test/sql/upgrade.result b/test/sql/upgrade.result<br> index 5e7d851..9326209 100644<br> --- a/test/sql/upgrade.result<br> +++ b/test/sql/upgrade.result<br> @@ -30,14 +30,15 @@ box.space._space.index['name']:get('_trigger')<br> ...<br> box.space._space.index['name']:get('_sql_stat1')<br> ---<br> -- [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'stat', 'type': 'string'}]]<br> +- [348, 1, '_sql_stat1', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'stat', 'type': 'string'}]]<br> ...<br> box.space._space.index['name']:get('_sql_stat4')<br> ---<br> -- [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'tbl', 'type': 'string'}, {'name': 'idx',<br> - 'type': 'string'}, {'name': 'neq', 'type': 'string'}, {'name': 'nlt', 'type': 'string'},<br> - {'name': 'ndlt', 'type': 'string'}, {'name': 'sample', 'type': 'scalar'}]]<br> +- [349, 1, '_sql_stat4', 'memtx', 0, {}, [{'name': 'space_id', 'type': 'unsigned'},<br> + {'name': 'index_id', 'type': 'unsigned'}, {'name': 'neq', 'type': 'string'}, {<br> + 'name': 'nlt', 'type': 'string'}, {'name': 'ndlt', 'type': 'string'}, {'name': 'sample',<br> + 'type': 'scalar'}]]<br> ...<br> box.space._index:get({box.space._space.index['name']:get('_trigger').id, 0})<br> ---<br> @@ -45,12 +46,12 @@ box.space._index:get({box.space._space.index['name']:get('_trigger').id, 0})<br> ...<br> box.space._index:get({box.space._space.index['name']:get('_sql_stat1').id, 0})<br> ---<br> -- [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string']]]<br> +- [348, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned']]]<br> ...<br> box.space._index:get({box.space._space.index['name']:get('_sql_stat4').id, 0})<br> ---<br> -- [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'string'], [1, 'string'], [5,<br> - 'scalar']]]<br> +- [349, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned'], [1, 'unsigned'],<br> + [5, 'scalar']]]<br> ...<br> box.space._schema:format()<br> ---<br></BODY></HTML>