mirror of
https://github.com/MariaDB/server.git
synced 2025-10-25 18:38:00 +03:00
mysql-test/r/func_misc.result: Move test that requires query cache from main.func_misc to main.query_cache. mysql-test/r/mysqltest.result: Fix test failure due to race. This test case creates > 300 connections in a tight loop, and depending on thread scheduling and load, even though each connection is immediately disconnected before connecting the next one, the server max connections may still be exceeded due to server not being able to free old connections as fast as new ones are made. mysql-test/r/query_cache.result: Move test that requires query cache from main.func_misc to main.query_cache. Move test that requires query cache from main.variables to main.query_cache. mysql-test/r/query_cache_notembedded.result: Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded. mysql-test/r/sp_notembedded.result: Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded. mysql-test/r/udf.result: Move test in main.udf that requires query cache to separate file. mysql-test/r/udf_query_cache.result: Move test in main.udf that requires query cache to separate file. mysql-test/r/variables.result: Move test that requires query cache from main.variables to main.query_cache. mysql-test/suite/funcs_1/datadict/processlist_val.inc: Fix race where result file may show state "cleaning up" in the small window between setting COMMAND to 'Sleep' and clearing STATE. mysql-test/suite/rpl/r/rpl_temporary.result: Fix race with suppression of warning message by fixing the test to not generate the warning message in the first place. Problem was a race between creating an anonymous account and resetting the slave. If the slave reset happens before replicating the account, the subsequest deletion of the account will fail to replicate correctly due to missing row. mysql-test/suite/rpl/t/rpl_temporary.test: Fix race with suppression of warning message by fixing the test to not generate the warning message in the first place. Problem was a race between creating an anonymous account and resetting the slave. If the slave reset happens before replicating the account, the subsequest deletion of the account will fail to replicate correctly due to missing row. mysql-test/t/func_misc.test: Move test that requires query cache from main.func_misc to main.query_cache. Move test that requires query cache from main.variables to main.query_cache. mysql-test/t/mysqltest.test: Fix test failure due to race. This test case creates > 300 connections in a tight loop, and depending on thread scheduling and load, even though each connection is immediately disconnected before connecting the next one, the server max connections may still be exceeded due to server not being able to free old connections as fast as new ones are made. mysql-test/t/query_cache.test: Move test that requires query cache to main.query_cache. mysql-test/t/query_cache_notembedded.test: Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded. mysql-test/t/sp_notembedded.test: Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded. mysql-test/t/udf.test: Move test in main.udf that requires query cache to separate file. mysql-test/t/udf_query_cache-master.opt: Move test in main.udf that requires query cache to separate file. mysql-test/t/udf_query_cache.test: Move test in main.udf that requires query cache to separate file. mysql-test/t/variables.test: Move test that requires query cache from main.variables to main.query_cache. tests/mysql_client_test.c: In tests that require query cache, skip the test if query cache not available. Do this dynamically rather than using HAVE_QUERY_CACHE, as there is no guarantee that the server we run against was compiled with same preprocessor #define as the mysql_client_test program (and since it is trivial to check dynamically).
222 lines
5.7 KiB
Plaintext
222 lines
5.7 KiB
Plaintext
set @old_concurrent_insert= @@global.concurrent_insert;
|
|
set @@global.concurrent_insert= 0;
|
|
drop table if exists t1,t3;
|
|
drop procedure if exists bug4902|
|
|
create procedure bug4902()
|
|
begin
|
|
show grants for 'root'@'localhost';
|
|
end|
|
|
call bug4902()|
|
|
Grants for root@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
|
call bug4902()|
|
|
Grants for root@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
|
drop procedure bug4902|
|
|
drop procedure if exists bug4902_2|
|
|
create procedure bug4902_2()
|
|
begin
|
|
show processlist;
|
|
end|
|
|
call bug4902_2()|
|
|
show warnings|
|
|
Level Code Message
|
|
call bug4902_2()|
|
|
show warnings|
|
|
Level Code Message
|
|
drop procedure bug4902_2|
|
|
drop procedure if exists bug6807|
|
|
create procedure bug6807()
|
|
begin
|
|
declare id int;
|
|
set id = connection_id();
|
|
kill query id;
|
|
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|
|
|
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|
|
|
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)|
|
|
create view v1 as select a from t3;
|
|
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|
|
|
drop table t3|
|
|
drop procedure if exists bug15298_1;
|
|
drop procedure if exists bug15298_2;
|
|
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;
|
|
call 15298_1();
|
|
Grants for root@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
|
call 15298_2();
|
|
Grants for root@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
|
drop user mysqltest_1@localhost;
|
|
drop procedure 15298_1;
|
|
drop procedure 15298_2;
|
|
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();
|
|
insert into t1 (value) values ("old");
|
|
select get_lock('b26162',120);
|
|
get_lock('b26162',120)
|
|
1
|
|
select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
|
|
set session low_priority_updates=on;
|
|
call p1();;
|
|
select 'rl_contender', value from t1;
|
|
rl_contender value
|
|
rl_contender old
|
|
select release_lock('b26162');
|
|
release_lock('b26162')
|
|
1
|
|
rl_acquirer value
|
|
rl_acquirer old
|
|
drop procedure p1;
|
|
drop table t1;
|
|
set session low_priority_updates=default;
|
|
INSERT INTO mysql.user (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,
|
|
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');
|
|
FLUSH PRIVILEGES;
|
|
CREATE PROCEDURE p1(i INT) BEGIN END;
|
|
DROP PROCEDURE p1;
|
|
DELETE FROM mysql.user WHERE User='mysqltest_1';
|
|
FLUSH PRIVILEGES;
|
|
set @@global.concurrent_insert= @old_concurrent_insert;
|
|
#
|
|
# 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
|
|
** Connection con1
|
|
CREATE PROCEDURE p()
|
|
BEGIN
|
|
SELECT 1;
|
|
SELECT GET_LOCK('Bug44521', 100);
|
|
SELECT 2;
|
|
END$
|
|
CALL p();;
|
|
** Default connection
|
|
SELECT RELEASE_LOCK('Bug44521');
|
|
RELEASE_LOCK('Bug44521')
|
|
1
|
|
DROP PROCEDURE p;
|
|
# ------------------------------------------------------------------
|
|
# -- End of 5.1 tests
|
|
# ------------------------------------------------------------------
|