mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
		
			
				
	
	
		
			264 lines
		
	
	
		
			7.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			264 lines
		
	
	
		
			7.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
--source include/have_profiling.inc
 | 
						|
 | 
						|
# Verify that the protocol isn't violated if we ask for profiling info
 | 
						|
# before profiling has recorded anything.
 | 
						|
show profiles;
 | 
						|
show profile all;
 | 
						|
 | 
						|
# default is OFF
 | 
						|
show session variables like 'profil%';
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
# But size is okay
 | 
						|
set @start_value= @@global.profiling_history_size;
 | 
						|
set global profiling_history_size=100;
 | 
						|
show global variables like 'profil%';
 | 
						|
 | 
						|
# turn on for testing
 | 
						|
set session profiling = ON;
 | 
						|
set session profiling_history_size=30;  # small enough to overflow
 | 
						|
 | 
						|
# verify it is active
 | 
						|
show session variables like 'profil%';
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
#   Profiling is a descriptive look into the way the server operated
 | 
						|
#   in retrospect.  Chad doesn't think it's wise to include the result
 | 
						|
#   log, as this creates a proscriptive specification about how the 
 | 
						|
#   server should work in the future -- or it forces everyone who 
 | 
						|
#   changes the server significantly to record the test results again,
 | 
						|
#   and that violates the spirit of our tests.  Please don't include
 | 
						|
#   execution-specific data here, as in all of the "show profile" and
 | 
						|
#   information_schema.profiling results.
 | 
						|
 | 
						|
create table t1 (
 | 
						|
  a int,
 | 
						|
  b int
 | 
						|
);
 | 
						|
insert into t1 values (1,1), (2,null), (3, 4);
 | 
						|
insert into t1 values (5,1), (6,null), (7, 4);
 | 
						|
insert into t1 values (1,1), (2,null), (3, 4);
 | 
						|
insert into t1 values (5,1), (6,null), (7, 4);
 | 
						|
select max(x) from (select sum(a) as x from t1 group by b) as teeone;
 | 
						|
insert into t1 select * from t1;
 | 
						|
select count(*) from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
select count(*) from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
insert into t1 select * from t1;
 | 
						|
select count(*) from t1;
 | 
						|
select sum(a) from t1;
 | 
						|
select sum(a) from t1 group by b;
 | 
						|
select sum(a) + sum(b) from t1 group by b;
 | 
						|
select max(x) from (select sum(a) as x from t1 group by b) as teeone;
 | 
						|
select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890' as big_string;
 | 
						|
 | 
						|
--enable_result_log
 | 
						|
--replace_column 2 #
 | 
						|
show profiles;
 | 
						|
 | 
						|
--disable_result_log
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile for query 15;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile cpu for query 15;
 | 
						|
###--replace_column 2 # 3 # 4 # 5 # 6 #
 | 
						|
show profile cpu, block io for query 15;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile cpu for query 9 limit 2 offset 2;
 | 
						|
show profile cpu for query 10 limit 0;
 | 
						|
--error 0,ER_WRONG_ARGUMENTS
 | 
						|
show profile cpu for query 65534;
 | 
						|
###--replace_column 2 #
 | 
						|
show profile memory;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile block io;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile context switches;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile page faults;
 | 
						|
###--replace_column 2 # 3 # 4 #
 | 
						|
show profile ipc;
 | 
						|
###--replace_column 2 #
 | 
						|
show profile swaps limit 1 offset 2;
 | 
						|
###--replace_column 2 # 5 #
 | 
						|
show profile source;
 | 
						|
show profile all for query 0 limit 0;
 | 
						|
###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
 | 
						|
show profile all for query 15;
 | 
						|
###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
 | 
						|
 | 
						|
select * from information_schema.profiling;
 | 
						|
select query_id, state, duration from information_schema.profiling;
 | 
						|
select query_id, sum(duration) from information_schema.profiling group by query_id;
 | 
						|
select query_id, count(*) from information_schema.profiling group by query_id;
 | 
						|
select sum(duration) from information_schema.profiling;
 | 
						|
 | 
						|
# Broken down into number of stages and duration of each query.
 | 
						|
select query_id, count(*), sum(duration) from information_schema.profiling group by query_id;
 | 
						|
select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling;
 | 
						|
 | 
						|
 | 
						|
--enable_result_log
 | 
						|
drop table if exists t1, t2, t3;
 | 
						|
create table t1 (id int );
 | 
						|
create table t2 (id int not null);
 | 
						|
create table t3 (id int not null primary key);
 | 
						|
insert into t1 values (1), (2), (3);
 | 
						|
insert into t2 values (1), (2), (3);
 | 
						|
insert into t3 values (1), (2), (3);
 | 
						|
 | 
						|
--replace_column 2 #
 | 
						|
show profiles;
 | 
						|
 | 
						|
select * from t1;
 | 
						|
--replace_column 2 #
 | 
						|
show profiles;
 | 
						|
--echo This ^^ should end in "select * from t1;"
 | 
						|
 | 
						|
delete from t1;
 | 
						|
insert into t1 values (1), (2), (3);
 | 
						|
insert into t1 values (1), (2), (3);
 | 
						|
 | 
						|
select * from t1;
 | 
						|
--replace_column 2 #
 | 
						|
