From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EA7D42AD1B for ; Fri, 22 Mar 2019 12:14:05 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ihvOmJa1stgQ for ; Fri, 22 Mar 2019 12:14:05 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 947712ACEA for ; Fri, 22 Mar 2019 12:14:05 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 1/1] sql: ban ANALYZE statement Date: Fri, 22 Mar 2019 19:14:03 +0300 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: korablev@tarantool.org Cc: tarantool-patches@freelists.org At this point, an ANALYZE statement can lead to many problems. It was decided to temporarily ban this statement. Closes #4069 --- https://github.com/tarantool/tarantool/issues/4069 https://github.com/tarantool/tarantool/tree/imeevma/gh-4069-ban-analyze src/box/box.cc | 2 -- src/box/sql/parse.y | 4 ++-- src/box/sql/sqlInt.h | 1 - test/sql-tap/suite.ini | 12 ++++++++++++ test/sql-tap/whereG.test.lua | 6 ++++-- test/sql/suite.ini | 1 + 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index f7ce33a..7d89055 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -2139,8 +2139,6 @@ box_cfg_xc(void) /* Follow replica */ replicaset_follow(); - sql_load_schema(); - fiber_gc(); is_box_configured = true; diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y index b27651c..03787d9 100644 --- a/src/box/sql/parse.y +++ b/src/box/sql/parse.y @@ -1448,8 +1448,8 @@ cmd ::= DROP TRIGGER ifexists(NOERR) fullname(X). { } /////////////////////////////////// ANALYZE /////////////////////////////////// -cmd ::= ANALYZE. {sqlAnalyze(pParse, 0);} -cmd ::= ANALYZE nm(X). {sqlAnalyze(pParse, &X);} +cmd ::= ANALYZE. {} +cmd ::= ANALYZE nm(X). {(void)X;} //////////////////////// ALTER TABLE table ... //////////////////////////////// cmd ::= ALTER TABLE fullname(X) RENAME TO nm(Z). { diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 8967ea3..aebd131 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -4492,7 +4492,6 @@ char* rename_trigger(sql *, char const *, char const *, bool *); */ struct coll * sql_get_coll_seq(Parse *parser, const char *name, uint32_t *coll_id); -void sqlAnalyze(Parse *, Token *); /** * This function returns average size of tuple in given index. diff --git a/test/sql-tap/suite.ini b/test/sql-tap/suite.ini index bb49289..95207f4 100644 --- a/test/sql-tap/suite.ini +++ b/test/sql-tap/suite.ini @@ -8,6 +8,18 @@ disabled = selectA.test.lua ; date.test.lua ; tkt-bd484a090c.test.lua ; tkt3791.test.lua ; + analyze1.test.lua ; + analyze3.test.lua ; + analyze4.test.lua ; + analyze5.test.lua ; + analyze6.test.lua ; + analyze7.test.lua ; + analyze8.test.lua ; + analyze9.test.lua ; + analyzeC.test.lua ; + analyzeD.test.lua ; + analyzeE.test.lua ; + analyzeF.test.lua ; lua_libs = lua/sqltester.lua ../sql/lua/sql_tokenizer.lua ../box/lua/identifier.lua is_parallel = True diff --git a/test/sql-tap/whereG.test.lua b/test/sql-tap/whereG.test.lua index 155c906..bb9cf39 100755 --- a/test/sql-tap/whereG.test.lua +++ b/test/sql-tap/whereG.test.lua @@ -452,7 +452,9 @@ test:do_execsql_test( ANALYZE; EXPLAIN QUERY PLAN SELECT name FROM people WHERE height>=180; ]], - {0,0,0,"SEARCH TABLE PEOPLE USING COVERING INDEX PEOPLE_IDX1" .. - " (ANY(ROLE) AND HEIGHT>?)"}) + -- {0,0,0,"SEARCH TABLE PEOPLE USING COVERING INDEX PEOPLE_IDX1" .. + -- " (ANY(ROLE) AND HEIGHT>?)"} + {0,0,0,"SCAN TABLE PEOPLE" } + ) test:finish_test() diff --git a/test/sql/suite.ini b/test/sql/suite.ini index ce6ccb7..bfe0fa0 100644 --- a/test/sql/suite.ini +++ b/test/sql/suite.ini @@ -7,3 +7,4 @@ config = engine.cfg is_parallel = True lua_libs = lua/sql_tokenizer.lua release_disabled = errinj.test.lua view_delayed_wal.test.lua sql-debug.test.lua +disabled = sql-statN-index-drop.test.lua -- 2.7.4