summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorkostja@bodhi.local <>2006-08-30 00:45:33 +0400
committerkostja@bodhi.local <>2006-08-30 00:45:33 +0400
commitf8d34e10300ccf987bc8461a9581a7d5cfadcb29 (patch)
tree55ee75a4f6e2dfc6ac630c5e0f0e66445bae20fb /mysql-test/t/view.test
parent4761ea5c82d9b843aba9ee1fb0a889a1237e6fbd (diff)
parent3bf609b7f2b73555b1e241dc7c354818b0bbbc5a (diff)
downloadmariadb-git-f8d34e10300ccf987bc8461a9581a7d5cfadcb29.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into bodhi.local:/opt/local/work/mysql-5.0-14897
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test72
1 files changed, 72 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index fae3f856cb8..5ae4ec8bbfa 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2715,10 +2715,81 @@ DROP VIEW t1,v1;
SHOW TABLES;
DROP TABLE t1;
+
+
+#
+# Test for BUG#16899: Possible buffer overflow in handling of DEFINER-clause.
+#
+
+# Prepare.
+
--disable_warnings
+DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v2;
+--enable_warnings
+
+CREATE TABLE t1(a INT, b INT);
+
+--error ER_WRONG_STRING_LENGTH
+CREATE DEFINER=1234567890abcdefGHIKL@localhost
+ VIEW v1 AS SELECT a FROM t1;
+
+--error ER_WRONG_STRING_LENGTH
+CREATE DEFINER=some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY
+ VIEW v2 AS SELECT b FROM t1;
+
+# Cleanup.
+
+DROP TABLE t1;
+
+
+#
+# BUG#17591: Updatable view not possible with trigger or stored
+# function
+#
+# During prelocking phase we didn't update lock type of view tables,
+# hence READ lock was always requested.
+#
+--disable_warnings
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP VIEW IF EXISTS v1, v2;
+DROP TABLE IF EXISTS t1;
--enable_warnings
+CREATE TABLE t1 (i INT);
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ INSERT INTO v1 VALUES (0);
+ RETURN 0;
+END |
+delimiter ;|
+
+SELECT f1();
+
+CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t1;
+
+delimiter |;
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+ INSERT INTO v2 VALUES (0);
+ RETURN 0;
+END |
+delimiter ;|
+
+--error ER_NON_UPDATABLE_TABLE
+SELECT f2();
+
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP VIEW v1, v2;
+DROP TABLE t1;
+
#
# Bug #21261: Wrong access rights was required for an insert to a view
#
@@ -2760,3 +2831,4 @@ create view v1 as select * from t1 where f1 between now() and now() + interval 1
show create view v1;
drop view v1;
drop table t1;
+--echo End of 5.0 tests.