1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

Merge ramayana.hindu.god:/home/tsmith/m/bk/bugteam/51

into  ramayana.hindu.god:/home/tsmith/m/bk/build/51
This commit is contained in:
tsmith@ramayana.hindu.god
2008-04-29 20:55:48 -06:00
37 changed files with 563 additions and 343 deletions

View File

@@ -112,6 +112,7 @@ extern int myrg_reset(MYRG_INFO *info);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
key_range *min_key, key_range *max_key); key_range *min_key, key_range *max_key);
extern ha_rows myrg_records(MYRG_INFO *info);
extern ulonglong myrg_position(MYRG_INFO *info); extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -2420,13 +2420,7 @@ sub setup_vardir() {
{ {
# on windows, copy all files from std_data into var/std_data_ln # on windows, copy all files from std_data into var/std_data_ln
mkpath("$opt_vardir/std_data_ln"); mkpath("$opt_vardir/std_data_ln");
opendir(DIR, "$glob_mysql_test_dir/std_data") mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
or mtr_error("Can't find the std_data directory: $!");
for(readdir(DIR)) {
next if -d "$glob_mysql_test_dir/std_data/$_";
copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_");
}
closedir(DIR);
} }
# Remove old log files # Remove old log files

View File

@@ -247,4 +247,11 @@ t1 CREATE TABLE `t1` (
`c2` text NOT NULL `c2` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=gbk ) ENGINE=MyISAM DEFAULT CHARSET=gbk
drop table t1; drop table t1;
CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gbk,
b MEDIUMTEXT CHARACTER SET big5);
INSERT INTO t1 VALUES
(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
DROP TABLES t1;
End of 5.0 tests End of 5.0 tests

View File

@@ -694,7 +694,7 @@ INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
(1, 2, 3); (1, 2, 3);
EXPLAIN SELECT DISTINCT a, b, d, c FROM t1; EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 16 NULL 6 Using index 1 SIMPLE t1 range NULL PRIMARY 16 NULL 7 Using index for group-by; Using temporary
SELECT DISTINCT a, b, d, c FROM t1; SELECT DISTINCT a, b, d, c FROM t1;
a b d c a b d c
1 1 0 1 1 1 0 1

View File

@@ -2006,3 +2006,19 @@ test.t1 optimize status OK
FLUSH TABLES m1, t1; FLUSH TABLES m1, t1;
UNLOCK TABLES; UNLOCK TABLES;
DROP TABLE t1, m1; DROP TABLE t1, m1;
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t4(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2))
ENGINE=MRG_MYISAM UNION=(t1, t2, t3);
INSERT INTO t1 VALUES (1,1), (1,2),(1,3), (1,4);
INSERT INTO t2 VALUES (2,1), (2,2),(2,3), (2,4);
INSERT INTO t3 VALUES (3,1), (3,2),(3,3), (3,4);
EXPLAIN SELECT COUNT(*) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
EXPLAIN SELECT COUNT(*) FROM t4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
DROP TABLE t1, t2, t3, t4;
End of 5.1 tests

View File

@@ -1458,3 +1458,29 @@ ORDER BY t2.c LIMIT 1;
d d
52.5 52.5
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
CREATE TABLE t1 (
id1 INT NULL,
id2 INT NOT NULL,
junk INT NOT NULL,
PRIMARY KEY (id1, id2, junk),
INDEX id2_j_id1 (id2, junk, id1)
);
INSERT INTO t1 VALUES (1, 1, 1), (2, 1, 2), (3, 1, 3), (4, 1, 4);
INSERT INTO t1 VALUES (5, 2, 1), (6, 2, 2), (7, 2, 3), (8, 2, 4);
INSERT INTO t1 VALUES (9, 3, 1), (10, 3, 2), (11, 3, 3), (12, 3, 4);
INSERT INTO t1 VALUES (13, 4, 1), (14, 4, 2), (15, 4, 3), (16, 4, 4);
INSERT INTO t1 VALUES (17, 5, 1), (18, 5, 2), (19, 5, 3), (20, 5, 4);
INSERT INTO t1 VALUES (21, 6, 1), (22, 6, 2), (23, 6, 3), (24, 6, 4);
INSERT INTO t1 VALUES (25, 7, 1), (26, 7, 2), (27, 7, 3), (28, 7, 4);
INSERT INTO t1 VALUES (29, 8, 1), (30, 8, 2), (31, 8, 3), (32, 8, 4);
INSERT INTO t1 VALUES (33, 9, 1), (34, 9, 2), (35, 9, 3), (36, 9, 4);
EXPLAIN SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref id2_j_id1 id2_j_id1 4 const 4 Using where; Using index; Using filesort
SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
id1
13
14
15
16
DROP TABLE t1;

