Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH v1 1/1] sql: ban ANALYZE statement
@ 2019-03-22 16:14 imeevma
  2019-03-22 16:58 ` [tarantool-patches] " n.pettik
  2019-03-26 10:27 ` Kirill Yukhin
  0 siblings, 2 replies; 6+ messages in thread
From: imeevma @ 2019-03-22 16:14 UTC (permalink / raw)
  To: korablev; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-26 10:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 16:14 [tarantool-patches] [PATCH v1 1/1] sql: ban ANALYZE statement imeevma
2019-03-22 16:58 ` [tarantool-patches] " n.pettik
2019-03-23 12:58   ` Mergen Imeev
2019-03-23 19:13     ` n.pettik
2019-03-25 16:30       ` Imeev Mergen
2019-03-26 10:27 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox