mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
SQL: truncate syntax and privilege [closes #229]
This commit is contained in:
41
mysql-test/suite/versioning/t/truncate_privilege.test
Normal file
41
mysql-test/suite/versioning/t/truncate_privilege.test
Normal file
@ -0,0 +1,41 @@
|
||||
# Can't test with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
connect (root,localhost,root,,test);
|
||||
connection root;
|
||||
|
||||
--disable_warnings
|
||||
create database mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create user mysqltest_1@localhost;
|
||||
connect (user1,localhost,mysqltest_1,,test);
|
||||
connection user1;
|
||||
|
||||
connection root;
|
||||
create table mysqltest.t (a int) with system versioning;
|
||||
|
||||
connection user1;
|
||||
show grants;
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
truncate mysqltest.t to system_time now();
|
||||
|
||||
connection root;
|
||||
grant delete versioning rows on mysqltest.* to mysqltest_1@localhost;
|
||||
grant delete versioning rows on mysqltest.t to mysqltest_1@localhost;
|
||||
|
||||
connection user1;
|
||||
show grants;
|
||||
truncate mysqltest.t to system_time now();
|
||||
|
||||
connection root;
|
||||
grant all on *.* to mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database mysqltest;
|
Reference in New Issue
Block a user