show profiles;
 | 
						|
 | 
						|
# Turning profiling off does freeze it
 | 
						|
set session profiling = OFF;
 | 
						|
select sum(id) from t1;
 | 
						|
--replace_column 2 #
 | 
						|
show profiles;
 | 
						|
 | 
						|
##  Verify that the various juggling of THD contexts doesn't affect profiling.
 | 
						|
 | 
						|
##  Functions and procedures
 | 
						|
set session profiling = ON;
 | 
						|
select @@profiling;
 | 
						|
create function f1() returns varchar(50) return 'hello';
 | 
						|
select @@profiling;
 | 
						|
select * from t1 where id <> f1();
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
set session profiling = OFF;
 | 
						|
drop table if exists profile_log;
 | 
						|
create table profile_log (how_many int);
 | 
						|
 | 
						|
--disable_warnings
 | 
						|
drop procedure if exists p1;
 | 
						|
drop procedure if exists p2;
 | 
						|
drop procedure if exists p3;
 | 
						|
--enable_warnings
 | 
						|
 | 
						|
delimiter //;
 | 
						|
create procedure p1 () 
 | 
						|
  modifies sql data 
 | 
						|
begin 
 | 
						|
  set profiling = ON; 
 | 
						|
  select 'This p1 should show up in profiling'; 
 | 
						|
  insert into profile_log select count(*) from information_schema.profiling; 
 | 
						|
end//
 | 
						|
create procedure p2() 
 | 
						|
  deterministic 
 | 
						|
begin 
 | 
						|
  set profiling = ON; 
 | 
						|
  call p1(); 
 | 
						|
  select 'This p2 should show up in profiling'; 
 | 
						|
end//
 | 
						|
create procedure p3 () 
 | 
						|
  reads sql data 
 | 
						|
begin 
 | 
						|
  set profiling = ON; 
 | 
						|
  select 'This p3 should show up in profiling'; 
 | 
						|
  show profile; 
 | 
						|
end//
 | 
						|
delimiter ;//
 | 
						|
 | 
						|
--disable_result_log
 | 
						|
--echo first call to p1
 | 
						|
call p1;
 | 
						|
select * from profile_log;
 | 
						|
--echo second call to p1
 | 
						|
call p1;
 | 
						|
select * from profile_log;
 | 
						|
--echo third call to p1
 | 
						|
call p1;
 | 
						|
select * from profile_log;
 | 
						|
set session profiling = OFF;
 | 
						|
call p2;
 | 
						|
set session profiling = OFF;
 | 
						|
call p3;
 | 
						|
 | 
						|
--replace_column 1 # 2 #
 | 
						|
show profiles;
 | 
						|
--enable_result_log
 | 
						|
 | 
						|
drop procedure if exists p1;
 | 
						|
drop procedure if exists p2;
 | 
						|
drop procedure if exists p3;
 | 
						|
drop table if exists profile_log;
 | 
						|
 | 
						|
##  Triggers
 | 
						|
set session profiling = ON;
 | 
						|
drop table if exists t2;
 | 
						|
create table t2 (id int not null);
 | 
						|
create trigger t2_bi before insert on t2 for each row set @x=0;
 | 
						|
select @@profiling;
 | 
						|
insert into t2 values (1), (2), (3);
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
##  ALTER TABLE
 | 
						|
set session profiling = ON;
 | 
						|
drop table if exists t1, t2;
 | 
						|
create table t1 (id int not null primary key);
 | 
						|
create table t2 (id int not null primary key, id1 int not null);
 | 
						|
select @@profiling;
 | 
						|
alter table t2 add foreign key (id1) references t1 (id) on delete cascade;
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
##  Table LOCKing
 | 
						|
lock table t1 write; 
 | 
						|
select @@profiling;
 | 
						|
unlock table; 
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
##  Transactions
 | 
						|
set autocommit=0;
 | 
						|
select @@profiling, @@autocommit;
 | 
						|
begin;
 | 
						|
select @@profiling;
 | 
						|
insert into t1 values (1);
 | 
						|
insert into t2 values (1,1);
 | 
						|
--echo testing referential integrity cascade
 | 
						|
delete from t1 where id = 1;
 | 
						|
select @@profiling;
 | 
						|
--echo testing rollback
 | 
						|
--disable_warnings
 | 
						|
rollback;
 | 
						|
--enable_warnings
 | 
						|
select @@profiling;
 | 
						|
--echo testing commit
 | 
						|
begin;
 | 
						|
select @@profiling;
 | 
						|
commit;
 | 
						|
select @@profiling;
 | 
						|
 | 
						|
drop table if exists t1, t2, t3;
 | 
						|
drop view if exists v1;
 | 
						|
drop function if exists f1;
 | 
						|
 | 
						|
## Multiple queries in one packet.  Combo statements don't work with ps-proto.
 | 
						|
#--eval select 1; select 2; select 3;
 | 
						|
## two continuations, one starting
 | 
						|
#select state from information_schema.profiling where seq=1 order by query_id desc limit 3;
 | 
						|
 | 
						|
 | 
						|
## last thing in the file
 | 
						|
set session profiling = OFF;
 | 
						|
set global profiling_history_size= @start_value;
 | 
						|
##
 | 
						|
--echo End of 5.0 tests
 |