2008-03-13 18:54:29 +01:00
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
2006-04-05 14:41:40 +02:00
drop table if exists t1,t3;
2006-02-24 17:34:15 +01:00
drop procedure if exists bug4902|
create procedure bug4902()
begin
show grants for 'root'@'localhost';
end|
call bug4902()|
Grants for root@localhost
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
2006-02-24 17:34:15 +01:00
call bug4902()|
Grants for root@localhost
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
2006-02-24 17:34:15 +01:00
drop procedure bug4902|
drop procedure if exists bug4902_2|
create procedure bug4902_2()
begin
show processlist;
end|
call bug4902_2()|
2008-03-13 18:54:29 +01:00
show warnings|
Level Code Message
2010-02-23 19:43:26 +01:00
Note 1305 PROCEDURE test.bug4902_2 does not exist
2006-02-24 17:34:15 +01:00
call bug4902_2()|
2008-03-13 18:54:29 +01:00
show warnings|
Level Code Message
2010-02-23 19:43:26 +01:00
Note 1305 PROCEDURE test.bug4902_2 does not exist
2006-02-24 17:34:15 +01:00
drop procedure bug4902_2|
drop procedure if exists bug6807|
create procedure bug6807()
begin
2013-09-13 18:14:56 +02:00
declare a int;
set a = connection_id();
kill query a;
2006-02-24 17:34:15 +01:00
select 'Not reached';
end|
call bug6807()|
ERROR 70100: Query execution was interrupted
call bug6807()|
ERROR 70100: Query execution was interrupted
drop procedure bug6807|
drop function if exists bug10100f|
drop procedure if exists bug10100p|
drop procedure if exists bug10100t|
drop procedure if exists bug10100pt|
drop procedure if exists bug10100pv|
drop procedure if exists bug10100pd|
drop procedure if exists bug10100pc|
create function bug10100f(prm int) returns int
begin
if prm > 1 then
return prm * bug10100f(prm - 1);
end if;
return 1;
end|
2017-02-08 21:28:00 +01:00
set statement sql_mode = '' for
2006-02-24 17:34:15 +01:00
create procedure bug10100p(prm int, inout res int)
begin
set res = res * prm;
if prm > 1 then
call bug10100p(prm - 1, res);
end if;
end|
2017-02-08 21:28:00 +01:00
set statement sql_mode = '' for
2006-02-24 17:34:15 +01:00
create procedure bug10100t(prm int)
begin
declare res int;
set res = 1;
call bug10100p(prm, res);
select res;
end|
create table t3 (a int)|
insert into t3 values (0)|
MDEV-15945 --ps-protocol does not test some queries
Make mysqltest to use --ps-protocol more
use prepared statements for everything that server supports
with the exception of CALL (for now).
Fix discovered test failures and bugs.
tests:
* PROCESSLIST shows Execute state, not Query
* SHOW STATUS increments status variables more than in text protocol
* multi-statements should be avoided (see tests with a wrong delimiter)
* performance_schema events have different names in --ps-protocol
* --enable_prepare_warnings
mysqltest.cc:
* make sure run_query_stmt() doesn't crash if there's
no active connection (in wait_until_connected_again.inc)
* prepare all statements that server supports
protocol.h
* Protocol_discard::send_result_set_metadata() should not send
anything to the client.
sql_acl.cc:
* extract the functionality of getting the user for SHOW GRANTS
from check_show_access(), so that mysql_test_show_grants() could
generate the correct column names in the prepare step
sql_class.cc:
* result->prepare() can fail, don't ignore its return value
* use correct number of decimals for EXPLAIN columns
sql_parse.cc:
* discard profiling for SHOW PROFILE. In text protocol it's done in
prepare_schema_table(), but in --ps it is called on prepare only,
so nothing was discarding profiling during execute.
* move the permission checking code for SHOW CREATE VIEW to
mysqld_show_create_get_fields(), so that it would be called during
prepare step too.
* only set sel_result when it was created here and needs to be
destroyed in the same block. Avoid destroying lex->result.
* use the correct number of tables in check_show_access(). Saying
"as many as possible" doesn't work when first_not_own_table isn't
set yet.
sql_prepare.cc:
* use correct user name for SHOW GRANTS columns
* don't ignore verbose flag for SHOW SLAVE STATUS
* support preparing REVOKE ALL and ROLLBACK TO SAVEPOINT
* don't ignore errors from thd->prepare_explain_fields()
* use select_send result for sending ANALYZE and EXPLAIN, but don't
overwrite lex->result, because it might be needed to issue execute-time
errors (select_dumpvar - too many rows)
sql_show.cc:
* check grants for SHOW CREATE VIEW here, not in mysql_execute_command
sql_view.cc:
* use the correct function to check privileges. Old code was doing
check_access() for thd->security_ctx, which is invoker's sctx,
not definer's sctx. Hide various view related errors from the invoker.
sql_yacc.yy:
* initialize lex->select_lex for LOAD, otherwise it'll contain garbage
data that happen to fail tests with views in --ps (but not otherwise).
2019-03-10 23:59:50 +01:00
create view v1 as select a from t3|
2006-02-24 17:34:15 +01:00
create procedure bug10100pt(level int, lim int)
begin
if level < lim then
update t3 set a=level;
FLUSH TABLES;
call bug10100pt(level+1, lim);
else
select * from t3;
end if;
end|
create procedure bug10100pv(level int, lim int)
begin
if level < lim then
update v1 set a=level;
FLUSH TABLES;
call bug10100pv(level+1, lim);
else
select * from v1;
end if;
end|
prepare stmt2 from "select * from t3;";
create procedure bug10100pd(level int, lim int)
begin
if level < lim then
select level;
prepare stmt1 from "update t3 set a=a+2";
execute stmt1;
FLUSH TABLES;
execute stmt1;
FLUSH TABLES;
execute stmt1;
FLUSH TABLES;
deallocate prepare stmt1;
execute stmt2;
select * from t3;
call bug10100pd(level+1, lim);
else
execute stmt2;
end if;
end|
create procedure bug10100pc(level int, lim int)
begin
declare lv int;
declare c cursor for select a from t3;
open c;
if level < lim then
select level;
fetch c into lv;
select lv;
update t3 set a=level+lv;
FLUSH TABLES;
call bug10100pc(level+1, lim);
else
select * from t3;
end if;
close c;
end|
set @@max_sp_recursion_depth=255|
set @var=1|
call bug10100p(255, @var)|
call bug10100pt(1,255)|
call bug10100pv(1,255)|
call bug10100pd(1,255)|
call bug10100pc(1,255)|
set @@max_sp_recursion_depth=0|
deallocate prepare stmt2|
drop function bug10100f|
drop procedure bug10100p|
drop procedure bug10100t|
drop procedure bug10100pt|
drop procedure bug10100pv|
drop procedure bug10100pd|
drop procedure bug10100pc|
drop view v1|
2006-04-18 18:10:47 +02:00
drop table t3|
2006-06-29 12:50:44 +02:00
drop procedure if exists bug15298_1;
drop procedure if exists bug15298_2;
2015-08-11 18:45:38 +02:00
create user 'mysqltest_1'@'localhost';
2006-06-29 12:50:44 +02:00
grant all privileges on test.* to 'mysqltest_1'@'localhost';
create procedure 15298_1 () sql security definer show grants for current_user;
create procedure 15298_2 () sql security definer show grants;
2016-03-25 17:51:22 +01:00
connect con1,localhost,mysqltest_1,,test;
2006-06-29 12:50:44 +02:00
call 15298_1();
Grants for root@localhost
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
2006-06-29 12:50:44 +02:00
call 15298_2();
Grants for root@localhost
2019-11-06 12:35:19 +01:00
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
2013-10-18 20:38:13 +02:00
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
2016-03-25 17:51:22 +01:00
connection default;
disconnect con1;
2006-06-29 12:50:44 +02:00
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
2008-03-13 18:54:29 +01:00
drop table if exists t1;
drop procedure if exists p1;
create table t1 (value varchar(15));
create procedure p1() update t1 set value='updated' where value='old';
call p1();
2013-08-20 13:48:29 +02:00
insert into t1 (value) values ("old"),("irrelevant");
2016-03-25 17:51:22 +01:00
connect rl_holder, localhost, root,,;
connect rl_acquirer, localhost, root,,;
connect rl_contender, localhost, root,,;
connect rl_wait, localhost, root,,;
connection rl_holder;
2008-03-13 18:54:29 +01:00
select get_lock('b26162',120);
get_lock('b26162',120)
1
2016-03-25 17:51:22 +01:00
connection rl_acquirer;
2008-03-13 18:54:29 +01:00
select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
2016-03-25 17:51:22 +01:00
connection rl_wait;
connection default;
2008-03-13 18:54:29 +01:00
set session low_priority_updates=on;
call p1();;
2016-03-25 17:51:22 +01:00
connection rl_wait;
connection rl_contender;
2008-03-13 18:54:29 +01:00
select 'rl_contender', value from t1;
rl_contender value
rl_contender old
2013-08-20 13:48:29 +02:00
rl_contender irrelevant
2016-03-25 17:51:22 +01:00
connection rl_holder;
2008-03-13 18:54:29 +01:00
select release_lock('b26162');
release_lock('b26162')
1
2016-03-25 17:51:22 +01:00
connection rl_acquirer;
2008-03-13 18:54:29 +01:00
rl_acquirer value
rl_acquirer old
2013-08-20 13:48:29 +02:00
rl_acquirer irrelevant
2016-03-25 17:51:22 +01:00
connection default;
disconnect rl_holder;
disconnect rl_acquirer;
disconnect rl_wait;
disconnect rl_contender;
2008-03-13 18:54:29 +01:00
drop procedure p1;
drop table t1;
set session low_priority_updates=default;
2020-04-21 18:45:12 +02:00
# switching from mysql.global_priv to mysql.user
2017-02-08 21:28:00 +01:00
INSERT IGNORE INTO mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv,
2009-06-04 07:54:23 +02:00
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,
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, max_user_connections)
VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N',
'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '',
'', '', '', '0', '0', '0', '0');
2010-03-29 17:13:53 +02:00
Warnings:
2011-07-02 22:12:12 +02:00
Warning 1364 Field 'authentication_string' doesn't have a default value
2009-06-04 07:28:45 +02:00
FLUSH PRIVILEGES;
2016-03-25 17:51:22 +01:00
connect con1, localhost, mysqltest_1,,;
connection con1;
2009-06-04 07:28:45 +02:00
CREATE PROCEDURE p1(i INT) BEGIN END;
2016-03-25 17:51:22 +01:00
disconnect con1;
connection default;
2009-06-04 07:28:45 +02:00
DROP PROCEDURE p1;
2020-04-21 18:45:12 +02:00
# switching back from mysql.user to mysql.global_priv
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
#
# Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
#
SELECT GET_LOCK('Bug44521', 0);
GET_LOCK('Bug44521', 0)
1
2016-03-25 17:51:22 +01:00
connect con1,localhost,root,,;
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
CREATE PROCEDURE p()
BEGIN
SELECT 1;
SELECT GET_LOCK('Bug44521', 100);
SELECT 2;
END$
CALL p();;
2016-03-25 17:51:22 +01:00
connection default;
disconnect con1;
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
SELECT RELEASE_LOCK('Bug44521');
RELEASE_LOCK('Bug44521')
1
DROP PROCEDURE p;
2010-02-05 10:39:46 +01:00
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1);
CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
CREATE VIEW v1 AS SELECT f1('a') FROM t1;
2016-03-25 17:51:22 +01:00
connect con1, localhost, root,,;
2010-02-05 10:39:46 +01:00
SELECT * FROM v1;;
2016-03-25 17:51:22 +01:00
connect con2, localhost, root,,;
2010-02-05 10:39:46 +01:00
SELECT * FROM v1;
2016-03-25 17:51:22 +01:00
connection default;
connection con1;
2010-02-05 10:39:46 +01:00
ERROR 70100: Query execution was interrupted
2016-03-25 17:51:22 +01:00
connection con2;
2010-02-05 10:39:46 +01:00
ERROR 70100: Query execution was interrupted
2016-03-25 17:51:22 +01:00
connection default;
2010-02-05 10:39:46 +01:00
DROP VIEW v1;
DROP TABLE t1;
DROP FUNCTION f1;
2016-03-25 17:51:22 +01:00
disconnect con1;
disconnect con2;
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
2011-06-08 15:44:50 +02:00
#
# Test for bug#11763757 "56510: ERROR 42000: FUNCTION DOES NOT EXIST
# IF NOT-PRIV USER RECONNECTS ".
#
# The real problem was that server was unable handle properly stored
# functions in databases which names contained dot.
#
2016-03-25 17:51:22 +01:00
connection default;
2011-06-08 15:44:50 +02:00
DROP DATABASE IF EXISTS `my.db`;
create database `my.db`;
use `my.db`;
CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
2016-03-25 17:51:22 +01:00
connect addcon, localhost, root,,;
connection addcon;
2011-06-08 15:44:50 +02:00
USE `my.db`;
SELECT f1(1);
f1(1)
1
SELECT `my.db`.f1(2);
`my.db`.f1(2)
2
2016-03-25 17:51:22 +01:00
connection default;
disconnect addcon;
2011-06-08 15:44:50 +02:00
DROP DATABASE `my.db`;
2012-03-28 10:05:08 +02:00
USE test;
2012-03-28 08:35:31 +02:00
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
#
SET @@SQL_MODE = '';
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT 1 $
2019-04-25 18:51:28 +02:00
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
2012-03-28 08:35:31 +02:00
SHOW EVENTS LIKE 'teste_bug11763507';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW EVENTS LIKE 'TESTE_bug11763507';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT teste_bug11763507;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT TESTE_bug11763507;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT teste_bug11763507;
#END OF BUG#11763507 test.
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
2020-04-21 18:45:12 +02:00
# switching from mysql.global_priv to mysql.user
2015-02-17 18:07:56 +01:00
grant create routine on test.* to foo1@localhost identified by 'foo';
2018-10-14 13:52:52 +02:00
update mysql.user set authentication_string = replace(authentication_string, '*', '-') where user='foo1';
2016-03-25 17:51:22 +01:00
connect foo,localhost,foo1,foo;
2015-02-17 18:07:56 +01:00
show grants;
Grants for foo1@localhost
2019-11-06 12:35:19 +01:00
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
2016-03-25 17:51:22 +01:00
connection default;
2015-02-17 18:07:56 +01:00
flush privileges;
2016-03-25 17:51:22 +01:00
connection foo;
2015-02-17 18:07:56 +01:00
show grants;
Grants for foo1@localhost
2019-11-06 12:35:19 +01:00
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
2015-02-17 18:07:56 +01:00
create procedure spfoo() select 1;
show grants;
Grants for foo1@localhost
2019-11-06 12:35:19 +01:00
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO `foo1`@`localhost`
2016-03-25 17:51:22 +01:00
connection default;
disconnect foo;
2015-02-17 18:07:56 +01:00
drop procedure spfoo;
drop user foo1@localhost;
2020-04-21 18:45:12 +02:00
# switching back from mysql.user to mysql.global_priv
2012-10-29 09:47:01 +01:00
set @@global.concurrent_insert= @old_concurrent_insert;