<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">If you decided to send patch v2, you should specify it:</div><div class="">git format-patch <span style="font-family: HelveticaNeue;" class="">--subject-prefix='PATCH v2</span><font face="HelveticaNeue" class="">’</font></div><div class=""><span style="font-family: HelveticaNeue;" class=""><br class=""></span></div><div class=""><span style="font-family: HelveticaNeue;" class="">Moreover, as a rule if you send patch v2,</span></div><div class=""><span style="font-family: HelveticaNeue;" class="">you should add brief </span><font face="HelveticaNeue" class="">change log.</font></div><div class=""><br class=""></div><div class="">Overall, patch seems to be OK, except for very minor remark:</div><div class="">please, deal with your IDE or text editor to avoid extra diffs</div><div class="">due to wrong indentation.</div><div class=""><br class=""></div><div class="">You can update remotely your branch and send only diff</div><div class="">in reply to this message.</div><br class=""><div><blockquote type="cite" class=""><div class="">On 27 Mar 2018, at 19:02, N.Tatunov <<a href="mailto:hollow653@gmail.com" class="">hollow653@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">From: Hollow <<a href="mailto:hollow653@gmail.com" class="">hollow653@gmail.com</a>><br class=""><br class="">Required to fix the following message:<br class=""><br class="">"- error: expressions prohibited in PRIMARY KEY and UNIQUE constraints"<br class=""><br class="">Currently this message appears even when user tries to CREATE<br class="">non-unique functional index which isn't concerned with the<br class="">following error message. Thus far the message was corrected<br class="">to the proper one.<br class=""><br class="">Closes #3236<br class="">---<br class=""><br class="">Branch: <a href="https://github.com/tarantool/tarantool" class="">https://github.com/tarantool/tarantool</a><br class="">Issue: <a href="https://github.com/tarantool/tarantool/issues/3236" class="">https://github.com/tarantool/tarantool/issues/3236</a><br class=""><br class=""> src/box/sql/build.c                    |  8 +++----<br class=""> test/sql-tap/colname.test.lua          |  4 ++--<br class=""> test/sql/message-func-indexes.result   | 41 ++++++++++++++++++++++++++++++++++<br class=""> test/sql/message-func-indexes.test.lua | 18 +++++++++++++++<br class=""> 4 files changed, 65 insertions(+), 6 deletions(-)<br class=""> create mode 100644 test/sql/message-func-indexes.result<br class=""> create mode 100644 test/sql/message-func-indexes.test.lua<br class=""><br class="">diff --git a/src/box/sql/build.c b/src/box/sql/build.c<br class="">index dd0f45c..c7f6b3c 100644<br class="">--- a/src/box/sql/build.c<br class="">+++ b/src/box/sql/build.c<br class="">@@ -1802,7 +1802,7 @@ emitNewSysSpaceSequenceRecord(Parse *pParse, int space_id, const char reg_seq_id<br class=""><br class=""> <span class="Apple-tab-span" style="white-space:pre">      </span>/* 1. Space id  */<br class=""> <span class="Apple-tab-span" style="white-space:pre">       </span>sqlite3VdbeAddOp2(v, OP_SCopy, space_id, first_col + 1);<br class="">-<span class="Apple-tab-span" style="white-space:pre">      </span><br class="">+    <br class=""></div></div></blockquote><div><br class=""></div><div>Still redundant diff. Please check it carefully and don’t hurry.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>/* 2. Sequence id  */<br class=""> <span class="Apple-tab-span" style="white-space:pre">    </span>sqlite3VdbeAddOp2(v, OP_IntCopy, reg_seq_id, first_col + 2);<br class=""><br class="">@@ -2015,7 +2015,7 @@ sqlite3EndTable(Parse * pParse,<span class="Apple-tab-span" style="white-space:pre"> </span>/* Parse context */<br class=""><br class=""> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>sqlite3OpenTable(pParse, iCursor, sys_space_sequence,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span> OP_OpenWrite);<br class="">-<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><br class="">+            <br class=""></div></div></blockquote><div><br class=""></div><div>The same: redundant diff.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>reg_space_seq_record = emitNewSysSpaceSequenceRecord(<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>pParse,<br class=""> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>iSpaceId,<br class="">@@ -3065,8 +3065,8 @@ sqlite3CreateIndex(Parse * pParse,<span class="Apple-tab-span" style="white-space:pre">      </span>/* All information about this parse */<br class=""> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>pCExpr = sqlite3ExprSkipCollate(pListItem->pExpr);<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>if (pCExpr->op != TK_COLUMN) {<br class=""> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>sqlite3ErrorMsg(pParse,<br class="">-<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>"expressions prohibited in PRIMARY KEY and "<br class="">-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>"UNIQUE constraints");<br class="">+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>"functional indexes aren't supported "<br class="">+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>"in the current version");<br class=""> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>goto exit_create_index;<br class=""> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>} else {<br class=""> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>j = pCExpr->iColumn;<br class="">diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua<br class="">index 71010da..c96623e 100755<br class="">--- a/test/sql-tap/colname.test.lua<br class="">+++ b/test/sql-tap/colname.test.lua<br class="">@@ -643,13 +643,13 @@ test:do_catchsql_test(<br class="">     "colname-11.2",<br class="">     [[CREATE TABLE t1(a, b, c, d, e, <br class="">       PRIMARY KEY(a), UNIQUE('b' COLLATE "unicode_ci" DESC));]],<br class="">-    {1, "/expressions prohibited in PRIMARY KEY/"})<br class="">+    {1, "/functional indexes aren't supported in the current version/"})<br class=""><br class=""> test:execsql("create table table1(a primary key, b, c)")<br class=""><br class=""> test:do_catchsql_test(<br class="">     "colname-11.3",<br class="">     [[ CREATE INDEX t1c ON table1('c'); ]],<br class="">-    {1, "/expressions prohibited in PRIMARY KEY/"})<br class="">+    {1, "/functional indexes aren't supported in the current version/"})<br class=""><br class=""> test:finish_test()<br class="">diff --git a/test/sql/message-func-indexes.result b/test/sql/message-func-indexes.result<br class="">new file mode 100644<br class="">index 0000000..797cf28<br class="">--- /dev/null<br class="">+++ b/test/sql/message-func-indexes.result<br class="">@@ -0,0 +1,41 @@<br class="">+test_run = require('test_run').new()<br class="">+---<br class="">+...<br class="">+-- Creating tables.<br class="">+box.sql.execute("CREATE TABLE t1(id INTEGER PRIMARY KEY, a INTEGER)")<br class="">+---<br class="">+...<br class="">+box.sql.execute("CREATE TABLE t2(object INTEGER PRIMARY KEY, price INTEGER, count INTEGER)")<br class="">+---<br class="">+...<br class="">+-- Expressions that're supposed to create functional indexes<br class="">+-- should return certain message.<br class="">+box.sql.execute("CREATE INDEX i1 ON t1(a+1)")<br class="">+---<br class="">+- error: functional indexes aren't supported in the current version<br class="">+...<br class="">+box.sql.execute("CREATE INDEX i2 ON t1(a)")<br class="">+---<br class="">+...<br class="">+box.sql.execute("CREATE INDEX i3 ON t2(price + 100)")<br class="">+---<br class="">+- error: functional indexes aren't supported in the current version<br class="">+...<br class="">+box.sql.execute("CREATE INDEX i4 ON t2(price)")<br class="">+---<br class="">+...<br class="">+box.sql.execute("CREATE INDEX i5 ON t2(count + 1)")<br class="">+---<br class="">+- error: functional indexes aren't supported in the current version<br class="">+...<br class="">+box.sql.execute("CREATE INDEX i6 ON t2(count * price)")<br class="">+---<br class="">+- error: functional indexes aren't supported in the current version<br class="">+...<br class="">+-- Cleaning up.<br class="">+box.sql.execute("DROP TABLE t1")<br class="">+---<br class="">+...<br class="">+box.sql.execute("DROP TABLE t2") <br class="">+---<br class="">+...<br class="">diff --git a/test/sql/message-func-indexes.test.lua b/test/sql/message-func-indexes.test.lua<br class="">new file mode 100644<br class="">index 0000000..fac715b<br class="">--- /dev/null<br class="">+++ b/test/sql/message-func-indexes.test.lua<br class="">@@ -0,0 +1,18 @@<br class="">+test_run = require('test_run').new()<br class="">+<br class="">+-- Creating tables.<br class="">+box.sql.execute("CREATE TABLE t1(id INTEGER PRIMARY KEY, a INTEGER)")<br class="">+box.sql.execute("CREATE TABLE t2(object INTEGER PRIMARY KEY, price INTEGER, count INTEGER)")<br class="">+<br class="">+-- Expressions that're supposed to create functional indexes<br class="">+-- should return certain message.<br class="">+box.sql.execute("CREATE INDEX i1 ON t1(a+1)")<br class="">+box.sql.execute("CREATE INDEX i2 ON t1(a)")<br class="">+box.sql.execute("CREATE INDEX i3 ON t2(price + 100)")<br class="">+box.sql.execute("CREATE INDEX i4 ON t2(price)")<br class="">+box.sql.execute("CREATE INDEX i5 ON t2(count + 1)")<br class="">+box.sql.execute("CREATE INDEX i6 ON t2(count * price)")<br class="">+<br class="">+-- Cleaning up.<br class="">+box.sql.execute("DROP TABLE t1")<br class="">+box.sql.execute("DROP TABLE t2") <br class="">-- <br class="">2.7.4<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></body></html>