summaryrefslogtreecommitdiff
path: root/mysql-test/t/skip_grants.test
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2006-03-07 14:28:09 +0300
committerunknown <anozdrin@mysql.com>2006-03-07 14:28:09 +0300
commit99515a3ac8632c942979a24d79bbbec922e03f67 (patch)
treef377d746ddd3a559f6c8a1d2237fbeb30cd08efa /mysql-test/t/skip_grants.test
parent07d36fb99a4b9419f60d4c09efc7e6c3fde0051c (diff)
parent3dd927cf1cf4f666d55144862e52e9479fe6c4ff (diff)
downloadmariadb-git-99515a3ac8632c942979a24d79bbbec922e03f67.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.0-rt mysql-test/r/sp.result: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/skip_grants.result: Merge 5.0 and 5.0-runtime. mysql-test/t/skip_grants.test: Merge 5.0 and 5.0-runtime.
Diffstat (limited to 'mysql-test/t/skip_grants.test')
-rw-r--r--mysql-test/t/skip_grants.test53
1 files changed, 45 insertions, 8 deletions
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 27220c9b507..93e052d8c71 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -9,14 +9,6 @@ drop procedure if exists f1;
use test;
#
-# test that we can create VIEW if privileges check switched off
-#
-create table t1 (field1 INT);
--- error ER_MALFORMED_DEFINER
-CREATE VIEW v1 AS SELECT field1 FROM t1;
-drop table t1;
-
-#
# Test that we can create and drop procedure without warnings
# see bug#9993
#
@@ -33,3 +25,48 @@ drop table t1;
# BUG#17595: DROP FUNCTION IF EXISTS f1 crashes server
drop function if exists f1;
+
+#
+# BUG#16777: Can not create trigger nor view w/o definer if --skip-grant-tables
+# specified
+#
+# Also, a test that we can create VIEW if privileges check switched off has
+# been moved here.
+#
+
+# Prepare.
+
+--disable_warnings
+
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v2;
+
+DROP TABLE IF EXISTS t1;
+
+--enable_warnings
+
+# Test case.
+
+CREATE TABLE t1(c INT);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+ FOR EACH ROW
+ SET @a = 1;
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE DEFINER=a@b TRIGGER ti_ai AFTER INSERT ON t1
+ FOR EACH ROW
+ SET @b = 1;
+
+CREATE DEFINER=a@b VIEW v2 AS SELECT * FROM t1;
+
+# Cleanup.
+
+DROP TRIGGER t1_bi;
+DROP TRIGGER ti_ai;
+
+DROP VIEW v1;
+DROP VIEW v2;
+
+DROP TABLE t1;