mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
9368c7bcd8
- ie. backport from 5.1 - also update testcase error dected by new version mysql-test/include/show_msg.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc mysql-test/include/show_msg80.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc BitKeeper/deleted/.del-rpl_chain_temp_table.test: Delete: mysql-test/t/rpl_chain_temp_table.test BitKeeper/deleted/.del-rpl_chain_temp_table.result: Delete: mysql-test/r/rpl_chain_temp_table.result BitKeeper/deleted/.del-rpl_failsafe.result: Delete: mysql-test/r/rpl_failsafe.result BitKeeper/deleted/.del-rpl_failsafe.test: Delete: mysql-test/t/rpl_failsafe.test BitKeeper/deleted/.del-rpl_heap.test: Delete: mysql-test/t/rpl_heap.test BitKeeper/deleted/.del-rpl_heap.result: Delete: mysql-test/r/rpl_heap.result BitKeeper/deleted/.del-rpl000018.result: Delete: mysql-test/r/rpl000018.result BitKeeper/deleted/.del-rpl000018.test: Delete: mysql-test/t/rpl000018.test client/Makefile.am: Link mysqltest with mysys/my_copy.c client/mysqltest.c: Update mysqltest to latest version mysql-test/include/have_multi_ndb.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/master-slave.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/ps_query.inc: Remove the comment about no output now when it does. mysql-test/r/check.result: Update output from --send mysql-test/r/connect.result: Update result file for connect test after backport form 5.1 mysql-test/r/flush.result: Update output from --send mysql-test/r/flush_block_commit.result: Update output from --send mysql-test/r/func_misc.result: Update output from --send mysql-test/r/grant2.result: Update output from --send mysql-test/r/handler.result: Update output from --send mysql-test/r/kill.result: Update output from --send mysql-test/r/lock_multi.result: Update output from --send mysql-test/r/mix_innodb_myisam_binlog.result: Update output from --send mysql-test/r/mysqltest.result: Update mysqltest.result after backport mysql-test/r/ps_2myisam.result: Update result as the output from query is now printed mysql-test/r/ps_3innodb.result: Update result as the output from query is now printed mysql-test/r/ps_4heap.result: Update result as the output from query is now printed mysql-test/r/ps_5merge.result: Update result as the output from query is now printed mysql-test/r/ps_6bdb.result: Update result as the output from query is now printed mysql-test/r/ps_7ndb.result: Update result as the output from query is now printed mysql-test/r/rename.result: Update output from --send mysql-test/r/rpl000001.result: Update output from --send mysql-test/r/rpl_error_ignored_table.result: Update output from --send mysql-test/r/rpl_master_pos_wait.result: Update output from --send mysql-test/r/subselect.result: Update result file after adding missing ; mysql-test/r/synchronization.result: Update output from --send mysql-test/r/type_blob.result: Update result file after adding missing ; mysql-test/t/connect.test: Backport test from 5.1 mysql-test/t/init_file.test: Update test so something is printed mysql-test/t/mysql_client_test.test: Update test so result is sent to file and something is printed mysql-test/t/mysqltest.test: Backport latest mysqltest.test file mysql-test/t/ps.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_1general.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_grant.test: Remove the $DB, no other test uses it mysql-test/t/rpl_flush_tables.test: Fetch $SERVER_VERSION from the db server mysql-test/t/rpl_trunc_temp.test: Remove the selection of connection master after it's been disconnected already mysql-test/t/subselect.test: Add missing ; mysql-test/t/type_blob.test: Add missing ;
155 lines
6.2 KiB
Text
155 lines
6.2 KiB
Text
SET NAMES binary;
|
|
drop database if exists mysqltest;
|
|
drop database if exists mysqltest_1;
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
delete from mysql.tables_priv where user like 'mysqltest\_%';
|
|
delete from mysql.columns_priv where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
|
|
select current_user();
|
|
current_user()
|
|
mysqltest_1@localhost
|
|
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
|
|
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
|
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%'
|
|
show grants for mysqltest_1@localhost;
|
|
Grants for mysqltest_1@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `my\_%`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
|
|
show grants for mysqltest_2@localhost;
|
|
Grants for mysqltest_2@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `my\_1`.* TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
|
|
show grants for mysqltest_3@localhost;
|
|
ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'localhost'
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
create database mysqltest_1;
|
|
grant all privileges on `mysqltest\_1`.* to mysqltest_1@localhost with grant option;
|
|
select current_user();
|
|
current_user()
|
|
mysqltest_1@localhost
|
|
show databases;
|
|
Database
|
|
mysqltest_1
|
|
test
|
|
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
|
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest_1'
|
|
show grants for mysqltest_1@localhost;
|
|
Grants for mysqltest_1@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
drop database mysqltest_1;
|
|
flush privileges;
|
|
create database mysqltest;
|
|
grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost;
|
|
flush privileges;
|
|
use mysqltest;
|
|
create table t1 (id int primary key, data varchar(255));
|
|
show grants for current_user();
|
|
Grants for mysqltest_1@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
|
GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
|
insert into t1 values (1, 'I can''t change it!');
|
|
update t1 set data='I can change it!' where id = 1;
|
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
|
|
insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!';
|
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
|
|
select * from t1;
|
|
id data
|
|
1 I can't change it!
|
|
drop table t1;
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
create table t1 (a int, b int);
|
|
grant select (a) on t1 to mysqltest_1@localhost with grant option;
|
|
grant select (a,b) on t1 to mysqltest_2@localhost;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1'
|
|
grant select on t1 to mysqltest_3@localhost;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
|
|
drop table t1;
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
delete from mysql.tables_priv where user like 'mysqltest\_%';
|
|
delete from mysql.columns_priv where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
drop database mysqltest;
|
|
use test;
|
|
create database mysqltest_1;
|
|
create table mysqltest_1.t1 (i int);
|
|
insert into mysqltest_1.t1 values (1),(2),(3);
|
|
GRANT ALL ON mysqltest_1.t1 TO mysqltest_1@'127.0.0.0/255.0.0.0';
|
|
show grants for current_user();
|
|
Grants for mysqltest_1@127.0.0.0/255.0.0.0
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
|
|
GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
|
|
select * from t1;
|
|
i
|
|
1
|
|
2
|
|
3
|
|
REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0';
|
|
delete from mysql.user where user like 'mysqltest\_1';
|
|
flush privileges;
|
|
drop table mysqltest_1.t1;
|
|
grant all on mysqltest_1.* to mysqltest_1@'127.0.0.1';
|
|
select current_user();
|
|
current_user()
|
|
mysqltest_1@127.0.0.1
|
|
set password = password('changed');
|
|
select host, length(password) from mysql.user where user like 'mysqltest\_1';
|
|
host length(password)
|
|
127.0.0.1 41
|
|
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1';
|
|
delete from mysql.user where user like 'mysqltest\_1';
|
|
flush privileges;
|
|
grant all on mysqltest_1.* to mysqltest_1@'127.0.0.0/255.0.0.0';
|
|
select current_user();
|
|
current_user()
|
|
mysqltest_1@127.0.0.0/255.0.0.0
|
|
set password = password('changed');
|
|
select host, length(password) from mysql.user where user like 'mysqltest\_1';
|
|
host length(password)
|
|
127.0.0.0/255.0.0.0 41
|
|
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0';
|
|
delete from mysql.user where user like 'mysqltest\_1';
|
|
flush privileges;
|
|
drop database mysqltest_1;
|
|
set password = password("changed");
|
|
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
|
|
lock table mysql.user write;
|
|
flush privileges;
|
|
grant all on *.* to 'mysqltest_1'@'localhost';
|
|
unlock tables;
|
|
lock table mysql.user write;
|
|
set password for 'mysqltest_1'@'localhost' = password('');
|
|
revoke all on *.* from 'mysqltest_1'@'localhost';
|
|
unlock tables;
|
|
drop user 'mysqltest_1'@'localhost';
|
|
insert into mysql.user (user, host) values
|
|
('mysqltest_1', 'host1'),
|
|
('mysqltest_2', 'host2'),
|
|
('mysqltest_3', 'host3'),
|
|
('mysqltest_4', 'host4'),
|
|
('mysqltest_5', 'host5'),
|
|
('mysqltest_6', 'host6'),
|
|
('mysqltest_7', 'host7');
|
|
flush privileges;
|
|
drop user mysqltest_3@host3;
|
|
drop user mysqltest_1@host1, mysqltest_2@host2, mysqltest_4@host4,
|
|
mysqltest_5@host5, mysqltest_6@host6, mysqltest_7@host7;
|
|
create database mysqltest_1;
|
|
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
|
|
set sql_log_off = 1;
|
|
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
|
set sql_log_bin = 0;
|
|
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
|
delete from mysql.user where user like 'mysqltest\_1';
|
|
delete from mysql.db where user like 'mysqltest\_1';
|
|
drop database mysqltest_1;
|
|
flush privileges;
|