View File

@@ -4339,6 +4339,13 @@ a4 f3 a6
1 NULL NULL 1 NULL NULL
2 NULL NULL 2 NULL NULL
DROP TABLE t1, t2, t3, t4; DROP TABLE t1, t2, t3, t4;
create table t1 (a float(5,4) zerofill);
create table t2 (a float(5,4),b float(2,0));
select t1.a from t1 where
t1.a= (select b from t2 limit 1) and not
t1.a= (select a from t2 limit 1) ;
a
drop table t1, t2;
End of 5.0 tests. End of 5.0 tests.
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22); INSERT INTO t1 VALUES (2,22),(1,11),(2,22);

View File

@@ -770,4 +770,13 @@ SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
1 1
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
CREATE TABLE t2 SELECT * FROM t1;
SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
1
1
1
1
DROP TABLE t1, t2;
End of 5.0 tests End of 5.0 tests

View File

@@ -946,4 +946,11 @@ SELECT ROUND(20061108085411.000002);
ROUND(20061108085411.000002) ROUND(20061108085411.000002)
20061108085411 20061108085411
DROP TABLE t1, t2, t3, t4, t5, t6; DROP TABLE t1, t2, t3, t4, t5, t6;
create table t1(`c` decimal(9,2));
insert into t1 values (300),(201.11);
select max(case 1 when 1 then c else null end) from t1 group by c;
max(case 1 when 1 then c else null end)
201.11
300.00
drop table t1;
End of 5.0 tests End of 5.0 tests

View File

@@ -53,8 +53,9 @@
# WL#3982 Test information_schema.processlist # # WL#3982 Test information_schema.processlist #
# # # #
# Last update: # # Last update: #
# 2007-08-14 mleich Corrections # # 2008-04-14 pcrews replace HOST to account for Windows' use of #
# # # localhost (host:<port> causing diffs on Windows #
# test runs #
######################################################################## ########################################################################
# The following variables are used in "datadict_priv.inc" and here. # The following variables are used in "datadict_priv.inc" and here.
@@ -112,11 +113,11 @@ connect (con100,localhost,ddicttestuser1,ddictpass,information_schema);
--echo #################################################################################### --echo ####################################################################################
connection default; connection default;
eval SHOW CREATE TABLE $table; eval SHOW CREATE TABLE $table;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SHOW $table; eval SHOW $table;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SELECT * FROM $table $select_where ORDER BY id; eval SELECT * FROM $table $select_where ORDER BY id;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SELECT $columns FROM $table $select_where ORDER BY id; eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc --source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3 --real_sleep 0.3
@@ -128,11 +129,11 @@ connection con100;
--echo SHOW/SELECT shows only the processes (1) of the user. --echo SHOW/SELECT shows only the processes (1) of the user.
--echo #################################################################################### --echo ####################################################################################
eval SHOW CREATE TABLE $table; eval SHOW CREATE TABLE $table;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SHOW $table; eval SHOW $table;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SELECT * FROM $table $select_where ORDER BY id; eval SELECT * FROM $table $select_where ORDER BY id;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
eval SELECT $columns FROM $table $select_where ORDER BY id; eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc --source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3 --real_sleep 0.3
@@ -154,9 +155,9 @@ GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
--echo #################################################################################### --echo ####################################################################################
connection con100; connection con100;
SHOW GRANTS; SHOW GRANTS;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -166,9 +167,9 @@ SELECT * FROM information_schema.processlist;
--echo #################################################################################### --echo ####################################################################################
connect (con101,localhost,ddicttestuser1,ddictpass,information_schema); connect (con101,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS; SHOW GRANTS;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -188,9 +189,9 @@ GRANT PROCESS ON *.* TO ''@'localhost';
--echo #################################################################################### --echo ####################################################################################
connect (anonymous1,localhost,'',,information_schema); connect (anonymous1,localhost,'',,information_schema);
SHOW GRANTS; SHOW GRANTS;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -210,9 +211,9 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema);
--echo ddicttestuser1 are visible. --echo ddicttestuser1 are visible.
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS; SHOW GRANTS;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -235,10 +236,10 @@ SHOW GRANTS FOR ''@'localhost';
if ($fixed_bug_30395) if ($fixed_bug_30395)
{ {
# Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ... # Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ...
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
} }
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -257,9 +258,9 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Only the processes of ddicttestuser1 user are visible. --echo Only the processes of ddicttestuser1 user are visible.
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -279,9 +280,9 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Only the processes of ddicttestuser1 are visible. --echo Only the processes of ddicttestuser1 are visible.
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -326,9 +327,9 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema);
--echo ddicttestuser2 has now the PROCESS privilege and sees all connections --echo ddicttestuser2 has now the PROCESS privilege and sees all connections
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -347,9 +348,9 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema);
--echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects --echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS; SHOW GRANTS;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -370,9 +371,9 @@ connect (con107,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--error ER_ACCESS_DENIED_ERROR --error ER_ACCESS_DENIED_ERROR
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3
@@ -394,9 +395,9 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. --echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
--echo #################################################################################### --echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SHOW processlist; SHOW processlist;
--replace_column 1 ID 6 TIME --replace_column 1 ID 3 HOST_NAME 6 TIME
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
--real_sleep 0.3 --real_sleep 0.3

View File

@@ -34,7 +34,11 @@
# WL#3982 Test information_schema.processlist # # WL#3982 Test information_schema.processlist #
# 2008-01-05 HHunger Changed time test and long statement test. # # 2008-01-05 HHunger Changed time test and long statement test. #
# It could happen that the long statement test # # It could happen that the long statement test #
# fail due to timing problems. # # # # fail due to timing problems. #
# 2008-04-14 pcrews Changed --replace_columns to include host #
# this is due to failure occurring on Windows #
# Win results included port number as well causing #
# test failures #
######################################################################## ########################################################################
# Basic preparations # Basic preparations
@@ -76,9 +80,9 @@ SHOW FULL PROCESSLIST;
# #
# Expect to see now DB = 'information_schema' # Expect to see now DB = 'information_schema'
USE information_schema; USE information_schema;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
# #
# Expect to see now INFO = 'SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;' # Expect to see now INFO = 'SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;'
@@ -139,9 +143,9 @@ WHERE USER = 'ddicttestuser1';
--echo --echo
--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) ----- --echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
connection ddicttestuser1; connection ddicttestuser1;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
@@ -156,9 +160,9 @@ connect (con2,localhost,ddicttestuser1,ddictpass,information_schema);
let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep'; WHERE COMMAND = 'Sleep';
--source include/wait_condition.inc --source include/wait_condition.inc
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
# #
--echo --echo
@@ -285,9 +289,9 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
# #
# Expect to see the state 'Locked' for the second connection because the SELECT # Expect to see the state 'Locked' for the second connection because the SELECT
# collides with the WRITE TABLE LOCK. # collides with the WRITE TABLE LOCK.
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 6 <TIME> --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
UNLOCK TABLES; UNLOCK TABLES;
# #

