diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c6a65505fe..ea44226781a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,10 +318,12 @@ ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE) # Special handling for tmp tables with the Aria engine IF(WITH_ARIA_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_ARIA_STORAGE_ENGINE) - IF(WITH_MARIA_TMP_TABLES) + SET(WITH_ARIA_TMP_TABLES 1 CACHE BOOL "Use Aria for temporary tables") + IF(WITH_ARIA_TMP_TABLES) + MESSAGE(STATUS "Using Aria for temporary tables") ADD_DEFINITIONS(-DUSE_MARIA_FOR_TMP_TABLES) - ENDIF(WITH_MARIA_TMP_TABLES) -ENDIF(WITH_ARIA_STORAGE_ENGINE) + ENDIF() +ENDIF() ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS}) diff --git a/client/client_priv.h b/client/client_priv.h index ec67ed3ae2d..4daa624e726 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -60,6 +60,7 @@ enum options_client OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG, OPT_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT, + OPT_FLUSH_TABLES, #ifdef HAVE_NDBCLUSTER_DB OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 14e02bbb328..22f4b70ed81 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -16,7 +16,7 @@ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */ -#define CHECK_VERSION "2.6.0" +#define CHECK_VERSION "2.7.0" #include "client_priv.h" #include @@ -35,8 +35,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, - opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, - opt_write_binlog= 1; + opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0; +static my_bool opt_write_binlog= 1, opt_flush_tables= 0; static uint verbose = 0, opt_mysql_port=0; static int my_end_arg; static char * opt_mysql_unix_port = 0; @@ -121,6 +121,9 @@ static struct my_option my_long_options[] = "If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.", &opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"flush", OPT_FLUSH_TABLES, "Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check", + &opt_flush_tables, &opt_flush_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + 0, 0 }, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host",'h', "Connect to host.", ¤t_host, @@ -685,6 +688,7 @@ static int disable_binlog() static int handle_request_for_tables(char *tables, uint length) { char *query, *end, options[100], message[100]; + char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name; uint query_length= 0; const char *op = 0; @@ -723,13 +727,17 @@ static int handle_request_for_tables(char *tables, uint length) /* No backticks here as we added them before */ query_length= my_sprintf(query, (query, "%s TABLE %s %s", op, tables, options)); + table_name= tables; } else { - char *ptr; + char *ptr, *org; - ptr= strmov(strmov(query, op), " TABLE "); + org= ptr= strmov(strmov(query, op), " TABLE "); ptr= fix_table_name(ptr, tables); + strmake(table_name_buff, org, min((int) sizeof(table_name_buff)-1, + (int) (ptr - org))); + table_name= table_name_buff; ptr= strxmov(ptr, " ", options, NullS); query_length= (uint) (ptr - query); } @@ -737,9 +745,21 @@ static int handle_request_for_tables(char *tables, uint length) { sprintf(message, "when executing '%s TABLE ... %s'", op, options); DBerror(sock, message); + my_free(query, MYF(0)); return 1; } print_result(); + if (opt_flush_tables) + { + query_length= my_sprintf(query, + (query, "FLUSH TABLES %s", table_name)); + if (mysql_real_query(sock, query, query_length)) + { + DBerror(sock, query); + my_free(query, MYF(0)); + return 1; + } + } my_free(query, MYF(0)); return 0; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e2b2a3c2262..e7aad90ce3f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2355,9 +2355,11 @@ sub remove_stale_vardir () { mtr_report(" - WARNING: Using the 'mysql-test/var' symlink"); # Make sure the directory where it points exist - mtr_error("The destination for symlink $opt_vardir does not exist") - if ! -d readlink($opt_vardir); - + if (! -d readlink($opt_vardir)) + { + mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory"); + unlink($opt_vardir); + } foreach my $bin ( glob("$opt_vardir/*") ) { mtr_verbose("Removing bin $bin"); @@ -2424,8 +2426,11 @@ sub setup_vardir() { # it's a symlink # Make sure the directory where it points exist - mtr_error("The destination for symlink $opt_vardir does not exist") - if ! -d readlink($opt_vardir); + if (! -d readlink($opt_vardir)) + { + mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory"); + unlink($opt_vardir); + } } elsif ( $opt_mem ) { @@ -4957,14 +4962,13 @@ sub mysqld_arguments ($$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "--skip-safemalloc"); - if ( $mysql_version_id < 50100 ) { mtr_add_arg($args, "--skip-bdb"); } } + mtr_add_arg($args, "--loose-skip-safemalloc"); mtr_add_arg($args, "%s--disable-sync-frm"); # Retry bind as this may fail on busy server mtr_add_arg($args, "%s--port-open-timeout=10"); diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index e3ef617503f..b9d43a91b03 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3; +drop view if exists v1,v2; CREATE TABLE t1 (S1 INT); CREATE TABLE t2 (S1 INT); INSERT INTO t1 VALUES (1); @@ -1221,6 +1222,24 @@ f1 DEALLOCATE PREPARE stmt; DROP TABLE t1; # +# Bug LP:798597: Incorrect "Duplicate entry" error with views and +# GROUP BY +# +CREATE TABLE t1 ( f1 int NOT NULL , f2 int NOT NULL ) ; +INSERT INTO t1 VALUES (214,0),(6,6); +CREATE TABLE t2 ( f2 int) ; +INSERT INTO t2 VALUES (88),(88); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT t1.f1, t2.f2 FROM (t2 LEFT JOIN t1 ON (t2.f2 <> t1.f1)) WHERE (t1.f2 <= 0) ; +CREATE ALGORITHM=MERGE VIEW v2 AS SELECT t1.f1, t2.f2 FROM (t2 LEFT JOIN t1 ON (t2.f2 <> t1.f1)) WHERE (t1.f2 <= 0 or t1.f2 is null) ; +SELECT f1 , MIN(f2) FROM v1 GROUP BY f1; +f1 MIN(f2) +214 88 +SELECT f1 , MIN(f2) FROM v2 GROUP BY f1; +f1 MIN(f2) +214 88 +drop table t1,t2; +drop view v1,v2; +# # BUG#47217 Lost optimization caused slowdown & wrong result. # CREATE TABLE t1 (pk INT, v VARCHAR(2), PRIMARY KEY(pk)); diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 0791b979da1..4df5f1702c7 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -657,15 +657,16 @@ CREATE TABLE t1 (a INT) PARTITION BY HASH (a); FLUSH TABLES; CHECK TABLE t1; Table Op Msg_type Msg_text +test.t1 check Error File './test/t1.par' not found (Errcode: 2) test.t1 check Error Failed to read from the .par file test.t1 check Error Incorrect information in file: './test/t1.frm' test.t1 check error Corrupt SELECT * FROM t1; -ERROR HY000: Failed to read from the .par file +ERROR HY000: File './test/t1.par' not found (Errcode: 2) # Note that it is currently impossible to drop a partitioned table # without the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR HY000: File './test/t1.par' not found (Errcode: 2) # # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 # with temporary table and partitions diff --git a/mysql-test/r/plugin_innodb.result b/mysql-test/r/plugin_innodb.result new file mode 100644 index 00000000000..48510ad8745 --- /dev/null +++ b/mysql-test/r/plugin_innodb.result @@ -0,0 +1,11 @@ +install plugin example soname 'ha_example.so'; +create table t1(a int) engine=example; +drop table t1; +alter table mysql.plugin engine=innodb; +restart +create table t1(a int) engine=example; +select * from t1; +a +drop table t1; +alter table mysql.plugin engine=myisam; +uninstall plugin example; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index c5aabfe315c..c05c9549334 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -29,28 +29,29 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `COMMAND` varchar(16) NOT NULL DEFAULT '', `TIME` int(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000' ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL SELECT * FROM processlist ORDER BY id; -ID USER HOST DB COMMAND TIME STATE INFO -ID root HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id; -ID USER HOST DB COMMAND TIME STATE INFO -ID root HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID root HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS FROM processlist ORDER BY id; +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID root HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS FROM processlist ORDER BY id TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; UPDATE test.t_processlist SET user='horst' WHERE id=1 ; INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; -CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION; +CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS) AS SELECT * FROM processlist WITH CHECK OPTION; ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' -CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist; +CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS) AS SELECT * FROM processlist; UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' DROP VIEW test.v_processlist; @@ -99,25 +100,26 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `COMMAND` varchar(16) NOT NULL DEFAULT '', `TIME` int(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000' ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM processlist ORDER BY id; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id -SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS +SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS FROM processlist ORDER BY id; +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS FROM processlist ORDER BY id TIME_MS CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; UPDATE test.t_processlist SET user='horst' WHERE id=1 ; INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; -CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION; +CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS) AS SELECT * FROM processlist WITH CHECK OPTION; ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' -CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist; +CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS) AS SELECT * FROM processlist; UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP VIEW test.v_processlist; @@ -170,8 +172,8 @@ SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS #################################################################################### 4.2 New connection con101 (ddicttestuser1 with PROCESS privilege) SHOW/SELECT shows all processes/threads. @@ -185,10 +187,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID root HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 5 Grant PROCESS privilege to anonymous user. connection default (user=root) @@ -209,11 +211,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID root HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 6 Revoke PROCESS privilege from ddicttestuser1 connection default (user=root) @@ -233,10 +235,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 7 Revoke PROCESS privilege from anonymous user connection default (user=root) @@ -251,9 +253,9 @@ SHOW GRANTS FOR ''@'localhost'; Grants for @localhost GRANT USAGE ON *.* TO ''@'localhost' SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1 connection default (user=root) @@ -273,11 +275,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 9 Revoke SUPER privilege from user ddicttestuser1 connection default (user=root) @@ -299,12 +301,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 10 Grant SUPER privilege with grant option to user ddicttestuser1. connection default (user=root) @@ -353,18 +355,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID root HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2 connection ddicttestuser1; @@ -382,9 +384,9 @@ Id User Host db Command Time State Info ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1 connection default (user=root) @@ -411,15 +413,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 12 Revoke the SELECT privilege from user ddicttestuser1 connection default (user=root) @@ -447,16 +449,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist SELECT * FROM information_schema.processlist; -ID USER HOST DB COMMAND TIME STATE INFO -ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL -ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS +ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS #################################################################################### 12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1. connection default (user=root) diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result index 448c68eadb8..86f290daea7 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result @@ -19,140 +19,242 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `COMMAND` varchar(16) NOT NULL DEFAULT '', `TIME` int(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000' ) DEFAULT CHARSET=utf8 -SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST; -COUNT(*) -1 -USE test; +# Ensure that the information about the own connection is correct. +#-------------------------------------------------------------------------- + SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; -ID USER HOST DB COMMAND TIME STATE INFO - root localhost test Execute 0 executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST +ID USER HOST DB COMMAND TIME STATE INFO TIME_MS + root test Execute