From 4139bba2817387233e126d9e48084fc0c60718e7 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 13 Sep 2011 18:46:47 +0300 Subject: Increased version number Give proper error to client on shutdown. configure.in: Increased version number mysql-test/mysql-test-run.pl: Ignore errors that one can get while running with --mysqld=--log-warnings=2 mysql-test/r/variables.result: Remember original value of log_warnings mysql-test/suite/rpl/r/rpl_idempotency.result: Ignore errors that one can get while running with --mysqld=--log-warnings=2 mysql-test/suite/rpl/t/rpl_idempotency.test: Ignore errors that one can get while running with --mysqld=--log-warnings=2 mysql-test/t/variables.test: Remember original value of log_warnings sql/mysqld.cc: Give proper error to close_connection() on shutdown storage/maria/ha_maria.cc: Added missing DBUG_RETURN --- mysql-test/t/variables.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/t/variables.test') diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index ec6ed5702ee..2e1ecf9835a 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -36,6 +36,7 @@ set @my_thread_cache_size =@@global.thread_cache_size; set @my_max_allowed_packet =@@global.max_allowed_packet; set @my_delay_key_write =@@global.delay_key_write; set @my_join_buffer_size =@@global.join_buffer_size; +set @my_log_warnings =@@global.log_warnings; # case insensitivity tests (new in 5.0) set @`test`=1; select @test, @`test`, @TEST, @`TEST`, @"teSt"; @@ -843,6 +844,7 @@ set global thread_cache_size =@my_thread_cache_size; set global max_allowed_packet = default; set global delay_key_write =@my_delay_key_write; set global join_buffer_size =@my_join_buffer_size; +set global log_warnings =@my_log_warnings; # # Bug#28580 Repeatation of status variables -- cgit v1.2.1 From 7800d93bc3caca0143334941f626dc6aa3ff2b26 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 26 Sep 2011 20:26:47 +0300 Subject: Allow one to block an account by using GRANT max_user_connections = -1 One can set @@global.max_user_connections to -1 to block anyone, except SUPER user, to login. If max_user_connection is 0, one can't change it without a restart (needed to get user connections counting to work correctly) mysql-test/r/system_mysql_db.result: Changed max_user_connections to handle negative numbers. mysql-test/r/user_limits-2.result: New test case that one can't change max_user_connection if it was 0 mysql-test/r/user_limits.result: Fixed wrong error messages. mysql-test/r/variables.result: Store / restore max_user_connections (needed as there is now a --master.opt file that changes it) mysql-test/t/subselect_mat_cost-master.opt: Enable slow query log (as this test found some errors in slow query logging) mysql-test/t/user_limits-2.test: New test case that one can't change max_user_connection if it was 0 mysql-test/t/user_limits-master.opt: Set max_user_connections (as one can't change it if it was 0) mysql-test/t/user_limits.test: Test max_user_connections -1 mysql-test/t/variables-master.opt: Set max_user_connections (as one can't change it if it was 0) mysql-test/t/variables.test: Set/restore max_user_connections scripts/Makefile.am: Add a text message to mysql_fix_privilege_tables.sql that it's automaticly generated scripts/mysql_system_tables.sql: Change max_user_connections to signed scripts/mysql_system_tables_fix.sql: Change max_user_connections to signed sql/item_func.cc: Change SHOW_INT to be signed. (Needed for max_user_connections and it's probably a bug that it was not originally signed) sql/log.cc: Remove some code that was not needed (All these variables are reset at start of query) sql/mysql_priv.h: Made max_user_connections signed. Added max_user_connections_checking sql/mysqld.cc: Added max_user_connections_checking so that we know if max_user_connections was 0 at startup (Which means that we will not do connection counting for accounts that don't have user resource limits) Set thd->start_utime at same time as thr_create_utime. (Before start_utime could be < thr_create_utime which lead to wrong query counting) sql/set_var.cc: Don't allow one to change 'max_user_connections' if it was 0 at startup. sql/sql_acl.cc: Change user_connection counting to be negative. sql/sql_connect.cc: If max_user_connections is < 0 then only SUPER user can login. Fixed wrong variable names for error messages. Fixed wrong initial value for questions. Set thd->start_utime and thd->thr_create_utime at startup. Needed to get time_out_user_resource_limits() to work. sql/sql_show.cc: SHOW_INT is now negative sql/sql_yacc.yy: Support negative values for MAX_USER_CONNECTIONS sql/structs.h: Make user connect counting work with signed numbers. --- mysql-test/t/variables.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test/t/variables.test') diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 38bbd2c9de8..6a9d0372c0a 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -23,6 +23,7 @@ set @my_max_delayed_threads =@@global.max_delayed_threads; set @my_max_heap_table_size =@@global.max_heap_table_size; set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads; set @my_max_join_size =@@global.max_join_size; +set @my_max_user_connections =@@global.max_user_connections; set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size; set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size; set @my_net_buffer_length =@@global.net_buffer_length; @@ -830,7 +831,7 @@ set global max_delayed_threads =@my_max_delayed_threads; set global max_heap_table_size =@my_max_heap_table_size; set global max_insert_delayed_threads=@my_max_insert_delayed_threads; set global max_join_size =@my_max_join_size; -set global max_user_connections =default; +set global max_user_connections =@my_max_user_connections; set global max_write_lock_count =default; set global myisam_data_pointer_size =@my_myisam_data_pointer_size; set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size; -- cgit v1.2.1