View File

@@ -35,16 +35,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Query TIME NULL SHOW processlist ID root HOST_NAME information_schema Query TIME NULL SHOW processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
SELECT * FROM processlist ORDER BY id; SELECT * FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID root localhost information_schema Query TIME executing SELECT * FROM processlist ORDER BY id ID root HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO 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 USER HOST DB COMMAND TIME STATE INFO
ID root localhost information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id ID root HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist; INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -105,13 +105,13 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM processlist ORDER BY id; SELECT * FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM processlist ORDER BY id ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO 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 USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist; INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -170,10 +170,10 @@ Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
#################################################################################### ####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege) 4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads. SHOW/SELECT shows all processes/threads.
@@ -183,14 +183,14 @@ Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
5 Grant PROCESS privilege to anonymous user. 5 Grant PROCESS privilege to anonymous user.
connection default (user=root) connection default (user=root)
@@ -206,16 +206,16 @@ Grants for @localhost
GRANT PROCESS ON *.* TO ''@'localhost' GRANT PROCESS ON *.* TO ''@'localhost'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Query TIME NULL SHOW processlist ID HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1 6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -231,14 +231,14 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1 7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -254,8 +254,8 @@ Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost' GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1 8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -270,16 +270,16 @@ Grants for ddicttestuser1@localhost
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1 9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -295,18 +295,18 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1. 10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root) connection default (user=root)
@@ -343,30 +343,30 @@ Grants for ddicttestuser2@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser2 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2 11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1; connection ddicttestuser1;
@@ -381,12 +381,12 @@ Grants for ddicttestuser2@localhost
GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser2 localhost information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser2 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser2 localhost information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1 11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -404,24 +404,24 @@ GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1 12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -439,26 +439,26 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Query TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1. 12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root) connection default (user=root)

View File

