summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result56
1 files changed, 53 insertions, 3 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index a74feb4de17..97df059c86a 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
+drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
drop database if exists mysqltest;
use test;
@@ -2199,10 +2199,10 @@ r_object_id users_names
drop view v1, v2;
drop table t1, t2;
create definer=some_user@`` sql security invoker view v1 as select 1;
-ERROR HY000: View definer is not fully qualified
+ERROR HY000: Definer is not fully qualified
create definer=some_user@localhost sql security invoker view v1 as select 1;
Warnings:
-Note 1449 There is not some_user@localhost registered
+Note 1449 There is no 'some_user'@'localhost' registered
show create view v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
@@ -2335,3 +2335,53 @@ f1 group_concat(f2 order by f2 desc)
1 3,2,1
drop view v1,v2;
drop table t1;
+create table t1 (x int, y int);
+create table t2 (x int, y int, z int);
+create table t3 (x int, y int, z int);
+create table t4 (x int, y int, z int);
+create view v1 as
+select t1.x
+from (
+(t1 join t2 on ((t1.y = t2.y)))
+join
+(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
+);
+prepare stmt1 from "select count(*) from v1 where x = ?";
+set @parm1=1;
+execute stmt1 using @parm1;
+count(*)
+0
+execute stmt1 using @parm1;
+count(*)
+0
+drop view v1;
+drop table t1,t2,t3,t4;
+CREATE TABLE t1(id INT);
+CREATE VIEW v1 AS SELECT id FROM t1;
+OPTIMIZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 optimize note Unknown table 'test.v1'
+ANALYZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 analyze note Unknown table 'test.v1'
+REPAIR TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 repair note Unknown table 'test.v1'
+DROP TABLE t1;
+OPTIMIZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 optimize note Unknown table 'test.v1'
+Warnings:
+Error 1146 Table 'test.t1' doesn't exist
+Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+DROP VIEW v1;
+create definer = current_user() sql security invoker view v1 as select 1;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
+drop view v1;
+create definer = current_user sql security invoker view v1 as select 1;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
+drop view v1;