summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_mysql.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:12:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:12:52 +0000
commita1f10f8d39404d9bae42a64efaf505fa12f34c1a (patch)
tree9eb894268f2a145aa9d42b1726a555ab1359810f /tests/dialects/test_mysql.py
parentAdding upstream version 25.8.1. (diff)
downloadsqlglot-upstream/25.16.1.tar.xz
sqlglot-upstream/25.16.1.zip
Adding upstream version 25.16.1.upstream/25.16.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_mysql.py')
-rw-r--r--tests/dialects/test_mysql.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dialects/test_mysql.py b/tests/dialects/test_mysql.py
index 65b4c4a..c598cb5 100644
--- a/tests/dialects/test_mysql.py
+++ b/tests/dialects/test_mysql.py
@@ -24,6 +24,18 @@ class TestMySQL(Validator):
self.validate_identity("ALTER TABLE t ADD INDEX `i` (`c`)")
self.validate_identity("ALTER TABLE t ADD UNIQUE `i` (`c`)")
self.validate_identity("ALTER TABLE test_table MODIFY COLUMN test_column LONGTEXT")
+ self.validate_identity("ALTER VIEW v AS SELECT a, b, c, d FROM foo")
+ self.validate_identity("ALTER VIEW v AS SELECT * FROM foo WHERE c > 100")
+ self.validate_identity(
+ "ALTER ALGORITHM = MERGE VIEW v AS SELECT * FROM foo", check_command_warning=True
+ )
+ self.validate_identity(
+ "ALTER DEFINER = 'admin'@'localhost' VIEW v AS SELECT * FROM foo",
+ check_command_warning=True,
+ )
+ self.validate_identity(
+ "ALTER SQL SECURITY = DEFINER VIEW v AS SELECT * FROM foo", check_command_warning=True
+ )
self.validate_identity(
"INSERT INTO things (a, b) VALUES (1, 2) AS new_data ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), a = new_data.a, b = new_data.b"
)