From 9c57024f8b53f358cb07a6cf18d8c3270157b34c Mon Sep 17 00:00:00 2001 From: Feng Liyuan Date: Wed, 17 Jun 2020 19:16:25 +0800 Subject: [PATCH 1/2] sql-statements: update create view and drop view --- sql-statements/sql-statement-create-view.md | 5 ++++- sql-statements/sql-statement-drop-table.md | 3 --- sql-statements/sql-statement-drop-view.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql-statements/sql-statement-create-view.md b/sql-statements/sql-statement-create-view.md index 5e574c57444e6..df5894c960a2b 100644 --- a/sql-statements/sql-statement-create-view.md +++ b/sql-statements/sql-statement-create-view.md @@ -98,10 +98,13 @@ ERROR 1105 (HY000): insert into view v1 is not supported now. ## MySQL compatibility -* Views in TiDB are not currently insertable or updatable. +* At present, any view in TiDB cannot be inserted or updated (that is, INSERT VIEW and UPDATE VIEW are not supported). `WITH CHECK OPTION` only does syntax compatibility but does not take effect. +* Currently, the view in TiDB does not support `ALTER VIEW`, but you can use `CREATE OR REPLACE` instead. +* Currently, the `ALGORITHM` field is only syntactically compatible in TiDB but does not take effect. TiDB currently only supports the MERGE algorithm. ## See also +* [DROP VIEW](/sql-statements/sql-statement-drop-view.md) * [CREATE TABLE](/sql-statements/sql-statement-create-table.md) * [SHOW CREATE TABLE](/sql-statements/sql-statement-show-create-table.md) * [DROP TABLE](/sql-statements/sql-statement-drop-table.md) diff --git a/sql-statements/sql-statement-drop-table.md b/sql-statements/sql-statement-drop-table.md index df76d3a672e9b..c12d21100a7a9 100644 --- a/sql-statements/sql-statement-drop-table.md +++ b/sql-statements/sql-statement-drop-table.md @@ -9,8 +9,6 @@ aliases: ['/docs/dev/reference/sql/statements/drop-table/'] This statement drops a table from the currently selected database. An error is returned if the table does not exist, unless the `IF EXISTS` modifier is used. -By design `DROP TABLE` will also drop views, as they share the same namespace as tables. - ## Synopsis **DropTableStmt:** @@ -52,7 +50,6 @@ Query OK, 0 rows affected (0.23 sec) ## See also -* [DROP VIEW](/sql-statements/sql-statement-drop-view.md) * [CREATE TABLE](/sql-statements/sql-statement-create-table.md) * [SHOW CREATE TABLE](/sql-statements/sql-statement-show-create-table.md) * [SHOW TABLES](/sql-statements/sql-statement-show-tables.md) diff --git a/sql-statements/sql-statement-drop-view.md b/sql-statements/sql-statement-drop-view.md index 565cab3f71f9b..c13ac25c6259d 100644 --- a/sql-statements/sql-statement-drop-view.md +++ b/sql-statements/sql-statement-drop-view.md @@ -80,5 +80,5 @@ This statement is understood to be fully compatible with MySQL. Any compatibilit ## See also -* [DROP TABLE](/sql-statements/sql-statement-drop-table.md) * [CREATE VIEW](/sql-statements/sql-statement-create-view.md) +* [DROP TABLE](/sql-statements/sql-statement-drop-table.md) From 1963dbed041b2a27b43ca1217266844bf600af61 Mon Sep 17 00:00:00 2001 From: Feng Liyuan Date: Wed, 17 Jun 2020 19:28:33 +0800 Subject: [PATCH 2/2] Update sql-statements/sql-statement-create-view.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- sql-statements/sql-statement-create-view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-view.md b/sql-statements/sql-statement-create-view.md index df5894c960a2b..0bae2df6c5424 100644 --- a/sql-statements/sql-statement-create-view.md +++ b/sql-statements/sql-statement-create-view.md @@ -98,7 +98,7 @@ ERROR 1105 (HY000): insert into view v1 is not supported now. ## MySQL compatibility -* At present, any view in TiDB cannot be inserted or updated (that is, INSERT VIEW and UPDATE VIEW are not supported). `WITH CHECK OPTION` only does syntax compatibility but does not take effect. +* Currently, any view in TiDB cannot be inserted or updated (that is, `INSERT VIEW` and `UPDATE VIEW` are not supported). `WITH CHECK OPTION` is only syntactically compatible but does not take effect. * Currently, the view in TiDB does not support `ALTER VIEW`, but you can use `CREATE OR REPLACE` instead. * Currently, the `ALGORITHM` field is only syntactically compatible in TiDB but does not take effect. TiDB currently only supports the MERGE algorithm.