1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00

SQL: truncate syntax and privilege [closes #229]

This commit is contained in:
Eugene Kosov
2017-09-08 10:22:24 +03:00
committed by GitHub
parent 904b69cd9e
commit a49239b57a
46 changed files with 378 additions and 448 deletions

View File

@ -0,0 +1,33 @@
connect root,localhost,root,,test;
connection root;
create database mysqltest;
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;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
truncate mysqltest.t to system_time now();
ERROR 42000: DELETE VERSIONING ROWS command denied to user 'mysqltest_1'@'localhost' for table 't'
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;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT DELETE VERSIONING ROWS ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT DELETE VERSIONING ROWS ON `mysqltest`.`t` TO 'mysqltest_1'@'localhost'
truncate mysqltest.t to system_time now();
connection root;
grant all on *.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'localhost'
GRANT DELETE VERSIONING ROWS ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT DELETE VERSIONING ROWS ON `mysqltest`.`t` TO 'mysqltest_1'@'localhost'
drop user mysqltest_1@localhost;
drop database mysqltest;