mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
ea1f7e4b56
libmysqld/lib_sql.cc: check for bootstrap added mysql-test/include/federated.inc: disabled in embedded mysql-test/mysql-test-run.pl: we disable ssh in embedded server mysql-test/r/bdb.result: part moved to bdb_notembedded as it uses binlog mysql-test/r/flush_block_commit.result: part moved to flush_block_commit_notembedded mysql-test/r/insert.result: part moved to insert_notembedded as delayed works differently in embedded server mysql-test/r/insert_select.result: part moved to insert_notembedded as GRANTS usually disabled in embedded server mysql-test/r/join.result: access rights hidden in result mysql-test/t/backup.test: now available in embedded server mysql-test/t/bdb.test: part moved to bdb_notembedded as it uses binlog mysql-test/t/delayed.test: code trimmed mysql-test/t/execution_constants.test: skipped in embedded-server mode mysql-test/t/flush_block_commit.test: moved to flush_block_commit_notembedded mysql-test/t/information_schema_db.test: skipped in embedded-server mysql-test/t/innodb.test: directories replaced to be embedded-server compliant mysql-test/t/insert.test: part moved to insert_notembedded mysql-test/t/insert_select.test: part moved to insert_notembedded mysql-test/t/join.test: access rights hidden mysql-test/t/status.test: skipped in embedded server mysql-test/t/trigger.test: directories replaced to be embedded-server compliant sql/item_strfunc.cc: extra contexts not needed whan access checks disabled sql/share/errmsg.txt: bigger paths reserved to prevent test's fails mysql-test/r/bdb_notembedded.result: ***MISSING WEAVE*** mysql-test/r/flush_block_commit_notembedded.result: added mysql-test/r/insert_notembedded.result: added mysql-test/t/bdb_notembedded.test: ***MISSING WEAVE*** mysql-test/t/flush_block_commit_notembedded.test: added mysql-test/t/insert_notembedded.test: added
142 lines
3.7 KiB
Text
142 lines
3.7 KiB
Text
# embedded server causes different stat
|
|
-- source include/not_embedded.inc
|
|
|
|
# PS causes different statistics
|
|
--disable_ps_protocol
|
|
|
|
connect (con1,localhost,root,,);
|
|
connect (con2,localhost,root,,);
|
|
|
|
flush status;
|
|
show status like 'Table_lock%';
|
|
connection con1;
|
|
SET SQL_LOG_BIN=0;
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
create table t1(n int) engine=myisam;
|
|
insert into t1 values(1);
|
|
connection con2;
|
|
lock tables t1 read;
|
|
unlock tables;
|
|
lock tables t1 read;
|
|
connection con1;
|
|
--send
|
|
update t1 set n = 3;
|
|
connection con2;
|
|
sleep 0.5;
|
|
unlock tables;
|
|
connection con1;
|
|
reap;
|
|
show status like 'Table_lock%';
|
|
drop table t1;
|
|
|
|
disconnect con2;
|
|
disconnect con1;
|
|
connection default;
|
|
|
|
# End of 4.1 tests
|
|
|
|
#
|
|
# last_query_cost
|
|
#
|
|
|
|
select 1;
|
|
show status like 'last_query_cost';
|
|
|
|
#
|
|
# Test for Bug #15933 max_used_connections is wrong after FLUSH STATUS
|
|
# if connections are cached
|
|
#
|
|
#
|
|
# The first suggested fix from the bug report was chosen
|
|
# (see http://bugs.mysql.com/bug.php?id=15933):
|
|
#
|
|
# a) On flushing the status, set max_used_connections to
|
|
# threads_connected, not to 0.
|
|
#
|
|
# b) Check if it is necessary to increment max_used_connections when
|
|
# taking a thread from the cache as well as when creating new threads
|
|
#
|
|
|
|
# Wait for at most $disconnect_timeout seconds for disconnects to finish.
|
|
let $disconnect_timeout = 10;
|
|
|
|
# Wait for any previous disconnects to finish.
|
|
FLUSH STATUS;
|
|
--disable_query_log
|
|
--disable_result_log
|
|
eval SET @wait_left = $disconnect_timeout;
|
|
let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
|
|
eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
|
|
let $wait_more = `SELECT @max_used_connections != 1 && @wait_left > 0`;
|
|
while ($wait_more)
|
|
{
|
|
sleep 1;
|
|
FLUSH STATUS;
|
|
SET @wait_left = @wait_left - 1;
|
|
let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
|
|
eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
|
|
let $wait_more = `SELECT @max_used_connections != 1 && @wait_left > 0`;
|
|
}
|
|
--enable_query_log
|
|
--enable_result_log
|
|
|
|
# Prerequisite.
|
|
SHOW STATUS LIKE 'max_used_connections';
|
|
|
|
# Save original setting.
|
|
SET @save_thread_cache_size=@@thread_cache_size;
|
|
SET GLOBAL thread_cache_size=3;
|
|
|
|
connect (con1,localhost,root,,);
|
|
connect (con2,localhost,root,,);
|
|
|
|
connection con1;
|
|
disconnect con2;
|
|
|
|
# Check that max_used_connections still reflects maximum value.
|
|
SHOW STATUS LIKE 'max_used_connections';
|
|
|
|
# Check that after flush max_used_connections equals to current number
|
|
# of connections. First wait for previous disconnect to finish.
|
|
FLUSH STATUS;
|
|
--disable_query_log
|
|
--disable_result_log
|
|
eval SET @wait_left = $disconnect_timeout;
|
|
let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
|
|
eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
|
|
let $wait_more = `SELECT @max_used_connections != 2 && @wait_left > 0`;
|
|
while ($wait_more)
|
|
{
|
|
sleep 1;
|
|
FLUSH STATUS;
|
|
SET @wait_left = @wait_left - 1;
|
|
let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
|
|
eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
|
|
let $wait_more = `SELECT @max_used_connections != 2 && @wait_left > 0`;
|
|
}
|
|
--enable_query_log
|
|
--enable_result_log
|
|
# Check that we don't count disconnected thread any longer.
|
|
SHOW STATUS LIKE 'max_used_connections';
|
|
|
|
# Check that max_used_connections is updated when cached thread is
|
|
# reused...
|
|
connect (con2,localhost,root,,);
|
|
SHOW STATUS LIKE 'max_used_connections';
|
|
|
|
# ...and when new thread is created.
|
|
connect (con3,localhost,root,,);
|
|
SHOW STATUS LIKE 'max_used_connections';
|
|
|
|
# Restore original setting.
|
|
connection default;
|
|
SET GLOBAL thread_cache_size=@save_thread_cache_size;
|
|
|
|
disconnect con3;
|
|
disconnect con2;
|
|
disconnect con1;
|
|
|
|
# End of 5.0 tests
|