mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug4-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
This commit is contained in:
@ -501,3 +501,20 @@ drop user test14256;
|
||||
insert into mysql.user select * from t1;
|
||||
flush privileges;
|
||||
drop table t1;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
|
||||
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
|
||||
use mysqltest;
|
||||
LOCK TABLES v1 READ;
|
||||
SHOW CREATE TABLE v1;
|
||||
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
|
||||
UNLOCK TABLES;
|
||||
use test;
|
||||
use test;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database mysqltest;
|
||||
|
@ -664,3 +664,39 @@ insert into mysql.user select * from t1;
|
||||
flush privileges;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#14726: freeing stack variable in case of an error of opening
|
||||
# a view when we have locked tables with LOCK TABLES statement.
|
||||
#
|
||||
connection root;
|
||||
--disable_warnings
|
||||
create database mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
use mysqltest;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
|
||||
|
||||
connection user1;
|
||||
|
||||
use mysqltest;
|
||||
LOCK TABLES v1 READ;
|
||||
-- error ER_TABLEACCESS_DENIED_ERROR
|
||||
SHOW CREATE TABLE v1;
|
||||
UNLOCK TABLES;
|
||||
use test;
|
||||
|
||||
connection root;
|
||||
use test;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database mysqltest;
|
||||
|
||||
#
|
||||
# switch to default connaction
|
||||
#
|
||||
disconnect user1;
|
||||
disconnect root;
|
||||
connection default;
|
||||
|
Reference in New Issue
Block a user