@@ -35,16 +35,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Query TIME NULL SHOW processlist ID root HOST_NAME information_schema Query TIME NULL SHOW processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
SELECT * FROM processlist ORDER BY id; SELECT * FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID root localhost information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id ID root HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO 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 USER HOST DB COMMAND TIME STATE INFO
ID root localhost information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id 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 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist; INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -105,13 +105,13 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM processlist ORDER BY id; SELECT * FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id 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; SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost 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 Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist; INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -170,10 +170,10 @@ Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
#################################################################################### ####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege) 4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads. SHOW/SELECT shows all processes/threads.
@@ -183,14 +183,14 @@ Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
5 Grant PROCESS privilege to anonymous user. 5 Grant PROCESS privilege to anonymous user.
connection default (user=root) connection default (user=root)
@@ -206,16 +206,16 @@ Grants for @localhost
GRANT PROCESS ON *.* TO ''@'localhost' GRANT PROCESS ON *.* TO ''@'localhost'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Query TIME NULL SHOW processlist ID HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1 6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -231,14 +231,14 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1 7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -254,8 +254,8 @@ Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost' GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1 8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -270,16 +270,16 @@ Grants for ddicttestuser1@localhost
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1 9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -295,18 +295,18 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1. 10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root) connection default (user=root)
@@ -343,30 +343,30 @@ Grants for ddicttestuser2@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser2 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID localhost information_schema Sleep TIME NULL ID HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID root localhost information_schema Sleep TIME NULL ID root HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2 11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1; connection ddicttestuser1;
@@ -381,12 +381,12 @@ Grants for ddicttestuser2@localhost
GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser2 localhost information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser2 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser2 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser2 localhost information_schema Sleep TIME NULL ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1 11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -404,24 +404,24 @@ GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1 12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root) connection default (user=root)
@@ -439,26 +439,26 @@ Grants for ddicttestuser1@localhost
GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist; SHOW processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist
SELECT * FROM information_schema.processlist; SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
ID ddicttestuser1 localhost information_schema Execute TIME executing SELECT * FROM information_schema.processlist ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
ID ddicttestuser1 localhost information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL
#################################################################################### ####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1. 12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root) connection default (user=root)

View File

@@ -31,10 +31,10 @@ Id User Host db Command Time State Info
USE information_schema; USE information_schema;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> root localhost information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
INFO INFO
SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST
@@ -58,20 +58,20 @@ ID = @my_proclist_id + 1
----- switch to connection ddicttestuser1 (user = ddicttestuser1) ----- ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
----- establish connection con2 (user = ddicttestuser1) ------ ----- establish connection con2 (user = ddicttestuser1) ------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL <ID> ddicttestuser1 <HOST_NAME> information_schema Sleep <TIME> NULL
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL <ID> ddicttestuser1 <HOST_NAME> information_schema Sleep <TIME> NULL
<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
----- switch to connection default (user = root) ----- ----- switch to connection default (user = root) -----
----- close connection con2 ----- ----- close connection con2 -----
@@ -135,12 +135,12 @@ SELECT COUNT(*) FROM test.t1;
# Sleep some time # Sleep some time
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1 <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
<ID> root localhost information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1 <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
UNLOCK TABLES; UNLOCK TABLES;
----- switch to connection ddicttestuser1 (user = ddicttestuser1) ----- ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----

View File

@@ -31,10 +31,10 @@ Id User Host db Command Time State Info
USE information_schema; USE information_schema;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> root localhost information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
INFO INFO
SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST
@@ -58,20 +58,20 @@ ID = @my_proclist_id + 1
----- switch to connection ddicttestuser1 (user = ddicttestuser1) ----- ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
----- establish connection con2 (user = ddicttestuser1) ------ ----- establish connection con2 (user = ddicttestuser1) ------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL <ID> ddicttestuser1 <HOST_NAME> information_schema Sleep <TIME> NULL
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL <ID> ddicttestuser1 <HOST_NAME> information_schema Sleep <TIME> NULL
<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
----- switch to connection default (user = root) ----- ----- switch to connection default (user = root) -----
----- close connection con2 ----- ----- close connection con2 -----
@@ -135,12 +135,12 @@ SELECT COUNT(*) FROM test.t1;
# Sleep some time # Sleep some time
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO ID USER HOST DB COMMAND TIME STATE INFO
<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1 <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
<ID> root localhost information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW FULL PROCESSLIST; SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Id User Host db Command Time State Info
<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST <ID> root <HOST_NAME> information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1 <ID> ddicttestuser1 <HOST_NAME> information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
UNLOCK TABLES; UNLOCK TABLES;
----- switch to connection ddicttestuser1 (user = ddicttestuser1) ----- ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----

View File

