You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
* Update mcol_2000.test * Update mcs117_create_utf8.test * Update mcs12_alter_table.test * Update mcs13_alter_table_negative.test * Update mcs169_bin_functions.test * Update mcs171_null_functions.test * Update mcs173_coalesce_function.test * Update mcs174_case_function.test * Update mcs175_convert_functions.test * Update mcs176_if_function.test * Update mcs178_adddate_function.test * Update mcs179_addtime_function.test * Update mcs180_ascii_function.test * Update mcs181_between_and.test * Update mcs182_char_length_function.test * Update mcs183_date_function.test * Update mcs184_day_function.test * Update mcs185_dayname_function.test * Update mcs186_dayofyear_function.test * Update mcs187_dayofmonth_function.test * Update mcs1_create_table_data_types.test * Update mcs19_grant_revoke.test * Update mcs229_data_compression_type.test * Update mcs28_load_data_local_infile.test * Update mcs2_create_table_valid_names.test * Update mcs5_create_table_from_other_tables.test * Update mcs74_check_constraint.test * Update mcs7_create_table_with_metadata.test * Update mcs87_alter_column.test * Update mcs8_create_table_with_constraints.test * Update disabled.def * Update mcs19_grant_revoke.test * Update mcs19_grant_revoke.test * Update mcs19_grant_revoke.test
75 lines
2.0 KiB
Plaintext
75 lines
2.0 KiB
Plaintext
#
|
|
# Test GRANT and REVOKE priviliges to users on DB objects
|
|
# Author: Bharath, bharath.bokka@mariadb.com
|
|
#
|
|
-- source ../include/have_columnstore.inc
|
|
-- source include/have_innodb.inc
|
|
|
|
SET default_storage_engine=InnoDB;
|
|
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS mcs19_db;
|
|
DROP USER IF EXISTS 'user'@'localhost';
|
|
DROP USER IF EXISTS 'user1'@'localhost';
|
|
--enable_warnings
|
|
|
|
SET default_storage_engine=Columnstore;
|
|
SELECT @@default_storage_engine;
|
|
|
|
GRANT ALL on *.* TO 'user'@'localhost' IDENTIFIED BY 'Vagrant1|0000001';
|
|
SHOW GRANTS FOR 'user'@'localhost';
|
|
|
|
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'Vagrant1|0000001';
|
|
SHOW GRANTS FOR 'user1'@'localhost';
|
|
GRANT ALL ON *.* TO 'user1'@'localhost';
|
|
SHOW GRANTS FOR 'user1'@'localhost';
|
|
REVOKE ALL ON *.* FROM 'user1'@'localhost';
|
|
SHOW GRANTS FOR 'user1'@'localhost';
|
|
GRANT CREATE, SELECT, INSERT ON mcs19_db.* TO 'user1'@'localhost';
|
|
|
|
--disable_query_log
|
|
GRANT ALL ON test.* TO 'user1'@'localhost';
|
|
--enable_query_log
|
|
connect(conn1, localhost, user1, Vagrant1|0000001,);
|
|
connect(conn2, localhost, user1, Vagrant1|0000001,);
|
|
|
|
connection conn1;
|
|
SELECT USER();
|
|
SHOW GRANTS FOR 'user1'@'localhost';
|
|
CREATE DATABASE mcs19_db;
|
|
USE mcs19_db;
|
|
--error ER_DBACCESS_DENIED_ERROR
|
|
CREATE DATABASE mcs19_db1;
|
|
CREATE TABLE t1(col INT) ENGINE=InnoDB;
|
|
--replace_regex /( COLLATE=latin1_swedish_ci)//
|
|
SHOW CREATE TABLE t1;
|
|
INSERT INTO t1 VALUES(1);
|
|
SELECT * FROM t1;
|
|
--error ER_DBACCESS_DENIED_ERROR
|
|
DROP DATABASE mcs19_db;
|
|
|
|
connection default;
|
|
SELECT USER();
|
|
REVOKE CREATE, SELECT, INSERT ON mcs19_db.* FROM 'user1'@'localhost';
|
|
|
|
connection conn2;
|
|
SELECT USER();
|
|
SHOW GRANTS FOR 'user1'@'localhost';
|
|
--error ER_DBACCESS_DENIED_ERROR
|
|
USE mcs19_db;
|
|
--disable_abort_on_error
|
|
--replace_regex /(`mcs19_db`.`t1`)/'t1'/
|
|
INSERT INTO mcs19_db.t1 VALUES(2);
|
|
--replace_regex /(`mcs19_db`.`t1`)/'t1'/
|
|
SELECT * FROM mcs19_db.t1;
|
|
--replace_regex /(`mcs19_db`.`t1`)/'t1'/
|
|
CREATE TABLE mcs19_db.t1;
|
|
--enable_abort_on_error
|
|
|
|
# Clean up
|
|
connection default;
|
|
SET default_storage_engine=default;
|
|
DROP DATABASE mcs19_db;
|
|
DROP USER 'user'@'localhost';
|
|
DROP USER 'user1'@'localhost';
|