summaryrefslogtreecommitdiff
path: root/mysql-test/t/view_grant.test
diff options
context:
space:
mode:
authorunknown <gkodinov@mysql.com>2006-06-21 12:12:46 +0300
committerunknown <gkodinov@mysql.com>2006-06-21 12:12:46 +0300
commit6c787151613ad1d443b43389d534861b8bf757e4 (patch)
tree4d1eaabc3133949024515c0746b67bb1c08977bd /mysql-test/t/view_grant.test
parentb47705abf385274f3a5f4844c3496c1b22b15db6 (diff)
downloadmariadb-git-6c787151613ad1d443b43389d534861b8bf757e4.tar.gz
Bug #20482: failure on Create join view with sources views/tables in different
schemas The function check_one_table_access() called to check access to tables in SELECT/INSERT/UPDATE was doing additional checks/modifications that don't hold in the context of setup_tables_and_check_access(). That's why the check_one_table() was split into two : the functionality needed by setup_tables_and_check_access() into check_single_table_access() and the rest of the functionality stays in check_one_table_access() that is made to call the new check_single_table_access() function. mysql-test/r/view_grant.result: Bug #20482: failure on Create join view with sources views/tables in different schemas - test suite for the bug mysql-test/t/view_grant.test: Bug #20482: failure on Create join view with sources views/tables in different schemas - test suite for the bug sql/mysql_priv.h: Bug #20482: failure on Create join view with sources views/tables in different schemas - check_one_table_access split into 2 sql/sql_base.cc: Bug #20482: failure on Create join view with sources views/tables in different schemas - the new sub-function called sql/sql_parse.cc: Bug #20482: failure on Create join view with sources views/tables in different schemas - check_one_table_access() split into two : check_single_table_access() to actually check access to the table(ro) and check_one_table_access() that calls check_single_table_access() and checks also the tables belonging to sub selects or implicitly opened tables.
Diffstat (limited to 'mysql-test/t/view_grant.test')
-rw-r--r--mysql-test/t/view_grant.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 4663a667d25..9d23bfa6197 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -807,3 +807,24 @@ SELECT * FROM v;
DROP VIEW v;
DROP TABLE t1;
USE test;
+
+#
+# BUG#20482: failure on Create join view with sources views/tables
+# in different schemas
+#
+--disable_warnings
+CREATE DATABASE test1;
+CREATE DATABASE test2;
+--enable_warnings
+
+CREATE TABLE test1.t0 (a VARCHAR(20));
+CREATE TABLE test2.t1 (a VARCHAR(20));
+CREATE VIEW test2.t3 AS SELECT * FROM test1.t0;
+CREATE OR REPLACE VIEW test.v1 AS
+ SELECT ta.a AS col1, tb.a AS col2 FROM test2.t3 ta, test2.t1 tb;
+
+DROP VIEW test.v1;
+DROP VIEW test2.t3;
+DROP TABLE test2.t1, test1.t0;
+DROP DATABASE test2;
+DROP DATABASE test1;