@@ -14,5 +14,3 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when up
ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
#ndb_binlog_discover : bug#21806 2006-08-24

View File

@@ -1,21 +1,21 @@
################################################################################ ################################################################################
# inc/partition_layout_check1.inc # # inc/partition_layout_check1.inc #
# # # #
# Purpose: # # Purpose: #
# Store the SHOW CREATE TABLE output and the list of files belonging to # # Store the SHOW CREATE TABLE output and the list of files belonging to #
# this table + print this into the protocol # # this table + print this into the protocol #
# This script is only usefule when sourced within the partitioning tests. # # This script is only usefule when sourced within the partitioning tests. #
# # # #
# Attention: The routine inc/partition_layout_check2.inc is very similar # # Attention: The routine inc/partition_layout_check2.inc is very similar #
# to this one. So if something has to be changed here it # # to this one. So if something has to be changed here it #
# might be necessary to do it also there # # might be necessary to do it also there #
# # # #
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Original Author: mleich # # Original Author: mleich #
# Original Date: 2006-03-05 # # Original Date: 2006-03-05 #
# Change Author: # # Change Author: pcrews #
# Change Date: # # Change Date: 2008-04-15 #
# Change: # # Change: Added --replace_result to account for Windows' use of '\r' #
################################################################################ ################################################################################
if ($no_debug) if ($no_debug)
@@ -31,32 +31,34 @@ DELETE FROM t0_definition;
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than # - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
# the corresponding SELECT on the INFORMATION_SCHEMA # the corresponding SELECT on the INFORMATION_SCHEMA
# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT # - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true let $show_file= $MYSQLTEST_VARDIR/master-data/test/tmp1;
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
if ($do_file_tests) if ($do_file_tests)
{ {
# List the files belonging to the table t1 # List the files belonging to the table t1
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2;
let $err_file= $MYSQLTEST_VARDIR/master-data/test/err2;
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $ls_file 2>$err_file || true
if ($with_directories) if ($with_directories)
{ {
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true --exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true --exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
} }
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'' eval SET @aux = load_file('$ls_file');
)');
let $file_list= `SELECT @aux`;
} }
if (!$do_file_tests) if (!$do_file_tests)
{ {
let $file_list= '--- not determined ---'; SET @aux = '--- not determined ---';
} }
# Insert the current definition of the table t1 into t0_definition # Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'old', eval INSERT INTO t0_definition SET state = 'old',
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'), create_command = load_file('$show_file'),
file_list = $file_list; file_list = @aux;
# Print the create table statement into the protocol # Print the create table statement into the protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR '\r' ''
SELECT create_command FROM t0_definition WHERE state = 'old'; SELECT create_command FROM t0_definition WHERE state = 'old';
if ($do_file_tests) if ($do_file_tests)
{ {
@@ -64,7 +66,7 @@ if ($do_file_tests)
if ($ls) if ($ls)
{ {
# Print the list of files into the protocol # Print the list of files into the protocol
eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR') eval SELECT REPLACE(@aux,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR')
AS "unified filelist" AS "unified filelist"
FROM t0_definition WHERE state = 'old'; FROM t0_definition WHERE state = 'old';
} }

View File

@@ -7,7 +7,7 @@
# since the call of inc/partition_layout_check1.inc # # since the call of inc/partition_layout_check1.inc #
# This script is only usefule when sourced within the partitioning tests. # # This script is only usefule when sourced within the partitioning tests. #
# # # #
# Attention: The routine inc/partition_layout_check1.inc is very similar # # Attention: The routine inc/partition_layout_check1.inc is very similar #
# to this one. So if something has to be changed here it # # to this one. So if something has to be changed here it #
# might be necessary to do it also there # # might be necessary to do it also there #
# # # #
@@ -27,28 +27,31 @@ if ($no_debug)
DELETE FROM t0_definition WHERE state = 'new'; DELETE FROM t0_definition WHERE state = 'new';
# Dump the current definition of the table t1 to tmp1 # Dump the current definition of the table t1 to tmp1
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true let $show_file= $MYSQLTEST_VARDIR/master-data/test/tmp1;
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
if ($do_file_tests) if ($do_file_tests)
{ {
# List the files belonging to the table t1 # List the files belonging to the table t1
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2;
let $err_file= $MYSQLTEST_VARDIR/master-data/test/err2;
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $ls_file 2>$err_file || true
if ($with_directories) if ($with_directories)
{ {
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true --exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true --exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
} }
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'')'); eval SET @aux = load_file('$ls_file');
let $file_list= `SELECT @aux`;
} }
if (!$do_file_tests) if (!$do_file_tests)
{ {
let $file_list= '--- not determined ---'; SET @aux = '--- not determined ---';
} }
# Insert the current definition of the table t1 into t0_definition # Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'new', eval INSERT INTO t0_definition SET state = 'new',
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'), create_command = load_file('$show_file'),
file_list = $file_list; file_list = @aux;
# Print the old and new table layout, if they differ # Print the old and new table layout, if they differ
SELECT COUNT(*) <> 1 INTO @aux SELECT COUNT(*) <> 1 INTO @aux

