Commit ddb4aa5d authored by Matthias Leich's avatar Matthias Leich

2. Slice of fix for Bug#42003 tests missing the disconnect of connections <> default

   - If missing: add "disconnect <session>"
   - If physical disconnect of non "default" sessions is not finished
     at test end: add routine which waits till this happened
+ additional improvements
  - remove superfluous files created by the test
  - replace error numbers by error names
  - remove trailing spaces, replace tabs by spaces
  - unify writing of bugs within comments
  - correct comments
  - minor changes of formatting
Fixed tests:
  backup
  check
  compress
  grant
  information_schema
  multi_update
  overflow
  packet
  query_cache_not_embedded
  sp-threads
  subselect
  synchronization
  timezone_grant
parent f8412b84
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3, t4;
create table t4(n int); create table t4(n int);
backup table t4 to '../bogus'; backup table t4 to '../bogus';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
......
drop table if exists t1; drop table if exists t1,t2;
drop view if exists v1;
create table t1(n int not null, key(n), key(n), key(n), key(n)); create table t1(n int not null, key(n), key(n), key(n), key(n));
check table t1 extended; check table t1 extended;
insert into t1 values (200000); insert into t1 values (200000);
......
...@@ -162,7 +162,7 @@ Warnings: ...@@ -162,7 +162,7 @@ Warnings:
Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'ssl_cipher' doesn't have a default value
Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value
Warning 1364 Field 'x509_subject' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value
insert into mysql.db (host, db, user, select_priv) values insert into mysql.db (host, db, user, select_priv) values
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
alter table mysql.db order by db asc; alter table mysql.db order by db asc;
flush privileges; flush privileges;
...@@ -262,7 +262,7 @@ drop user mysqltest_1@localhost; ...@@ -262,7 +262,7 @@ drop user mysqltest_1@localhost;
SET NAMES koi8r; SET NAMES koi8r;
CREATE DATABASE ; CREATE DATABASE ;
USE ; USE ;
CREATE TABLE ( int); CREATE TABLE ( INT);
GRANT SELECT ON .* TO @localhost; GRANT SELECT ON .* TO @localhost;
SHOW GRANTS FOR @localhost; SHOW GRANTS FOR @localhost;
Grants for @localhost Grants for @localhost
...@@ -381,21 +381,21 @@ grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; ...@@ -381,21 +381,21 @@ grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost''' WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE; ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO 'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO 'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO 'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO 'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost''' WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,PRIVILEGE_TYPE; ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost''' WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE; ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost''' WHERE GRANTEE = '''mysqltest_3''@''localhost'''
...@@ -880,11 +880,11 @@ flush privileges; ...@@ -880,11 +880,11 @@ flush privileges;
drop table t2; drop table t2;
drop table t1; drop table t1;
CREATE DATABASE mysqltest3; CREATE DATABASE mysqltest3;
use mysqltest3; USE mysqltest3;
CREATE TABLE t_nn (c1 INT); CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE VIEW v_nn AS SELECT * FROM t_nn;
CREATE DATABASE mysqltest2; CREATE DATABASE mysqltest2;
use mysqltest2; USE mysqltest2;
CREATE TABLE t_nn (c1 INT); CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE VIEW v_nn AS SELECT * FROM t_nn;
CREATE VIEW v_yn AS SELECT * FROM t_nn; CREATE VIEW v_yn AS SELECT * FROM t_nn;
...@@ -954,7 +954,7 @@ DROP TABLE mysqltest3.t_nn; ...@@ -954,7 +954,7 @@ DROP TABLE mysqltest3.t_nn;
DROP DATABASE mysqltest3; DROP DATABASE mysqltest3;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost'; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost'; DROP USER 'mysqltest_1'@'localhost';
use test; USE test;
create user mysqltest1_thisisreallytoolong; create user mysqltest1_thisisreallytoolong;
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16) ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost; GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
...@@ -1106,16 +1106,16 @@ DROP DATABASE mysqltest1; ...@@ -1106,16 +1106,16 @@ DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2; DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost; DROP USER mysqltest_2@localhost;
use test; USE test;
CREATE TABLE t1 (f1 int, f2 int); CREATE TABLE t1 (f1 int, f2 int);
INSERT INTO t1 VALUES(1,1), (2,2); INSERT INTO t1 VALUES(1,1), (2,2);
CREATE DATABASE db27878; CREATE DATABASE db27878;
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost'; GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost'; GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost'; GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
use db27878; USE db27878;
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1; CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
use db27878; USE db27878;
UPDATE v1 SET f2 = 4; UPDATE v1 SET f2 = 4;
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test.t1; SELECT * FROM test.t1;
...@@ -1127,7 +1127,7 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; ...@@ -1127,7 +1127,7 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
DROP DATABASE db27878; DROP DATABASE db27878;
use test; USE test;
DROP TABLE t1; DROP TABLE t1;
drop table if exists test; drop table if exists test;
Warnings: Warnings:
......
...@@ -75,7 +75,7 @@ t2 ...@@ -75,7 +75,7 @@ t2
t3 t3
t5 t5
v1 v1
select c,table_name from v1 select c,table_name from v1
inner join information_schema.TABLES v2 on (v1.c=v2.table_name) inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%"; where v1.c like "t%";
c table_name c table_name
...@@ -94,7 +94,7 @@ t4 t4 ...@@ -94,7 +94,7 @@ t4 t4
t2 t2 t2 t2
t3 t3 t3 t3
t5 t5 t5 t5
select c,table_name from v1 select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name) left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%"; where v1.c like "t%";
c table_name c table_name
...@@ -173,7 +173,7 @@ a int(11) YES NULL ...@@ -173,7 +173,7 @@ a int(11) YES NULL
create view mysqltest.v1 (c) as select a from mysqltest.t1; create view mysqltest.v1 (c) as select a from mysqltest.t1;
grant select (a) on mysqltest.t1 to mysqltest_2@localhost; grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
grant select on mysqltest.v1 to mysqltest_3; grant select on mysqltest.v1 to mysqltest_3;
select table_name, column_name, privileges from information_schema.columns select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 't1'; where table_schema = 'mysqltest' and table_name = 't1';
table_name column_name privileges table_name column_name privileges
t1 a select t1 a select
...@@ -249,7 +249,7 @@ begin ...@@ -249,7 +249,7 @@ begin
select * from t1; select * from t1;
select * from t2; select * from t2;
end| end|
select parameter_style, sql_data_access, dtd_identifier select parameter_style, sql_data_access, dtd_identifier
from information_schema.routines; from information_schema.routines;
parameter_style sql_data_access dtd_identifier parameter_style sql_data_access dtd_identifier
SQL CONTAINS SQL NULL SQL CONTAINS SQL NULL
...@@ -280,7 +280,7 @@ sub1 sub1 ...@@ -280,7 +280,7 @@ sub1 sub1
select count(*) from information_schema.ROUTINES; select count(*) from information_schema.ROUTINES;
count(*) count(*)
2 2
create view v1 as select routine_schema, routine_name from information_schema.routines create view v1 as select routine_schema, routine_name from information_schema.routines
order by routine_schema, routine_name; order by routine_schema, routine_name;
select * from v1; select * from v1;
routine_schema routine_name routine_schema routine_name
...@@ -532,7 +532,7 @@ drop view v1; ...@@ -532,7 +532,7 @@ drop view v1;
create table t1(a NUMERIC(5,3), b NUMERIC(5,1), c float(5,2), create table t1(a NUMERIC(5,3), b NUMERIC(5,1), c float(5,2),
d NUMERIC(6,4), e float, f DECIMAL(6,3), g int(11), h DOUBLE(10,3), d NUMERIC(6,4), e float, f DECIMAL(6,3), g int(11), h DOUBLE(10,3),
i DOUBLE); i DOUBLE);
select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE
from information_schema.columns where table_name= 't1'; from information_schema.columns where table_name= 't1';
COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE
...@@ -589,7 +589,7 @@ TABLE_NAME= "vo"; ...@@ -589,7 +589,7 @@ TABLE_NAME= "vo";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
drop view vo; drop view vo;
select TABLE_NAME,TABLE_TYPE,ENGINE select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables from information_schema.tables
where table_schema='information_schema' limit 2; where table_schema='information_schema' limit 2;
TABLE_NAME TABLE_TYPE ENGINE TABLE_NAME TABLE_TYPE ENGINE
CHARACTER_SETS SYSTEM VIEW MEMORY CHARACTER_SETS SYSTEM VIEW MEMORY
...@@ -700,7 +700,7 @@ where table_schema="information_schema" and table_name="COLUMNS" and ...@@ -700,7 +700,7 @@ where table_schema="information_schema" and table_name="COLUMNS" and
column_type column_type
varchar(64) varchar(64)
varchar(64) varchar(64)
select TABLE_ROWS from information_schema.tables where select TABLE_ROWS from information_schema.tables where
table_schema="information_schema" and table_name="COLUMNS"; table_schema="information_schema" and table_name="COLUMNS";
TABLE_ROWS TABLE_ROWS
NULL NULL
...@@ -733,7 +733,7 @@ count(*) ...@@ -733,7 +733,7 @@ count(*)
drop view a2, a1; drop view a2, a1;
drop table t_crashme; drop table t_crashme;
select table_schema,table_name, column_name from select table_schema,table_name, column_name from
information_schema.columns information_schema.columns
where data_type = 'longtext'; where data_type = 'longtext';
table_schema table_name column_name table_schema table_name column_name
information_schema COLUMNS COLUMN_DEFAULT information_schema COLUMNS COLUMN_DEFAULT
...@@ -755,7 +755,7 @@ TABLES UPDATE_TIME datetime ...@@ -755,7 +755,7 @@ TABLES UPDATE_TIME datetime
TABLES CHECK_TIME datetime TABLES CHECK_TIME datetime
TRIGGERS CREATED datetime TRIGGERS CREATED datetime
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
WHERE NOT EXISTS WHERE NOT EXISTS
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS B (SELECT * FROM INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
AND A.TABLE_NAME = B.TABLE_NAME); AND A.TABLE_NAME = B.TABLE_NAME);
...@@ -784,7 +784,7 @@ x_float NULL NULL ...@@ -784,7 +784,7 @@ x_float NULL NULL
x_double_precision NULL NULL x_double_precision NULL NULL
drop table t1; drop table t1;
grant select on test.* to mysqltest_4@localhost; grant select on test.* to mysqltest_4@localhost;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME'; where COLUMN_NAME='TABLE_NAME';
TABLE_NAME COLUMN_NAME PRIVILEGES TABLE_NAME COLUMN_NAME PRIVILEGES
COLUMNS TABLE_NAME select COLUMNS TABLE_NAME select
......
...@@ -375,7 +375,7 @@ update t2, t1 set t2.field=t1.field ...@@ -375,7 +375,7 @@ update t2, t1 set t2.field=t1.field
where t1.id1=t2.id2 and 0=1; where t1.id1=t2.id2 and 0=1;
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2 delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
where 0=1; where 0=1;
delete t1, t2 from t2,t1 delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1; where t1.id1=t2.id2 and 0=1;
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 ( a int ); CREATE TABLE t1 ( a int );
...@@ -443,12 +443,12 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 ...@@ -443,12 +443,12 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2
ERROR HY000: You can't specify target table 't1' for update in FROM clause ERROR HY000: You can't specify target table 't1' for update in FROM clause
drop table t1,t2; drop table t1,t2;
create table t1 ( create table t1 (
aclid bigint not null primary key, aclid bigint not null primary key,
status tinyint(1) not null status tinyint(1) not null
) engine = innodb; ) engine = innodb;
create table t2 ( create table t2 (
refid bigint not null primary key, refid bigint not null primary key,
aclid bigint, index idx_acl(aclid) aclid bigint, index idx_acl(aclid)
) engine = innodb; ) engine = innodb;
insert into t2 values(1,null); insert into t2 values(1,null);
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
......
set @max_allowed_packet=@@global.max_allowed_packet;
set @net_buffer_length=@@global.net_buffer_length;
set global max_allowed_packet=100; set global max_allowed_packet=100;
Warnings: Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100' Warning 1292 Truncated incorrect max_allowed_packet value: '100'
...@@ -33,3 +35,5 @@ len ...@@ -33,3 +35,5 @@ len
select length(repeat('a',2000)); select length(repeat('a',2000));
length(repeat('a',2000)) length(repeat('a',2000))
2000 2000
set global max_allowed_packet=@max_allowed_packet;
set global net_buffer_length=@net_buffer_length;
...@@ -345,3 +345,19 @@ id ...@@ -345,3 +345,19 @@ id
drop table t1; drop table t1;
drop function f1; drop function f1;
set GLOBAL query_cache_size=0; set GLOBAL query_cache_size=0;
DROP TABLE IF EXISTS t1;
FLUSH STATUS;
SET GLOBAL query_cache_size=1048576;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
LOCK TABLES t1 WRITE;
SELECT * FROM t1;
UNLOCK TABLES;
SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
This diff is collapsed.
drop table if exists t1; DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (x1 int); CREATE TABLE t1 (x1 INT);
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -8,7 +8,7 @@ t2 CREATE TABLE `t2` ( ...@@ -8,7 +8,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -16,7 +16,7 @@ t2 CREATE TABLE `t2` ( ...@@ -16,7 +16,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -24,7 +24,7 @@ t2 CREATE TABLE `t2` ( ...@@ -24,7 +24,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -32,7 +32,7 @@ t2 CREATE TABLE `t2` ( ...@@ -32,7 +32,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -40,7 +40,7 @@ t2 CREATE TABLE `t2` ( ...@@ -40,7 +40,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -48,7 +48,7 @@ t2 CREATE TABLE `t2` ( ...@@ -48,7 +48,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -56,7 +56,7 @@ t2 CREATE TABLE `t2` ( ...@@ -56,7 +56,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` ( ...@@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -72,7 +72,7 @@ t2 CREATE TABLE `t2` ( ...@@ -72,7 +72,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -80,7 +80,7 @@ t2 CREATE TABLE `t2` ( ...@@ -80,7 +80,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -88,7 +88,7 @@ t2 CREATE TABLE `t2` ( ...@@ -88,7 +88,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -96,7 +96,7 @@ t2 CREATE TABLE `t2` ( ...@@ -96,7 +96,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -104,7 +104,7 @@ t2 CREATE TABLE `t2` ( ...@@ -104,7 +104,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -112,7 +112,7 @@ t2 CREATE TABLE `t2` ( ...@@ -112,7 +112,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -120,7 +120,7 @@ t2 CREATE TABLE `t2` ( ...@@ -120,7 +120,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -128,7 +128,7 @@ t2 CREATE TABLE `t2` ( ...@@ -128,7 +128,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -136,7 +136,7 @@ t2 CREATE TABLE `t2` ( ...@@ -136,7 +136,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -144,7 +144,7 @@ t2 CREATE TABLE `t2` ( ...@@ -144,7 +144,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -152,7 +152,7 @@ t2 CREATE TABLE `t2` ( ...@@ -152,7 +152,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
......
# The server need to be started in $MYSQLTEST_VARDIR since it # The server need to be started in $MYSQLTEST_VARDIR since it
# uses ../std_data_ln/ # uses ../std_data_ln/
-- source include/uses_vardir.inc --source include/uses_vardir.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# This test is a bit tricky as we can't use backup table to overwrite an old # This test is a bit tricky as we can't use backup table to overwrite an old
...@@ -12,7 +15,7 @@ connect (con2,localhost,root,,); ...@@ -12,7 +15,7 @@ connect (con2,localhost,root,,);
connection con1; connection con1;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
--disable_warnings --disable_warnings
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3, t4;
--enable_warnings --enable_warnings
create table t4(n int); create table t4(n int);
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
...@@ -57,6 +60,9 @@ unlock tables; ...@@ -57,6 +60,9 @@ unlock tables;
connection con1; connection con1;
reap; reap;
drop table t5; drop table t5;
connection default;
disconnect con1;
disconnect con2;
remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD; remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD;
remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD; remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD;
remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD; remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD;
...@@ -68,4 +74,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/t3.frm; ...@@ -68,4 +74,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/t3.frm;
remove_file $MYSQLTEST_VARDIR/tmp/t4.frm; remove_file $MYSQLTEST_VARDIR/tmp/t4.frm;
remove_file $MYSQLTEST_VARDIR/tmp/t5.frm; remove_file $MYSQLTEST_VARDIR/tmp/t5.frm;
# End of 4.1 tests # End of 4.1 tests
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
connection con1; connection con1;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1,t2;
drop view if exists v1;
--enable_warnings --enable_warnings
# Add a lot of keys to slow down check # Add a lot of keys to slow down check
...@@ -20,16 +24,18 @@ connection con2; ...@@ -20,16 +24,18 @@ connection con2;
insert into t1 values (200000); insert into t1 values (200000);
connection con1; connection con1;
reap; reap;
connection default;
disconnect con1;
disconnect con2;
drop table t1; drop table t1;
# End of 4.1 tests # End of 4.1 tests
# #
# Bug #9897 Views: 'Check Table' crashes MySQL, with a view and a table # Bug#9897 Views: 'Check Table' crashes MySQL, with a view and a table
# in the statement # in the statement
# #
connection default;
Create table t1(f1 int); Create table t1(f1 int);
Create table t2(f1 int); Create table t2(f1 int);
Create view v1 as Select * from t1; Create view v1 as Select * from t1;
...@@ -37,11 +43,15 @@ Check Table v1,t2; ...@@ -37,11 +43,15 @@ Check Table v1,t2;
drop view v1; drop view v1;
drop table t1, t2; drop table t1, t2;
# #
# BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK # Bug#26325 TEMPORARY TABLE "corrupt" after first read, according to CHECK TABLE
# TABLE
# #
CREATE TEMPORARY TABLE t1(a INT); CREATE TEMPORARY TABLE t1(a INT);
CHECK TABLE t1; CHECK TABLE t1;
REPAIR TABLE t1; REPAIR TABLE t1;
DROP TABLE t1; DROP TABLE t1;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
-- source include/have_compress.inc -- source include/have_compress.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (comp_con,localhost,root,,,,,COMPRESS); connect (comp_con,localhost,root,,,,,COMPRESS);
# Check compression turned on # Check compression turned on
...@@ -16,3 +20,10 @@ SHOW STATUS LIKE 'Compression'; ...@@ -16,3 +20,10 @@ SHOW STATUS LIKE 'Compression';
# Check compression turned on # Check compression turned on
SHOW STATUS LIKE 'Compression'; SHOW STATUS LIKE 'Compression';
connection default;
disconnect comp_con;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
This diff is collapsed.
This diff is collapsed.
...@@ -24,17 +24,17 @@ let $1 = 100; ...@@ -24,17 +24,17 @@ let $1 = 100;
while ($1) while ($1)
{ {
let $2 = 5; let $2 = 5;
eval insert into t1(t) values ('$1'); eval insert into t1(t) values ('$1');
while ($2) while ($2)
{ {
eval insert into t2(id2,t) values ($1,'$2'); eval insert into t2(id2,t) values ($1,'$2');
let $3 = 10; let $3 = 10;
while ($3) while ($3)
{ {
eval insert into t3(id3,t) values ($1,'$2'); eval insert into t3(id3,t) values ($1,'$2');
dec $3; dec $3;
} }
dec $2; dec $2;
} }
dec $1; dec $1;
} }
...@@ -79,11 +79,11 @@ let $1 = 1000; ...@@ -79,11 +79,11 @@ let $1 = 1000;
while ($1) while ($1)
{ {
let $2 = 5; let $2 = 5;
eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa'); eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
while ($2) while ($2)
{ {
eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb'); eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
dec $2; dec $2;
} }
dec $1; dec $1;
} }
...@@ -317,7 +317,7 @@ update t2, t1 set t2.field=t1.field ...@@ -317,7 +317,7 @@ update t2, t1 set t2.field=t1.field
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2 delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
where 0=1; where 0=1;
delete t1, t2 from t2,t1 delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1; where t1.id1=t2.id2 and 0=1;
drop table t1,t2; drop table t1,t2;
...@@ -351,7 +351,7 @@ create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(1 ...@@ -351,7 +351,7 @@ create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(1
insert into t1 values (0,'A01-Comp',1); insert into t1 values (0,'A01-Comp',1);
insert into t1 values (0,'B01-Comp',1); insert into t1 values (0,'B01-Comp',1);
insert into t2 values (0,1,'A Note',1); insert into t2 values (0,1,'A Note',1);
update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
select * from t1; select * from t1;
select * from t2; select * from t2;
drop table t1, t2; drop table t1, t2;
...@@ -379,6 +379,9 @@ revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; ...@@ -379,6 +379,9 @@ revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1'; delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest; drop database mysqltest;
connection default;
disconnect user1;
disconnect root;
# #
# multi delete wrong table check # multi delete wrong table check
...@@ -393,7 +396,7 @@ drop table t1, t2, t3; ...@@ -393,7 +396,7 @@ drop table t1, t2, t3;
# #
# multi* unique updating table check # multi* unique updating table check
# #
create table t1 (col1 int); create table t1 (col1 int);
create table t2 (col1 int); create table t2 (col1 int);
-- error ER_UPDATE_TABLE_USED -- error ER_UPDATE_TABLE_USED
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
...@@ -401,16 +404,16 @@ update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; ...@@ -401,16 +404,16 @@ update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
drop table t1,t2; drop table t1,t2;
# Test for BUG#5837 - delete with outer join and const tables # Test for Bug#5837 delete with outer join and const tables
--disable_warnings --disable_warnings
create table t1 ( create table t1 (
aclid bigint not null primary key, aclid bigint not null primary key,
status tinyint(1) not null status tinyint(1) not null
) engine = innodb; ) engine = innodb;
create table t2 ( create table t2 (
refid bigint not null primary key, refid bigint not null primary key,
aclid bigint, index idx_acl(aclid) aclid bigint, index idx_acl(aclid)
) engine = innodb; ) engine = innodb;
--enable_warnings --enable_warnings
insert into t2 values(1,null); insert into t2 values(1,null);
...@@ -418,7 +421,7 @@ delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; ...@@ -418,7 +421,7 @@ delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
drop table t1, t2; drop table t1, t2;
# #
# Bug#19225: unchecked error leads to server crash # Bug#19225 unchecked error leads to server crash
# #
create table t1(a int); create table t1(a int);
create table t2(a int); create table t2(a int);
...@@ -428,7 +431,7 @@ drop table t1, t2; ...@@ -428,7 +431,7 @@ drop table t1, t2;
# End of 4.1 tests # End of 4.1 tests
# #
# Test for bug #1980. # Test for Bug#1980.
# #
--disable_warnings --disable_warnings
create table t1 ( c char(8) not null ) engine=innodb; create table t1 ( c char(8) not null ) engine=innodb;
...@@ -484,9 +487,12 @@ send alter table t1 add column c int default 100 after a; ...@@ -484,9 +487,12 @@ send alter table t1 add column c int default 100 after a;
connect (updater,localhost,root,,test); connect (updater,localhost,root,,test);
connection updater; connection updater;
# Wait till "alter table t1 ..." is in work.
sleep 2;
send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a; send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
connection locker; connection locker;
# Wait till "update t1, v1 ..." is in work.
sleep 2; sleep 2;
unlock tables; unlock tables;
...@@ -500,8 +506,14 @@ select * from t2; ...@@ -500,8 +506,14 @@ select * from t2;
drop view v1; drop view v1;
drop table t1, t2; drop table t1, t2;
connection default;
disconnect locker;
disconnect changer;
disconnect updater;
# #
# Bug#27716 multi-update did partially and has not binlogged # Bug#27716 multi-update did partially and has not binlogged
# #
CREATE TABLE `t1` ( CREATE TABLE `t1` (
...@@ -536,11 +548,12 @@ reset master; ...@@ -536,11 +548,12 @@ reset master;
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be the UPDATE query event */; show master status /* there must be the UPDATE query event */;
# cleanup bug#27716 # cleanup
drop table t1, t2; drop table t1, t2;
# #
# Bug #29136 erred multi-delete on trans table does not rollback # Bug#29136 erred multi-delete on trans table does not rollback
# #
# prepare # prepare
...@@ -569,7 +582,7 @@ select count(*) from t3 /* must be 1 */; ...@@ -569,7 +582,7 @@ select count(*) from t3 /* must be 1 */;
# the query must be in binlog (no surprise though) # the query must be in binlog (no surprise though)
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
# cleanup bug#29136 # cleanup
drop table t1, t2, t3; drop table t1, t2, t3;
......
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
connection con1; connection con1;
-- error 1064,1102,1280 --error ER_PARSE_ERROR,ER_WRONG_DB_NAME,ER_WRONG_NAME_FOR_INDEX
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA; drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
connection default;
disconnect con1;
# End of 4.1 tests # End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
...@@ -4,12 +4,18 @@ ...@@ -4,12 +4,18 @@
# swallowing them and returning an error # swallowing them and returning an error
--source include/not_windows.inc --source include/not_windows.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# Check protocol handling # Check protocol handling
# #
connect (con1,localhost,root,,); set @max_allowed_packet=@@global.max_allowed_packet;
set @net_buffer_length=@@global.net_buffer_length;
connect (con1,localhost,root,,);
connection con1; connection con1;
set global max_allowed_packet=100; set global max_allowed_packet=100;
set max_allowed_packet=100; set max_allowed_packet=100;
...@@ -19,6 +25,8 @@ set net_buffer_length=100; ...@@ -19,6 +25,8 @@ set net_buffer_length=100;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
# Should return NULL as 2000 is bigger than max_allowed_packet # Should return NULL as 2000 is bigger than max_allowed_packet
select repeat('a',2000); select repeat('a',2000);
connection default;
disconnect con1;
# #
# Connection 2 should get error for too big packets # Connection 2 should get error for too big packets
...@@ -26,7 +34,7 @@ select repeat('a',2000); ...@@ -26,7 +34,7 @@ select repeat('a',2000);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
connection con2; connection con2;
select @@net_buffer_length, @@max_allowed_packet; select @@net_buffer_length, @@max_allowed_packet;
--error 1153 --error ER_NET_PACKET_TOO_LARGE
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
set global max_allowed_packet=default; set global max_allowed_packet=default;
set max_allowed_packet=default; set max_allowed_packet=default;
...@@ -34,5 +42,13 @@ set global net_buffer_length=default; ...@@ -34,5 +42,13 @@ set global net_buffer_length=default;
set net_buffer_length=default; set net_buffer_length=default;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
select length(repeat('a',2000)); select length(repeat('a',2000));
connection default;
disconnect con2;
set global max_allowed_packet=@max_allowed_packet;
set global net_buffer_length=@net_buffer_length;
# End of 4.1 tests # End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
-- source include/have_query_cache.inc -- source include/have_query_cache.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# Tests with query cache # Tests with query cache
# #
...@@ -79,7 +83,7 @@ show status like "Qcache_free_blocks"; ...@@ -79,7 +83,7 @@ show status like "Qcache_free_blocks";
drop table t1, t2, t3, t11, t21; drop table t1, t2, t3, t11, t21;
# #
# do not use QC if tables locked (BUG#12385) # do not use QC if tables locked (Bug#12385)
# #
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root; connection root;
...@@ -96,10 +100,13 @@ SELECT * FROM t1; ...@@ -96,10 +100,13 @@ SELECT * FROM t1;
connection root; connection root;
SELECT * FROM t1; SELECT * FROM t1;
drop table t1; drop table t1;
connection default;
disconnect root;
disconnect root2;
# #
# query in QC from normal execution and SP (BUG#6897) # query in QC from normal execution and SP (Bug#6897)
# improved to also test BUG#3583 and BUG#12990 # improved to also test Bug#3583 and Bug#12990
# #
flush query cache; flush query cache;
reset query cache; reset query cache;
...@@ -181,7 +188,7 @@ drop procedure f4; ...@@ -181,7 +188,7 @@ drop procedure f4;
drop table t1; drop table t1;
# #
# bug#14767: INSERT in SF + concurrent SELECT with query cache # Bug#14767 INSERT in SF + concurrent SELECT with query cache
# #
reset query cache; reset query cache;
--disable_warnings --disable_warnings
...@@ -223,4 +230,36 @@ connection default; ...@@ -223,4 +230,36 @@ connection default;
set GLOBAL query_cache_size=0; set GLOBAL query_cache_size=0;
#
# Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
FLUSH STATUS;
SET GLOBAL query_cache_size=1048576;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SHOW STATUS LIKE 'Qcache_queries_in_cache';
LOCK TABLES t1 WRITE;
connect(con1,localhost,root,,);
--send SELECT * FROM t1
connection default;
let $show_type= open tables where `table`='t1' and in_use=2;
let $show_pattern= '%t1%2%';
--source include/wait_show_pattern.inc
dirty_close con1;
UNLOCK TABLES;
let $show_type= open tables where `table`='t1' and in_use=0;
let $show_pattern= '%t1%0%';
--source include/wait_show_pattern.inc
SHOW STATUS LIKE 'Qcache_queries_in_cache';
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
# End of 5.0 tests # End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
#--source include/wait_until_count_sessions.inc
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
# except security/privilege tests, they go to sp-security.test # except security/privilege tests, they go to sp-security.test
# #
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1root,localhost,root,,); connect (con1root,localhost,root,,);
connect (con2root,localhost,root,,); connect (con2root,localhost,root,,);
connect (con3root,localhost,root,,); connect (con3root,localhost,root,,);
...@@ -17,7 +20,7 @@ drop table if exists t1; ...@@ -17,7 +20,7 @@ drop table if exists t1;
--enable_warnings --enable_warnings
create table t1 (s1 int, s2 int, s3 int); create table t1 (s1 int, s2 int, s3 int);
delimiter //; delimiter //;
create procedure bug4934() create procedure bug4934()
begin begin
insert into t1 values (1,0,1); insert into t1 values (1,0,1);
...@@ -38,7 +41,7 @@ drop table t1; ...@@ -38,7 +41,7 @@ drop table t1;
create table t1 (s1 int, s2 int, s3 int); create table t1 (s1 int, s2 int, s3 int);
drop procedure bug4934; drop procedure bug4934;
delimiter //; delimiter //;
create procedure bug4934() create procedure bug4934()
begin begin
end// end//
...@@ -58,7 +61,7 @@ drop procedure bug4934; ...@@ -58,7 +61,7 @@ drop procedure bug4934;
# #
# BUG #9486 "Can't perform multi-update in stored procedure" # Bug#9486 Can't perform multi-update in stored procedure
# #
--disable_warnings --disable_warnings
drop procedure if exists bug9486; drop procedure if exists bug9486;
...@@ -87,8 +90,9 @@ reap; ...@@ -87,8 +90,9 @@ reap;
drop procedure bug9486; drop procedure bug9486;
drop table t1, t2; drop table t1, t2;
# #
# BUG#11158: Can't perform multi-delete in stored procedure # Bug#11158 Can't perform multi-delete in stored procedure
# #
--disable_warnings --disable_warnings
drop procedure if exists bug11158; drop procedure if exists bug11158;
...@@ -114,8 +118,9 @@ connection con1root; ...@@ -114,8 +118,9 @@ connection con1root;
drop procedure bug11158; drop procedure bug11158;
drop table t1, t2; drop table t1, t2;
# #
# BUG#11554: Server crashes on statement indirectly using non-cached function # Bug#11554 Server crashes on statement indirectly using non-cached function
# #
--disable_warnings --disable_warnings
drop function if exists bug11554; drop function if exists bug11554;
...@@ -134,7 +139,7 @@ drop table t1; ...@@ -134,7 +139,7 @@ drop table t1;
drop view v1; drop view v1;
# BUG#12228 # Bug#12228 Crash happens during calling specific SP in multithread environment
--disable_warnings --disable_warnings
drop procedure if exists p1; drop procedure if exists p1;
drop procedure if exists p2; drop procedure if exists p2;
...@@ -168,18 +173,26 @@ connection con2root; ...@@ -168,18 +173,26 @@ connection con2root;
unlock tables; unlock tables;
connection con1root; connection con1root;
# Crash will be here if we hit BUG#12228 # Crash will be here if we hit Bug#12228
reap; reap;
drop procedure p1; drop procedure p1;
drop procedure p2; drop procedure p2;
drop table t1; drop table t1;
# #
# BUG#NNNN: New bug synopsis # Bug#NNNN New bug synopsis
# #
#--disable_warnings #--disable_warnings
#drop procedure if exists bugNNNN; #drop procedure if exists bugNNNN;
#--enable_warnings #--enable_warnings
#create procedure bugNNNN... #create procedure bugNNNN...
connection default;
disconnect con1root;
disconnect con2root;
disconnect con3root;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
This diff is collapsed.
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# Test for Bug #2385 CREATE TABLE LIKE lacks locking on source and destination # Test for Bug#2385 CREATE TABLE LIKE lacks locking on source and destination
# table # table
# #
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1,t2;
--enable_warnings --enable_warnings
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
...@@ -12,12 +15,12 @@ connect (con2,localhost,root,,); ...@@ -12,12 +15,12 @@ connect (con2,localhost,root,,);
# locking of source: # locking of source:
CREATE TABLE t1 (x1 int); CREATE TABLE t1 (x1 INT);
let $1= 10; let $1= 10;
while ($1) while ($1)
{ {
connection con1; connection con1;
send ALTER TABLE t1 CHANGE x1 x2 int; send ALTER TABLE t1 CHANGE x1 x2 INT;
connection con2; connection con2;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
replace_result x1 xx x2 xx; replace_result x1 xx x2 xx;
...@@ -25,7 +28,7 @@ while ($1) ...@@ -25,7 +28,7 @@ while ($1)
DROP TABLE t2; DROP TABLE t2;
connection con1; connection con1;
reap; reap;
send ALTER TABLE t1 CHANGE x2 x1 int; send ALTER TABLE t1 CHANGE x2 x1 INT;
connection con2; connection con2;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
replace_result x1 xx x2 xx; replace_result x1 xx x2 xx;
...@@ -37,4 +40,11 @@ while ($1) ...@@ -37,4 +40,11 @@ while ($1)
} }
DROP TABLE t1; DROP TABLE t1;
connection default;
disconnect con1;
disconnect con2;
# End of 4.1 tests # End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
# Embedded server testing does not support grants # Embedded server testing does not support grants
-- source include/not_embedded.inc -- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings --disable_warnings
drop tables if exists t1, t2; drop tables if exists t1, t2;
drop view if exists v1; drop view if exists v1;
--enable_warnings --enable_warnings
# #
# Test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone # Test for Bug#6116 SET time_zone := ... requires access to mysql.time_zone tables
# tables". We should allow implicit access to time zone description tables # We should allow implicit access to time zone description tables even for
# even for unprivileged users. # unprivileged users.
# #
# Let us prepare playground # Let us prepare playground
...@@ -33,18 +36,20 @@ select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; ...@@ -33,18 +36,20 @@ select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2); where t1.a = t2.c and t2.d = (select max(d) from t2);
# But still these two statements should not work: # But still these two statements should not work:
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
select * from mysql.time_zone_name; select * from mysql.time_zone_name;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
connection default;
disconnect tzuser;
# #
# Test for bug #6765 "Implicit access to time zone description tables # Bug#6765 Implicit access to time zone description tables requires privileges
# requires privileges for them if some table or column level grants # for them if some table or column level grants present
# present"
# #
connection default; connection default;
# Let use some table-level grants instead of db-level # Let use some table-level grants instead of db-level
# to make life more interesting # to make life more interesting
delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%';
flush privileges; flush privileges;
...@@ -61,14 +66,14 @@ select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; ...@@ -61,14 +66,14 @@ select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2); where t1.a = t2.c and t2.d = (select max(d) from t2);
# Again these two statements should not work (but with different errors): # Again these two statements should not work (but with different errors):
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
select * from mysql.time_zone_name; select * from mysql.time_zone_name;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
# #
# Bug #9979: Use of CONVERT_TZ in multiple-table UPDATE causes bogus # Bug#9979 Use of CONVERT_TZ in multiple-table UPDATE causes bogus
# privilege error # privilege error
# #
drop table t1, t2; drop table t1, t2;
create table t1 (a int, b datetime); create table t1 (a int, b datetime);
...@@ -80,6 +85,7 @@ update t1 join t2 on (t1.a = t2.a) set t1.b = convert_tz('2005-01-01 10:00','UTC ...@@ -80,6 +85,7 @@ update t1 join t2 on (t1.a = t2.a) set t1.b = convert_tz('2005-01-01 10:00','UTC
# Clean-up # Clean-up
connection default; connection default;
disconnect tzuser2;
delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%';
...@@ -89,10 +95,9 @@ drop table t1, t2; ...@@ -89,10 +95,9 @@ drop table t1, t2;
# End of 4.1 tests # End of 4.1 tests
# #
# Additional test for bug #15153: CONVERT_TZ() is not allowed in all # Additional test for Bug#15153 CONVERT_TZ() is not allowed in all places in views.
# places in views.
# #
# Let us check that usage of CONVERT_TZ() function in view does not # Let us check that usage of CONVERT_TZ() function in view does not
# require additional privileges. # require additional privileges.
# Let us rely on that previous tests done proper cleanups # Let us rely on that previous tests done proper cleanups
...@@ -109,7 +114,11 @@ drop view v1; ...@@ -109,7 +114,11 @@ drop view v1;
--error ER_TABLEACCESS_DENIED_ERROR --error ER_TABLEACCESS_DENIED_ERROR
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1, mysql.time_zone; create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1, mysql.time_zone;
connection default; connection default;
disconnect tzuser3;
drop table t1; drop table t1;
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
# End of 5.0 tests # End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment