mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
80 lines
1.4 KiB
Text
80 lines
1.4 KiB
Text
--source include/not_valgrind.inc
|
|
--source include/no_protocol.inc
|
|
|
|
SET GLOBAL net_write_timeout = 900;
|
|
|
|
CREATE TABLE A (
|
|
pk INTEGER AUTO_INCREMENT PRIMARY KEY,
|
|
fdate DATE
|
|
) ENGINE=MyISAM;
|
|
|
|
--delimiter |
|
|
|
|
CREATE PROCEDURE p_analyze()
|
|
BEGIN
|
|
DECLARE attempts INTEGER DEFAULT 100;
|
|
wl_loop: WHILE attempts > 0 DO
|
|
ANALYZE TABLE A;
|
|
SET attempts = attempts - 1;
|
|
END WHILE wl_loop;
|
|
END |
|
|
|
|
CREATE FUNCTION rnd3() RETURNS INT
|
|
BEGIN
|
|
RETURN ROUND(3 * RAND() + 0.5);
|
|
END |
|
|
|
|
--delimiter ;
|
|
|
|
SET GLOBAL use_stat_tables = PREFERABLY;
|
|
|
|
--let $trial = 100
|
|
|
|
--disable_query_log
|
|
--disable_result_log
|
|
--disable_warnings
|
|
while ($trial)
|
|
{
|
|
|
|
--connect (con1,localhost,root,,)
|
|
--send CALL p_analyze()
|
|
|
|
--connect (con2,localhost,root,,)
|
|
--send CALL p_analyze()
|
|
|
|
--let $run = 100
|
|
|
|
while ($run)
|
|
{
|
|
--connect (con3,localhost,root,,)
|
|
|
|
let $query = `SELECT CASE rnd3()
|
|
WHEN 1 THEN 'INSERT INTO A (pk) VALUES (NULL)'
|
|
WHEN 2 THEN 'DELETE FROM A LIMIT 1'
|
|
ELSE 'UPDATE IGNORE A SET fdate = 2 LIMIT 1' END`;
|
|
--eval $query
|
|
--disconnect con3
|
|
--dec $run
|
|
}
|
|
|
|
--connection con2
|
|
--reap
|
|
--disconnect con2
|
|
--connection con1
|
|
--reap
|
|
--disconnect con1
|
|
|
|
--dec $trial
|
|
}
|
|
|
|
--enable_query_log
|
|
--enable_result_log
|
|
--enable_warnings
|
|
|
|
# Cleanup
|
|
--connection default
|
|
DROP TABLE A;
|
|
DROP PROCEDURE p_analyze;
|
|
DROP FUNCTION rnd3;
|
|
SET GLOBAL use_stat_tables = DEFAULT;
|
|
SET GLOBAL net_write_timeout = DEFAULT;
|