2015-08-11 18:45:38 +02:00
SET GLOBAL SQL_MODE="";
SET LOCAL SQL_MODE="";
2010-08-09 10:32:50 +02:00
SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
PLUGIN_STATUS ACTIVE
PLUGIN_TYPE AUTHENTICATION
PLUGIN_DESCRIPTION plugin API test plugin
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT plugin,authentication_string FROM mysql.user WHERE User='plug';
plugin authentication_string
test_plugin_server plug_dest
## test plugin auth
2019-01-29 12:55:33 +01:00
connect(localhost,plug,plug_dest,test,MYSQL_PORT,MYSQL_SOCK);
connect plug_con,localhost,plug,plug_dest;
2010-08-09 10:32:50 +02:00
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
GRANT PROXY ON plug_dest TO plug;
2010-11-02 16:45:26 +01:00
test proxies_priv columns
2013-08-21 11:54:38 +02:00
SELECT * FROM mysql.proxies_priv WHERE user !='root';
2010-11-02 16:45:26 +01:00
Host User Proxied_host Proxied_user With_grant Grantor Timestamp
2010-11-03 12:47:22 +01:00
xx plug % plug_dest 0 root@localhost xx
2010-11-02 16:45:26 +01:00
test mysql.proxies_priv;
SHOW CREATE TABLE mysql.proxies_priv;
Table Create Table
proxies_priv CREATE TABLE `proxies_priv` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
2013-11-03 16:31:52 +01:00
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
2010-11-02 16:45:26 +01:00
`Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
2013-11-03 16:31:52 +01:00
`Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
2016-07-19 11:18:58 +02:00
`With_grant` tinyint(1) NOT NULL DEFAULT 0,
2013-11-03 16:31:52 +01:00
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
2016-11-07 17:17:40 +01:00
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
2010-11-02 16:45:26 +01:00
PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
KEY `Grantor` (`Grantor`)
2018-08-02 16:59:11 +02:00
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User proxy privileges'
2016-03-25 17:51:22 +01:00
connect plug_con,localhost,plug,plug_dest;
2010-08-09 10:32:50 +02:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug@localhost plug_dest@%
## test SET PASSWORD
SET PASSWORD = PASSWORD('plug_dest');
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con;
2010-08-09 10:32:50 +02:00
## test bad credentials
2019-01-29 12:55:33 +01:00
connect(localhost,plug,bad_credentials,test,MYSQL_PORT,MYSQL_SOCK);
connect plug_con,localhost,plug,bad_credentials;
2010-08-09 10:32:50 +02:00
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
2019-01-29 12:55:33 +01:00
## test bad default plugin : nothing bad happens, as that plugin was't required by the server
connect plug_con_wrongp,localhost,plug,plug_dest,,,,,wrong_plugin_name;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug@localhost plug_dest@%
connection default;
disconnect plug_con_wrongp;
2010-08-09 10:32:50 +02:00
## test correct default plugin
2016-03-25 17:51:22 +01:00
connect plug_con_rightp,localhost,plug,plug_dest,,,,,auth_test_plugin;
2010-08-09 10:32:50 +02:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
2011-07-02 22:12:12 +02:00
plug@localhost plug_dest@%
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con_rightp;
2010-08-09 10:32:50 +02:00
## test no_auto_create_user sql mode with plugin users
SET @@sql_mode=no_auto_create_user;
GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
2015-08-11 18:45:38 +02:00
SET @@sql_mode="";
2010-08-09 10:32:50 +02:00
DROP USER grant_user;
## test utf-8 user name
CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT PROXY ON plug_dest TO `Ÿ`;
2016-03-25 17:51:22 +01:00
connect non_ascii,localhost,Ÿ,plug_dest;
2010-08-09 10:32:50 +02:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
Ÿ@localhost plug_dest@%
2016-03-25 17:51:22 +01:00
connection default;
disconnect non_ascii;
2010-08-09 10:32:50 +02:00
DROP USER `Ÿ`;
## test GRANT ... IDENTIFIED WITH/BY ...
CREATE DATABASE test_grant_db;
# create new user via GRANT WITH
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT PROXY ON plug_dest TO new_grant_user;
2016-03-25 17:51:22 +01:00
connect plug_con_grant,localhost,new_grant_user,plug_dest;
2010-08-09 10:32:50 +02:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_grant_user@localhost plug_dest@%
USE test_grant_db;
CREATE TABLE t1 (a INT);
DROP TABLE t1;
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con_grant;
2010-08-09 10:32:50 +02:00
REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user;
# try re-create existing user via GRANT IDENTIFIED BY
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
2011-07-02 22:12:12 +02:00
IDENTIFIED BY 'new_password';
connect(localhost,new_grant_user,plug_dest,test,MYSQL_PORT,MYSQL_SOCK);
2016-03-25 17:51:22 +01:00
connect plug_con_grant_deny,localhost,new_grant_user,plug_dest;
2010-08-09 10:32:50 +02:00
ERROR 28000: Access denied for user 'new_grant_user'@'localhost' (using password: YES)
2016-03-25 17:51:22 +01:00
connect plug_con_grant,localhost,new_grant_user,new_password;
2010-08-09 10:32:50 +02:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
2011-07-02 22:12:12 +02:00
new_grant_user@localhost new_grant_user@%
2010-08-09 10:32:50 +02:00
USE test_grant_db;
CREATE TABLE t1 (a INT);
DROP TABLE t1;
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con_grant;
2010-08-09 10:32:50 +02:00
DROP USER new_grant_user;
# try re-create existing user via GRANT IDENTIFIED WITH
GRANT ALL PRIVILEGES ON test_grant_db.* TO plug
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
REVOKE SELECT on test_grant_db.* FROM joro
INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
2011-12-12 23:58:40 +01:00
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2
2010-08-09 10:32:50 +02:00
REVOKE SELECT on test_grant_db.* FROM joro
INDENTIFIED BY 'plug_dest_passwd';
2011-12-12 23:58:40 +01:00
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDENTIFIED BY 'plug_dest_passwd'' at line 2
2010-08-09 10:32:50 +02:00
REVOKE SELECT on test_grant_db.* FROM joro
INDENTIFIED BY PASSWORD 'plug_dest_passwd';
2011-12-12 23:58:40 +01:00
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDENTIFIED BY PASSWORD 'plug_dest_passwd'' at line 2
2010-08-09 10:32:50 +02:00
DROP DATABASE test_grant_db;
## GRANT PROXY tests
CREATE USER grant_plug IDENTIFIED WITH 'test_plugin_server'
AS 'grant_plug_dest';
CREATE USER grant_plug_dest IDENTIFIED BY 'grant_plug_dest_passwd';
CREATE USER grant_plug_dest2 IDENTIFIED BY 'grant_plug_dest_passwd2';
# ALL PRIVILEGES doesn't include PROXY
GRANT ALL PRIVILEGES ON *.* TO grant_plug;
ERROR 28000: Access denied for user 'grant_plug'@'localhost' (using password: YES)
GRANT ALL PRIVILEGES,PROXY ON grant_plug_dest TO grant_plug;
2011-12-12 23:58:40 +01:00
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROXY ON grant_plug_dest TO grant_plug' at line 1
2010-08-09 10:32:50 +02:00
this should fail : can't combine PROXY
GRANT ALL SELECT,PROXY ON grant_plug_dest TO grant_plug;
2011-12-12 23:58:40 +01:00
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT,PROXY ON grant_plug_dest TO grant_plug' at line 1
2010-08-09 10:32:50 +02:00
# this should fail : no such grant
REVOKE PROXY ON grant_plug_dest FROM grant_plug;
ERROR 42000: There is no such grant defined for user 'grant_plug' on host '%'
2016-03-25 17:51:22 +01:00
connect grant_plug_dest_con,localhost,grant_plug_dest,grant_plug_dest_passwd;
2010-08-09 10:32:50 +02:00
## testing what an ordinary user can grant
this should fail : no rights to grant all
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%%' TO grant_plug;
2010-08-09 10:32:50 +02:00
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
this should fail : not the same user
GRANT PROXY ON grant_plug TO grant_plug_dest;
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
2012-10-09 14:45:40 +02:00
This is a valid grant
2010-08-09 10:32:50 +02:00
GRANT PROXY ON grant_plug_dest TO grant_plug;
2012-10-09 14:45:40 +02:00
REVOKE PROXY ON grant_plug_dest FROM grant_plug;
2010-08-09 10:32:50 +02:00
this should work : same user
2012-10-09 14:45:40 +02:00
GRANT PROXY ON grant_plug_dest TO grant_plug_dest2;
REVOKE PROXY ON grant_plug_dest FROM grant_plug_dest2;
this should fail : not the same user
2010-08-09 10:32:50 +02:00
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
2012-10-09 14:45:40 +02:00
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
this should fail : not the same user
2010-08-09 10:32:50 +02:00
REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
2012-10-09 14:45:40 +02:00
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
2010-08-09 10:32:50 +02:00
this should fail : can't create users
2012-10-09 14:45:40 +02:00
GRANT PROXY ON grant_plug_dest TO grant_plug@localhost;
2010-08-09 10:32:50 +02:00
ERROR 42000: You are not allowed to create a user with GRANT
2016-03-25 17:51:22 +01:00
connection default;
disconnect grant_plug_dest_con;
2010-08-09 10:32:50 +02:00
# test what root can grant
should work : root has PROXY to all users
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%%' TO grant_plug;
REVOKE PROXY ON ''@'%%' FROM grant_plug;
2010-08-09 10:32:50 +02:00
should work : root has PROXY to all users
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%%' TO proxy_admin IDENTIFIED BY 'test'
2010-08-09 10:32:50 +02:00
WITH GRANT OPTION;
need USAGE : PROXY doesn't contain it.
GRANT USAGE on *.* TO proxy_admin;
2016-03-25 17:51:22 +01:00
connect proxy_admin_con,localhost,proxy_admin,test;
2013-10-18 20:38:13 +02:00
should work : proxy_admin has proxy to ''@'%%'
2010-08-09 10:32:50 +02:00
GRANT PROXY ON future_user TO grant_plug;
2016-03-25 17:51:22 +01:00
connection default;
disconnect proxy_admin_con;
2010-08-09 10:32:50 +02:00
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
2010-08-09 10:32:50 +02:00
GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
REVOKE PROXY ON future_user FROM grant_plug;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
2010-08-09 10:32:50 +02:00
## testing drop user
CREATE USER test_drop@localhost;
GRANT PROXY ON future_user TO test_drop@localhost;
SHOW GRANTS FOR test_drop@localhost;
Grants for test_drop@localhost
2019-11-06 12:35:19 +01:00
GRANT USAGE ON *.* TO `test_drop`@`localhost`
2010-08-09 10:32:50 +02:00
GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost'
DROP USER test_drop@localhost;
2010-11-02 16:45:26 +01:00
SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
Host User Proxied_host Proxied_user With_grant Grantor Timestamp
2010-08-09 10:32:50 +02:00
DROP USER proxy_admin;
DROP USER grant_plug,grant_plug_dest,grant_plug_dest2;
## END GRANT PROXY tests
## cleanup
DROP USER plug;
DROP USER plug_dest;
## @@proxy_user tests
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug;
SELECT USER(),CURRENT_USER(),@@LOCAL.proxy_user;
USER() CURRENT_USER() @@LOCAL.proxy_user
root@localhost root@localhost NULL
SELECT @@GLOBAL.proxy_user;
ERROR HY000: Variable 'proxy_user' is a SESSION variable
SELECT @@LOCAL.proxy_user;
@@LOCAL.proxy_user
NULL
SET GLOBAL proxy_user = 'test';
ERROR HY000: Variable 'proxy_user' is a read only variable
SET LOCAL proxy_user = 'test';
ERROR HY000: Variable 'proxy_user' is a read only variable
SELECT @@LOCAL.proxy_user;
@@LOCAL.proxy_user
NULL
2016-03-25 17:51:22 +01:00
connect plug_con,localhost,plug,plug_dest;
2010-08-09 10:32:50 +02:00
SELECT @@LOCAL.proxy_user;
@@LOCAL.proxy_user
'plug'@'%'
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con;
2010-08-09 10:32:50 +02:00
## cleanup
DROP USER plug;
DROP USER plug_dest;
## END @@proxy_user tests
## @@external_user tests
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug;
SELECT USER(),CURRENT_USER(),@@LOCAL.external_user;
USER() CURRENT_USER() @@LOCAL.external_user
root@localhost root@localhost NULL
SELECT @@GLOBAL.external_user;
ERROR HY000: Variable 'external_user' is a SESSION variable
SELECT @@LOCAL.external_user;
@@LOCAL.external_user
NULL
SET GLOBAL external_user = 'test';
ERROR HY000: Variable 'external_user' is a read only variable
SET LOCAL external_user = 'test';
ERROR HY000: Variable 'external_user' is a read only variable
SELECT @@LOCAL.external_user;
@@LOCAL.external_user
NULL
2016-03-25 17:51:22 +01:00
connect plug_con,localhost,plug,plug_dest;
2010-08-09 10:32:50 +02:00
SELECT @@LOCAL.external_user;
@@LOCAL.external_user
2013-03-26 17:57:36 +01:00
plug_dest
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con;
2010-08-09 10:32:50 +02:00
## cleanup
DROP USER plug;
DROP USER plug_dest;
## END @@external_user tests
2010-09-20 15:51:42 +02:00
#
# Bug #56798 : Wrong credentials assigned when using a proxy user.
#
GRANT ALL PRIVILEGES ON *.* TO power_user;
2013-10-18 20:38:13 +02:00
GRANT USAGE ON anonymous_db.* TO ''@'%%'
2010-09-20 15:51:42 +02:00
IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
2013-10-18 20:38:13 +02:00
GRANT PROXY ON power_user TO ''@'%%';
2010-09-20 15:51:42 +02:00
CREATE DATABASE confidential_db;
2016-03-25 17:51:22 +01:00
connect plug_con,localhost, test_login_user, power_user, confidential_db;
2010-09-20 15:51:42 +02:00
SELECT user(),current_user(),@@proxy_user;
user() current_user() @@proxy_user
2013-10-18 20:38:13 +02:00
test_login_user@localhost power_user@% ''@'%%'
2016-03-25 17:51:22 +01:00
connection default;
disconnect plug_con;
2010-09-20 15:51:42 +02:00
DROP USER power_user;
2013-10-18 20:38:13 +02:00
DROP USER ''@'%%';
2010-09-20 15:51:42 +02:00
DROP DATABASE confidential_db;
# Test case #2 (crash with double grant proxy)
2013-10-18 20:38:13 +02:00
CREATE USER ''@'%%' IDENTIFIED WITH 'test_plugin_server' AS 'standard_user';
2010-09-20 15:51:42 +02:00
CREATE USER standard_user;
CREATE DATABASE shared;
GRANT ALL PRIVILEGES ON shared.* TO standard_user;
2013-10-18 20:38:13 +02:00
GRANT PROXY ON standard_user TO ''@'%%';
2010-09-20 15:51:42 +02:00
#should not crash
2013-10-18 20:38:13 +02:00
GRANT PROXY ON standard_user TO ''@'%%';
DROP USER ''@'%%';
2010-09-20 15:51:42 +02:00
DROP USER standard_user;
DROP DATABASE shared;
2010-11-19 15:35:04 +01:00
#
# Bug #57551 : Live upgrade fails between 5.1.52 -> 5.5.7-rc
#
CALL mtr.add_suppression("Missing system table mysql.proxies_priv.");
DROP TABLE mysql.proxies_priv;
# Must come back with mysql.proxies_priv absent.
2019-03-25 07:02:22 +01:00
# restart
2010-11-19 15:35:04 +01:00
SELECT * FROM mysql.proxies_priv;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
CREATE USER u1@localhost;
GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost;
GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
CREATE USER u2@localhost;
GRANT ALL PRIVILEGES ON *.* TO u2@localhost;
# access denied because of no privileges to root
GRANT PROXY ON u2@localhost TO u1@localhost;
ERROR 28000: Access denied for user 'root'@'localhost'
# access denied because of no privileges to root
REVOKE PROXY ON u2@localhost FROM u1@localhost;
ERROR 28000: Access denied for user 'root'@'localhost'
# go try graning proxy on itself, so that it will need the table
2016-03-25 17:51:22 +01:00
connect proxy_granter_con,localhost,u2,;
2010-11-19 15:35:04 +01:00
GRANT PROXY ON u2@localhost TO u1@localhost;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
REVOKE PROXY ON u2@localhost FROM u1@localhost;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
2016-03-25 17:51:22 +01:00
connection default;
disconnect proxy_granter_con;
2010-11-19 15:35:04 +01:00
# test if REVOKE works without the proxies_priv table
REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost;
# test if DROP USER work without the proxies_priv table
DROP USER u1@localhost,u2@localhost;
# test if FLUSH PRIVILEGES works without the proxies_priv table
FLUSH PRIVILEGES;
SELECT Host,User,Proxied_host,Proxied_user,With_grant FROM mysql.proxies_priv;
Host localhost
User root
Proxied_host
Proxied_user
With_grant 1
FLUSH PRIVILEGES;
2010-12-07 13:07:07 +01:00
#
2011-01-16 04:59:05 +01:00
# Bug#58139 : default-auth option not recognized in MySQL standard
2010-12-07 13:07:07 +01:00
# command line clients
#
# Executing 'mysql'
1
1
# Executing 'mysqladmin'
mysqld is alive
# Executing 'mysqldump'
2011-01-16 04:59:05 +01:00
# Executing 'mysql_upgrade'
2011-01-31 16:32:57 +01:00
#
# Bug #59657: Move the client authentication_pam plugin into the
# server repository
#
CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
AS 'cleartext_test';
## test plugin auth
ERROR 28000: Access denied for user 'uplain'@'localhost' (using password: YES)
2016-03-25 17:51:22 +01:00
connect cleartext_con,localhost,uplain,cleartext_test;
2011-01-31 16:32:57 +01:00
select USER(),CURRENT_USER();
USER() CURRENT_USER()
uplain@localhost uplain@localhost
2016-03-25 17:51:22 +01:00
connection default;
disconnect cleartext_con;
2011-01-31 16:32:57 +01:00
DROP USER uplain@localhost;
2020-04-21 18:45:12 +02:00
# switching from mysql.global_priv to mysql.user
2018-11-24 14:13:41 +01:00
drop view mysql.user_bak;
2011-03-18 15:16:17 +01:00
#
# Bug #59038 : mysql.user.authentication_string column
# causes configuration wizard to fail
2017-02-08 21:28:00 +01:00
INSERT IGNORE INTO mysql.user(
2011-03-18 15:16:17 +01:00
Host,
User,
Password,
Select_priv,
Insert_priv,
Update_priv,
Delete_priv,
Create_priv,
Drop_priv,
Reload_priv,
Shutdown_priv,
Process_priv,
File_priv,
Grant_priv,
References_priv,
Index_priv,
Alter_priv,
Show_db_priv,
Super_priv,
Create_tmp_table_priv,
Lock_tables_priv,
Execute_priv,
Repl_slave_priv,
Repl_client_priv,
/*!50001
Create_view_priv,
Show_view_priv,
Create_routine_priv,
Alter_routine_priv,
Create_user_priv,
*/
ssl_type,
ssl_cipher,
x509_issuer,
x509_subject,
max_questions,
max_updates,
max_connections)
VALUES (
'localhost',
'inserttest', '',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
/*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0');
2011-07-02 22:12:12 +02:00
Warnings:
Warning 1364 Field 'authentication_string' doesn't have a default value
2011-03-18 15:16:17 +01:00
FLUSH PRIVILEGES;
DROP USER inserttest@localhost;
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
COLUMN_NAME IN ('authentication_string', 'plugin') AND
TABLE_NAME='user' AND
TABLE_SCHEMA='mysql'
ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
2011-07-02 22:12:12 +02:00
NO authentication_string
NO plugin
2011-03-31 15:08:31 +02:00
#
# Bug #11936829: diff. between mysql.user (authentication_string)
# in fresh and upgraded 5.5.11
#
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
2011-07-02 22:12:12 +02:00
NO authentication_string
NO plugin
2011-03-31 15:08:31 +02:00
ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL;
ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL;
Run mysql_upgrade on a 5.5.10 external authentication column layout
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
2011-07-02 22:12:12 +02:00
NO authentication_string
NO plugin
2018-11-24 14:13:41 +01:00
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
2011-05-16 18:46:44 +02:00
#
# Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
# .-> USING PASSWORD: NO
#
# shoud contain "using password=yes"
ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: YES)
# shoud contain "using password=no"
ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: NO)
2011-07-06 01:13:50 +02:00
#
2011-06-01 15:08:13 +02:00
# Bug #12610784: SET PASSWORD INCORRECTLY KEEP AN OLD EMPTY PASSWORD
#
CREATE USER bug12610784@localhost;
SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
ERROR 28000: Access denied for user 'bug12610784'@'localhost' (using password: NO)
2016-03-25 17:51:22 +01:00
connect b12610784,localhost,bug12610784,secret,test;
connection default;
disconnect b12610784;
2011-06-01 15:08:13 +02:00
DROP USER bug12610784@localhost;
2011-08-12 14:55:04 +02:00
#
# Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM
# AUTHENTICATION SETTINGS
#
CREATE USER bug12818542@localhost
IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
CREATE USER bug12818542_dest@localhost
IDENTIFIED BY 'bug12818542_dest_passwd';
GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
2016-03-25 17:51:22 +01:00
connect bug12818542_con,localhost,bug12818542,bug12818542_dest;
2011-08-12 14:55:04 +02:00
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
bug12818542@localhost bug12818542_dest@localhost
SET PASSWORD = PASSWORD('bruhaha');
2016-03-25 17:51:22 +01:00
connection default;
disconnect bug12818542_con;
connect bug12818542_con2,localhost,bug12818542,bug12818542_dest;
2011-08-12 14:55:04 +02:00
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
bug12818542@localhost bug12818542_dest@localhost
2016-03-25 17:51:22 +01:00
connection default;
disconnect bug12818542_con2;
2011-08-12 14:55:04 +02:00
DROP USER bug12818542@localhost;
DROP USER bug12818542_dest@localhost;
2015-08-11 18:45:38 +02:00
SET GLOBAL SQL_MODE=default;
2010-11-19 15:35:04 +01:00
End of 5.5 tests