View File

@@ -16813,7 +16813,6 @@ $MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD
$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI $MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI
$MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm
$MYSQLTEST_VARDIR/master-data/test/t1.par $MYSQLTEST_VARDIR/master-data/test/t1.par
ls: $MYSQLTEST_VARDIR/mysql-test-data-dir/t1*: No such file or directory
$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI
$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI

View File

@@ -12,7 +12,4 @@
rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table) rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table)
rpl_view : Bug#32654: rpl_view.test fails randomly
rpl_ndb_multi : Bug#30751: rpl_ndb_multi missing row in output
rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes
rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_redirect : Failure is sporadic and and the test is superfluous (mats)

View File

@@ -53,4 +53,18 @@ alter table t1 change c1 c1 mediumtext character set gbk not null;
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# Bug#35993: severe memory corruption and crash with multibyte conversion
#
CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gbk,
b MEDIUMTEXT CHARACTER SET big5);
INSERT INTO t1 VALUES
(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
DROP TABLES t1;
--echo End of 5.0 tests --echo End of 5.0 tests

View File

@@ -9,13 +9,8 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
user_limits : Bug#23921 random failure of user_limits.test
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
federated_transactions : Bug#29523 Transactions do not work federated_transactions : Bug#29523 Transactions do not work
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
ctype_create : Bug#32965 main.ctype_create fails
status : Bug#32966 main.status fails status : Bug#32966 main.status fails
ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables

View File

@@ -1394,3 +1394,19 @@ FLUSH TABLES m1, t1;
UNLOCK TABLES; UNLOCK TABLES;
DROP TABLE t1, m1; DROP TABLE t1, m1;
#
# Bug#36006 - Optimizer does table scan for select count(*)
#
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t4(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2))
ENGINE=MRG_MYISAM UNION=(t1, t2, t3);
INSERT INTO t1 VALUES (1,1), (1,2),(1,3), (1,4);
INSERT INTO t2 VALUES (2,1), (2,2),(2,3), (2,4);
INSERT INTO t3 VALUES (3,1), (3,2),(3,3), (3,4);
EXPLAIN SELECT COUNT(*) FROM t1;
EXPLAIN SELECT COUNT(*) FROM t4;
DROP TABLE t1, t2, t3, t4;
--echo End of 5.1 tests

View File

@@ -1309,3 +1309,35 @@ WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
ORDER BY t2.c LIMIT 1; ORDER BY t2.c LIMIT 1;
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
#
# Bug#35844: Covering index for ref access not compatible with ORDER BY list
#
CREATE TABLE t1 (
id1 INT NULL,
id2 INT NOT NULL,
junk INT NOT NULL,
PRIMARY KEY (id1, id2, junk),
INDEX id2_j_id1 (id2, junk, id1)
);
INSERT INTO t1 VALUES (1, 1, 1), (2, 1, 2), (3, 1, 3), (4, 1, 4);
INSERT INTO t1 VALUES (5, 2, 1), (6, 2, 2), (7, 2, 3), (8, 2, 4);
INSERT INTO t1 VALUES (9, 3, 1), (10, 3, 2), (11, 3, 3), (12, 3, 4);
INSERT INTO t1 VALUES (13, 4, 1), (14, 4, 2), (15, 4, 3), (16, 4, 4);
INSERT INTO t1 VALUES (17, 5, 1), (18, 5, 2), (19, 5, 3), (20, 5, 4);
INSERT INTO t1 VALUES (21, 6, 1), (22, 6, 2), (23, 6, 3), (24, 6, 4);
INSERT INTO t1 VALUES (25, 7, 1), (26, 7, 2), (27, 7, 3), (28, 7, 4);
INSERT INTO t1 VALUES (29, 8, 1), (30, 8, 2), (31, 8, 3), (32, 8, 4);
INSERT INTO t1 VALUES (33, 9, 1), (34, 9, 2), (35, 9, 3), (36, 9, 4);
EXPLAIN SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
DROP TABLE t1;

View File

@@ -3213,6 +3213,18 @@ GROUP BY a4;
DROP TABLE t1, t2, t3, t4; DROP TABLE t1, t2, t3, t4;
#
# BUG#36139 "float, zerofill, crash with subquery"
#
create table t1 (a float(5,4) zerofill);
create table t2 (a float(5,4),b float(2,0));
select t1.a from t1 where
t1.a= (select b from t2 limit 1) and not
t1.a= (select a from t2 limit 1) ;
drop table t1, t2;
--echo End of 5.0 tests. --echo End of 5.0 tests.
# #

View File

@@ -605,4 +605,17 @@ SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Bug #36005: crash in subselect with single row
# (subselect_single_select_engine::exec)
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
CREATE TABLE t2 SELECT * FROM t1;
SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
DROP TABLE t1, t2;
--echo End of 5.0 tests --echo End of 5.0 tests

View File

@@ -521,4 +521,12 @@ SELECT ROUND(20061108085411.000002);
DROP TABLE t1, t2, t3, t4, t5, t6; DROP TABLE t1, t2, t3, t4, t5, t6;
#
# Bug#36023: Incorrect handling of zero length caused an assertion to fail.
#
create table t1(`c` decimal(9,2));
insert into t1 values (300),(201.11);
select max(case 1 when 1 then c else null end) from t1 group by c;
drop table t1;
--echo End of 5.0 tests --echo End of 5.0 tests

View File

@@ -4245,9 +4245,14 @@ static void convert_zerofill_number_to_string(Item **item, Field_num *field)
String tmp(buff,sizeof(buff), field->charset()), *res; String tmp(buff,sizeof(buff), field->charset()), *res;
res= (*item)->val_str(&tmp); res= (*item)->val_str(&tmp);
field->prepend_zeros(res); if ((*item)->is_null())
pos= (char *) sql_strmake (res->ptr(), res->length()); *item= new Item_null();
*item= new Item_string(pos, res->length(), field->charset()); else
{
field->prepend_zeros(res);
pos= (char *) sql_strmake (res->ptr(), res->length());
*item= new Item_string(pos, res->length(), field->charset());
}
} }

View File

@@ -169,14 +169,23 @@ inline int check_result_and_overflow(uint mask, int result, my_decimal *val)
inline uint my_decimal_length_to_precision(uint length, uint scale, inline uint my_decimal_length_to_precision(uint length, uint scale,
bool unsigned_flag) bool unsigned_flag)
{ {
return (uint) (length - (scale>0 ? 1:0) - (unsigned_flag ? 0:1)); /* Precision can't be negative thus ignore unsigned_flag when length is 0. */
DBUG_ASSERT(length || !scale);
return (uint) (length - (scale>0 ? 1:0) -
(unsigned_flag || !length ? 0:1));
} }
inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale, inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale,
bool unsigned_flag) bool unsigned_flag)
{ {
/*
When precision is 0 it means that original length was also 0. Thus
unsigned_flag is ignored in this case.
*/
DBUG_ASSERT(precision || !scale);
set_if_smaller(precision, DECIMAL_MAX_PRECISION); set_if_smaller(precision, DECIMAL_MAX_PRECISION);
return (uint32)(precision + (scale>0 ? 1:0) + (unsigned_flag ? 0:1)); return (uint32)(precision + (scale>0 ? 1:0) +
(unsigned_flag || !precision ? 0:1));
} }
inline inline

View File

@@ -846,6 +846,7 @@ JOIN::optimize()
"Impossible HAVING" : "Impossible WHERE")); "Impossible HAVING" : "Impossible WHERE"));
zero_result_cause= having_value == Item::COND_FALSE ? zero_result_cause= having_value == Item::COND_FALSE ?
"Impossible HAVING" : "Impossible WHERE"; "Impossible HAVING" : "Impossible WHERE";
tables= 0;
error= 0; error= 0;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@@ -12966,6 +12967,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
uint tablenr= tab - join->join_tab; uint tablenr= tab - join->join_tab;
ha_rows table_records= table->file->stats.records; ha_rows table_records= table->file->stats.records;
bool group= join->group && order == join->group_list; bool group= join->group && order == join->group_list;
ha_rows ref_key_quick_rows= HA_POS_ERROR;
LINT_INIT(best_key_parts); LINT_INIT(best_key_parts);
LINT_INIT(best_key_direction); LINT_INIT(best_key_direction);
LINT_INIT(best_records); LINT_INIT(best_records);
@@ -12999,6 +13001,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
else else
keys= usable_keys; keys= usable_keys;
if (ref_key >= 0 && table->covering_keys.is_set(ref_key))
ref_key_quick_rows= table->quick_rows[ref_key];
read_time= join->best_positions[tablenr].read_time; read_time= join->best_positions[tablenr].read_time;
for (uint i= tablenr+1; i < join->tables; i++) for (uint i= tablenr+1; i < join->tables; i++)
fanout*= join->best_positions[i].records_read; // fanout is always >= 1 fanout*= join->best_positions[i].records_read; // fanout is always >= 1
@@ -13093,7 +13098,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
index_scan_time < read_time) index_scan_time < read_time)
{ {
ha_rows quick_records= table_records; ha_rows quick_records= table_records;
if (is_best_covering && !is_covering) if (is_best_covering && !is_covering ||
is_covering && ref_key_quick_rows < select_limit)
continue; continue;
if (table->quick_keys.is_set(nr)) if (table->quick_keys.is_set(nr))
quick_records= table->quick_rows[nr]; quick_records= table->quick_rows[nr];

View File

@@ -26,7 +26,7 @@ SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myr
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c) myrg_write.c myrg_records.c)
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(myisammrg ${MYISAMMRG_SOURCES}) ADD_LIBRARY(myisammrg ${MYISAMMRG_SOURCES})

View File

@@ -35,7 +35,7 @@ libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \ myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \ myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \
ha_myisammrg.cc \ ha_myisammrg.cc \
myrg_rnext_same.c myrg_rnext_same.c myrg_records.c
EXTRA_DIST = CMakeLists.txt plug.in EXTRA_DIST = CMakeLists.txt plug.in

View File

@@ -1154,6 +1154,12 @@ int ha_myisammrg::check(THD* thd, HA_CHECK_OPT* check_opt)
} }
ha_rows ha_myisammrg::records()
{
return myrg_records(file);
}
extern int myrg_panic(enum ha_panic_function flag); extern int myrg_panic(enum ha_panic_function flag);
int myisammrg_panic(handlerton *hton, ha_panic_function flag) int myisammrg_panic(handlerton *hton, ha_panic_function flag)
{ {

View File

@@ -42,6 +42,7 @@ class ha_myisammrg: public handler
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD | HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD |
HA_HAS_RECORDS |
HA_NO_COPY_ON_ALTER); HA_NO_COPY_ON_ALTER);
} }
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const
@@ -94,4 +95,5 @@ class ha_myisammrg: public handler
TABLE *table_ptr() { return table; } TABLE *table_ptr() { return table; }
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
int check(THD* thd, HA_CHECK_OPT* check_opt); int check(THD* thd, HA_CHECK_OPT* check_opt);
ha_rows records();
}; };

View File

@@ -0,0 +1,27 @@
/* Copyright (C) 2008 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "myrg_def.h"
ha_rows myrg_records(MYRG_INFO *info)
{
ha_rows records=0;
MYRG_TABLE *file;
DBUG_ENTER("myrg_records");
for (file=info->open_tables ; file != info->end_table ; file++)
records+= file->table->s->state.state.records;
DBUG_RETURN(records);
}

View File

@@ -307,15 +307,17 @@ static size_t my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)),
{ {
uint16 e; uint16 e;
size_t dstlen= len; size_t dstlen= len;
uchar *dest_end= dest + dstlen;
len = srclen; len = srclen;
while (len--) while (len-- && dest < dest_end)
{ {
if ((len > 0) && isbig5code(*src, *(src+1))) if ((len > 0) && isbig5code(*src, *(src+1)))
{ {
e = big5strokexfrm((uint16) big5code(*src, *(src+1))); e = big5strokexfrm((uint16) big5code(*src, *(src+1)));
*dest++ = big5head(e); *dest++ = big5head(e);
*dest++ = big5tail(e); if (dest < dest_end)
*dest++ = big5tail(e);
src +=2; src +=2;
len--; len--;
} else } else

View File

@@ -2668,15 +2668,17 @@ static size_t my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
{ {
uint16 e; uint16 e;
size_t dstlen= len; size_t dstlen= len;
uchar *dest_end= dest + dstlen;
len = srclen; len = srclen;
while (len--) while (len-- && dest < dest_end)
{ {
if ((len > 0) && isgbkcode(*src, *(src+1))) if ((len > 0) && isgbkcode(*src, *(src+1)))
{ {
e = gbksortorder((uint16) gbkcode(*src, *(src+1))); e = gbksortorder((uint16) gbkcode(*src, *(src+1)));
*dest++ = gbkhead(e); *dest++ = gbkhead(e);
*dest++ = gbktail(e); if (dest < dest_end)
*dest++ = gbktail(e);
src+=2; src+=2;
len--; len--;
} else } else