1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge of ifx into GCA tree

no conflicts
This commit is contained in:
Matthias Leich
2009-02-09 12:44:01 +01:00
22 changed files with 867 additions and 636 deletions

View File

@ -1,7 +1,10 @@
# The server need to be started in $MYSQLTEST_VARDIR since it
# 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
@ -12,7 +15,7 @@ connect (con2,localhost,root,,);
connection con1;
set SQL_LOG_BIN=0;
--disable_warnings
drop table if exists t1, t2, t3;
drop table if exists t1, t2, t3, t4;
--enable_warnings
create table t4(n int);
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@ -57,6 +60,9 @@ unlock tables;
connection con1;
reap;
drop table t5;
connection default;
disconnect con1;
disconnect con2;
remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD;
remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD;
remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD;
@ -68,4 +74,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/t3.frm;
remove_file $MYSQLTEST_VARDIR/tmp/t4.frm;
remove_file $MYSQLTEST_VARDIR/tmp/t5.frm;
# End of 4.1 tests
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc

View File

@ -1,8 +1,12 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
drop table if exists t1;
drop table if exists t1,t2;
drop view if exists v1;
--enable_warnings
# Add a lot of keys to slow down check
@ -20,16 +24,18 @@ connection con2;
insert into t1 values (200000);
connection con1;
reap;
connection default;
disconnect con1;
disconnect con2;
drop table t1;
# End of 4.1 tests
#
# Bug #9897 Views: 'Check Table' crashes MySQL, with a view and a table
# in the statement
# Bug#9897 Views: 'Check Table' crashes MySQL, with a view and a table
# in the statement
#
connection default;
Create table t1(f1 int);
Create table t2(f1 int);
Create view v1 as Select * from t1;
@ -37,11 +43,15 @@ Check Table v1,t2;
drop view v1;
drop table t1, t2;
#
# BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK
# TABLE
# Bug#26325 TEMPORARY TABLE "corrupt" after first read, according to CHECK TABLE
#
CREATE TEMPORARY TABLE t1(a INT);
CHECK TABLE t1;
REPAIR TABLE t1;
DROP TABLE t1;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View File

@ -6,6 +6,10 @@
-- source include/have_compress.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (comp_con,localhost,root,,,,,COMPRESS);
# Check compression turned on
@ -16,3 +20,10 @@ SHOW STATUS LIKE 'Compression';
# Check compression turned on
SHOW STATUS LIKE 'Compression';
connection default;
disconnect comp_con;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc

View File

@ -3,6 +3,9 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# Cleanup
--disable_warnings
drop table if exists t1;
@ -78,7 +81,7 @@ delete from mysql.db where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1';
flush privileges;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_1@localhost;
#
@ -116,15 +119,15 @@ drop table t1;
#
# Test some error conditions
#
--error 1221
--error ER_WRONG_USAGE
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
select 1; # To test that the previous command didn't cause problems
select 1; # To test that the previous command didn't cause problems
#
# Bug #4898: User privileges depending on ORDER BY Settings of table db
# Bug#4898 User privileges depending on ORDER BY Settings of table db
#
insert into mysql.user (host, user) values ('localhost', 'test11');
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');
alter table mysql.db order by db asc;
flush privileges;
@ -136,7 +139,7 @@ delete from mysql.user where user='test11';
delete from mysql.db where user='test11';
#
# Bug#6123: GRANT USAGE inserts useless Db row
# Bug#6123 GRANT USAGE inserts useless Db row
#
create database mysqltest1;
grant usage on mysqltest1.* to test6123 identified by 'magic123';
@ -145,7 +148,7 @@ delete from mysql.user where user='test6123';
drop database mysqltest1;
#
# Test for 'drop user', 'revoke privileges, grant'
# Test for 'drop user', 'revoke privileges, grant'
#
create table t1 (a int);
@ -160,7 +163,7 @@ grant select(a) on test.t1 to drop_user@localhost;
show grants for drop_user@localhost;
#
# Bug3086
# Bug#3086 SHOW GRANTS doesn't follow ANSI_QUOTES
#
set sql_mode=ansi_quotes;
show grants for drop_user@localhost;
@ -178,7 +181,7 @@ show grants for drop_user@localhost;
revoke all privileges, grant option from drop_user@localhost;
show grants for drop_user@localhost;
drop user drop_user@localhost;
--error 1269
--error ER_REVOKE_GRANTS
revoke all privileges, grant option from drop_user@localhost;
grant select(a) on test.t1 to drop_user1@localhost;
@ -188,10 +191,10 @@ grant select on *.* to drop_user4@localhost;
# Drop user now implicitly revokes all privileges.
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
--error 1269
--error ER_REVOKE_GRANTS
revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
drop_user3@localhost, drop_user4@localhost;
--error 1396
--error ER_CANNOT_USER
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
drop table t1;
@ -201,12 +204,12 @@ show grants for mysqltest_1@localhost;
drop user mysqltest_1@localhost;
#
# Bug #3403 Wrong encodin in SHOW GRANTS output
# Bug#3403 Wrong encoding in SHOW GRANTS, EPLAIN SELECT output
#
SET NAMES koi8r;
CREATE DATABASE <20><>;
USE <20><>;
CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> int);
CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> INT);
GRANT SELECT ON <20><>.* TO <20><><EFBFBD><EFBFBD>@localhost;
SHOW GRANTS FOR <20><><EFBFBD><EFBFBD>@localhost;
@ -227,7 +230,7 @@ DROP DATABASE
SET NAMES latin1;
#
# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything
# Bug#5831 REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything
#
USE test;
CREATE TABLE t1 (a int );
@ -296,7 +299,7 @@ DROP DATABASE testdb9;
DROP DATABASE testdb10;
#
# Bug #6932: a problem with 'revoke ALL PRIVILEGES'
# Bug#6932 a problem with 'revoke ALL PRIVILEGES'
#
create table t1(a int, b int, c int, d int);
@ -310,7 +313,7 @@ drop user grant_user@localhost;
drop table t1;
#
# Bug#7391: Cross-database multi-table UPDATE security problem
# Bug#7391 Cross-database multi-table UPDATE security problem
#
create database mysqltest_1;
create database mysqltest_2;
@ -319,36 +322,36 @@ create table mysqltest_1.t2 select 1 b, 2 r;
create table mysqltest_2.t1 select 1 c, 2 s;
create table mysqltest_2.t2 select 1 d, 2 t;
#test the column privileges
# test the column privileges
grant update (a) on mysqltest_1.t1 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 update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
connect (conn1,localhost,mysqltest_3,,);
connection conn1;
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE;
SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_CATALOG,PRIVILEGE_TYPE;
--error 1143
--error ER_COLUMNACCESS_DENIED_ERROR
update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
--error 1143
--error ER_COLUMNACCESS_DENIED_ERROR
update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1;
--error 1143
--error ER_COLUMNACCESS_DENIED_ERROR
update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
#the following two should work
# the following two should work
update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10;
update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20;
connection master;
@ -359,7 +362,7 @@ revoke all on mysqltest_1.t2 from mysqltest_3@localhost;
revoke all on mysqltest_2.t1 from mysqltest_3@localhost;
revoke all on mysqltest_2.t2 from mysqltest_3@localhost;
#test the db/table level privileges
# test the db/table level privileges
grant all on mysqltest_2.* to mysqltest_3@localhost;
grant select on *.* to mysqltest_3@localhost;
# Next grant is needed to trigger bug#7391. Do not optimize!
@ -371,15 +374,15 @@ connection conn2;
use mysqltest_1;
update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
# the following failed before, should fail now.
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
use mysqltest_2;
#the following used to succeed, it must fail now.
--error 1142
# the following used to succeed, it must fail now.
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
#lets see the result
connection master;
@ -393,6 +396,7 @@ delete from mysql.columns_priv where user="mysqltest_3";
flush privileges;
drop database mysqltest_1;
drop database mysqltest_2;
disconnect conn2;
#
# just SHOW PRIVILEGES test
@ -400,7 +404,7 @@ drop database mysqltest_2;
SHOW PRIVILEGES;
#
# Rights for renaming test (Bug #3270)
# Rights for renaming test (Bug#3270)
#
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
@ -411,16 +415,18 @@ create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
-- error ER_TABLEACCESS_DENIED_ERROR
alter table t1 rename t2;
disconnect user1;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
connection default;
disconnect root;
#
# check all new table priveleges
# check all new table privileges
#
CREATE USER dummy@localhost;
CREATE DATABASE mysqltest;
@ -485,7 +491,7 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE mysqltest;
#
# Bug #11330: Entry in tables_priv with host = '' causes crash
# Bug#11330 Entry in tables_priv with host = '' causes crash
#
connection default;
use mysql;
@ -496,7 +502,7 @@ flush privileges;
use test;
#
# Bug #10892 user variables not auto cast for comparisons
# Bug#10892 user variables not auto cast for comparisons
# Check that we don't get illegal mix of collations
#
set @user123="non-existent";
@ -515,18 +521,18 @@ show grants for root@localhost;
set names latin1;
#
# Bug #15598 Server crashes in specific case during setting new password
# Bug#15598 Server crashes in specific case during setting new password
# - Caused by a user with host ''
#
create user mysqltest_7@;
set password for mysqltest_7@ = password('systpass');
show grants for mysqltest_7@;
drop user mysqltest_7@;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_7@;
#
# Bug#14385: GRANT and mapping to correct user account problems
# Bug#14385 GRANT and mapping to correct user account problems
#
create database mysqltest;
use mysqltest;
@ -542,7 +548,7 @@ flush privileges;
drop database mysqltest;
#
# Bug #27515: DROP previlege is not required for RENAME TABLE
# Bug#27515 DROP previlege is not required for RENAME TABLE
#
connection master;
create database db27515;
@ -553,7 +559,7 @@ grant insert, create on db27515.t2 to user27515@localhost;
connect (conn27515, localhost, user27515, , db27515);
connection conn27515;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
rename table t1 to t2;
disconnect conn27515;
@ -565,7 +571,7 @@ drop database db27515;
--echo End of 4.1 tests
#
# Bug #16297 In memory grant tables not flushed when users's hostname is ""
# Bug#16297 In memory grant tables not flushed when users's hostname is ""
#
use test;
create table t1 (a int);
@ -582,11 +588,11 @@ create user mysqltest_8;
create user mysqltest_8@host8;
# Try to create them again
--error 1396
--error ER_CANNOT_USER
create user mysqltest_8@'';
--error 1396
--error ER_CANNOT_USER
create user mysqltest_8;
--error 1396
--error ER_CANNOT_USER
create user mysqltest_8@host8;
select user, QUOTE(host) from mysql.user where user="mysqltest_8";
@ -681,44 +687,43 @@ flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
drop user mysqltest_8@'';
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
drop user mysqltest_8;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (conn6,localhost,mysqltest_8,,);
connection master;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_8;
drop user mysqltest_8@host8;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_8@host8;
# Restore the anonymous users.
insert into mysql.user select * from t2;
flush privileges;
drop table t2;
drop table t1;
#
# Bug#20214: Incorrect error when user calls SHOW CREATE VIEW on non
# privileged view
# Bug#20214 Incorrect error when user calls SHOW CREATE VIEW on non
# privileged view
#
connection master;
CREATE DATABASE mysqltest3;
use mysqltest3;
USE mysqltest3;
CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn;
CREATE DATABASE mysqltest2;
use mysqltest2;
USE mysqltest2;
CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn;
@ -740,24 +745,18 @@ SHOW CREATE VIEW mysqltest2.v_nn;
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE TABLE mysqltest2.v_nn;
# fail because of missing SHOW VIEW
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE VIEW mysqltest2.v_yn;
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE TABLE mysqltest2.v_yn;
# succeed (despite of missing SELECT, having SHOW VIEW bails us out)
SHOW CREATE TABLE mysqltest2.v_ny;
# succeed (despite of missing SELECT, having SHOW VIEW bails us out)
SHOW CREATE VIEW mysqltest2.v_ny;
# fail because of missing (specific or generic) SELECT
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE TABLE mysqltest3.t_nn;
@ -766,16 +765,12 @@ SHOW CREATE TABLE mysqltest3.t_nn;
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE VIEW mysqltest3.t_nn;
# fail because of missing missing (specific or generic) SELECT (and SHOW VIEW)
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE VIEW mysqltest3.v_nn;
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE TABLE mysqltest3.v_nn;
# succeed thanks to generic SELECT
SHOW CREATE TABLE mysqltest2.t_nn;
@ -783,8 +778,6 @@ SHOW CREATE TABLE mysqltest2.t_nn;
--error ER_WRONG_OBJECT
SHOW CREATE VIEW mysqltest2.t_nn;
# succeed, have SELECT and SHOW VIEW
SHOW CREATE VIEW mysqltest2.v_yy;
@ -792,8 +785,7 @@ SHOW CREATE VIEW mysqltest2.v_yy;
SHOW CREATE TABLE mysqltest2.v_yy;
#clean-up
# clean-up
connection master;
# succeed, we're root
@ -806,38 +798,30 @@ SHOW CREATE TABLE mysqltest2.t_nn;
--error ER_WRONG_OBJECT
SHOW CREATE VIEW mysqltest2.t_nn;
DROP VIEW mysqltest2.v_nn;
DROP VIEW mysqltest2.v_yn;
DROP VIEW mysqltest2.v_ny;
DROP VIEW mysqltest2.v_yy;
DROP TABLE mysqltest2.t_nn;
DROP DATABASE mysqltest2;
DROP VIEW mysqltest3.v_nn;
DROP TABLE mysqltest3.t_nn;
DROP DATABASE mysqltest3;
disconnect mysqltest_1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost';
# restore the original database
use test;
USE test;
#
# Bug #10668: CREATE USER does not enforce username length limit
# Bug#10668 CREATE USER does not enforce username length limit
#
--error ER_WRONG_STRING_LENGTH
create user mysqltest1_thisisreallytoolong;
#
# Test for BUG#16899: Possible buffer overflow in handling of DEFINER-clause.
# Test for Bug#16899 Possible buffer overflow in handling of DEFINER-clause.
#
# These checks are intended to ensure that appropriate errors are risen when
# illegal user name or hostname is specified in user-clause of GRANT/REVOKE
@ -887,7 +871,7 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost;
REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
#
# Bug #6774: Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
# Bug#6774 Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
#
# Check if GRANT ... ON * ... fails when no database is selected
connect (con1, localhost, root,,*NO-ONE*);
@ -899,7 +883,7 @@ connection default;
#
# BUG#9504: Stored procedures: execute privilege doesn't make 'use database'
# Bug#9504 Stored procedures: execute privilege doesn't make 'use database'
# okay.
#
@ -924,8 +908,8 @@ CREATE PROCEDURE mysqltest2.p_inv() SQL SECURITY INVOKER
SELECT 1;
CREATE FUNCTION mysqltest3.f_def() RETURNS INT SQL SECURITY DEFINER
RETURN 1;
RETURN 1;
CREATE FUNCTION mysqltest4.f_inv() RETURNS INT SQL SECURITY INVOKER
RETURN 1;
@ -981,7 +965,7 @@ DROP USER mysqltest_1@localhost;
#
# BUG#27337: Privileges are not restored properly.
# Bug#27337 Privileges are not restored properly.
#
# Actually, the patch for this bugs fixes two problems. So, here are two test
# cases.
@ -1043,7 +1027,7 @@ DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
# Test case 2: priveleges are not checked properly for prepared statements.
# Test case 2: privileges are not checked properly for prepared statements.
# Prepare.
@ -1116,6 +1100,7 @@ EXECUTE stmt2;
--echo
--echo ---> connection: default
--disconnect bug27337_con1
--disconnect bug27337_con2
DROP DATABASE mysqltest1;
@ -1125,21 +1110,21 @@ DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost;
#
# Bug#27878: Unchecked privileges on a view referring to a table from another
# database.
# Bug#27878 Unchecked privileges on a view referring to a table from another
# database.
#
use test;
USE test;
CREATE TABLE t1 (f1 int, f2 int);
INSERT INTO t1 VALUES(1,1), (2,2);
CREATE DATABASE db27878;
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
GRANT SELECT ON `test`.* 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;
connect (user1,localhost,mysqltest_1,,test);
connection user1;
use db27878;
USE db27878;
--error 1356
UPDATE v1 SET f2 = 4;
SELECT * FROM test.t1;
@ -1150,11 +1135,11 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
DROP USER mysqltest_1@localhost;
DROP DATABASE db27878;
use test;
USE test;
DROP TABLE t1;
#
# Bug #33201 Crash occurs when granting update privilege on one column of a view
# Bug#33201 Crash occurs when granting update privilege on one column of a view
#
drop table if exists test;
drop function if exists test_function;
@ -1183,3 +1168,7 @@ SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
--echo End of 5.0 tests
disconnect master;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View File

@ -36,11 +36,11 @@ insert into t5 values (10);
create view v1 (c) as select table_name from information_schema.TABLES;
select * from 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)
where v1.c like "t%";
select c,table_name from v1
select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
@ -69,7 +69,7 @@ grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
grant select on mysqltest.v1 to mysqltest_3;
connect (user3,localhost,mysqltest_2,,);
connection user3;
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';
show columns from mysqltest.t1;
connect (user4,localhost,mysqltest_3,,mysqltest);
@ -77,6 +77,7 @@ connection user4;
select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 'v1';
connection default;
disconnect user4;
drop view v1, mysqltest.v1;
drop tables mysqltest.t4, mysqltest.t1, t2, t3, t5;
@ -126,7 +127,7 @@ delimiter ;|
#
# Bug#7222 information_schema: errors in "routines"
#
select parameter_style, sql_data_access, dtd_identifier
select parameter_style, sql_data_access, dtd_identifier
from information_schema.routines;
--replace_column 5 # 6 #
@ -145,7 +146,7 @@ select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
select count(*) from information_schema.ROUTINES;
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;
select * from v1;
drop view v1;
@ -153,7 +154,7 @@ drop view v1;
connect (user1,localhost,mysqltest_1,,);
connection user1;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
--error 1305
--error ER_SP_DOES_NOT_EXIST
show create function sub1;
connection user3;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
@ -172,6 +173,7 @@ show create function sub2;
show function status like "sub2";
connection default;
disconnect user1;
disconnect user3;
drop function sub2;
show create procedure sel2;
@ -311,7 +313,7 @@ drop view v1;
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),
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
from information_schema.columns where table_name= 't1';
drop table t1;
@ -324,7 +326,7 @@ drop table t115;
delimiter //;
create procedure p108 () begin declare c cursor for select data_type
from information_schema.columns; open c; open c; end;//
--error 1325
--error ER_SP_CURSOR_ALREADY_OPEN
call p108()//
delimiter ;//
drop procedure p108;
@ -334,24 +336,24 @@ where table_name= "user";
select * from v1;
drop view v1;
create view vo as select 'a' union select 'a';
create view vo as select 'a' union select 'a';
show index from vo;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_NAME= "vo";
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_NAME= "vo";
TABLE_NAME= "vo";
drop view vo;
select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables
from information_schema.tables
where table_schema='information_schema' limit 2;
show tables from information_schema like "T%";
--error 1044
--error ER_DBACCESS_DENIED_ERROR
create database information_schema;
use information_schema;
show full tables like "T%";
--error 1109
--error ER_UNKNOWN_TABLE
create table t1(a int);
use test;
show tables;
@ -359,15 +361,15 @@ use information_schema;
show tables like "T%";
#
# Bug#7210: information_schema: can't access when table-name = reserved word
# Bug#7210 information_schema: can't access when table-name = reserved word
#
select table_name from tables where table_name='user';
select column_name, privileges from columns
where table_name='user' and column_name like '%o%';
#
# Bug#7212: information_schema: "Can't find file" errors if storage engine gone
# Bug#7211: information_schema: crash if bad view
# Bug#7212 information_schema: "Can't find file" errors if storage engine gone
# Bug#7211 information_schema: crash if bad view
#
use test;
create function sub1(i int) returns int
@ -394,9 +396,9 @@ drop view v3;
drop table t4;
#
# Bug#7213: information_schema: redundant non-standard TABLE_NAMES table
# Bug#7213 information_schema: redundant non-standard TABLE_NAMES table
#
--error 1109
--error ER_UNKNOWN_TABLE
select * from information_schema.table_names;
#
@ -409,7 +411,7 @@ where table_schema="information_schema" and table_name="COLUMNS" and
#
# Bug#2718 information_schema: errors in "tables"
#
select TABLE_ROWS from information_schema.tables where
select TABLE_ROWS from information_schema.tables where
table_schema="information_schema" and table_name="COLUMNS";
select table_type from information_schema.tables
where table_schema="mysql" and table_name="user";
@ -422,14 +424,14 @@ show status where variable_name like "%database%";
show variables where variable_name like "skip_show_databas";
#
# Bug #7981:SHOW GLOBAL STATUS crashes server
# Bug#7981 SHOW GLOBAL STATUS crashes server
#
# We don't actually care about the value, just that it doesn't crash.
--replace_column 2 #
show global status like "Threads_running";
#
# Bug #7915 crash,JOIN VIEW, subquery,
# Bug#7915 crash,JOIN VIEW, subquery,
# SELECT .. FROM INFORMATION_SCHEMA.COLUMNS
#
create table t1(f1 int);
@ -440,7 +442,7 @@ drop view v1;
drop table t1, t2;
#
# Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES
# Bug#7476 crash on SELECT * FROM INFORMATION_SCHEMA.TABLES
#
CREATE TABLE t_crashme ( f1 BIGINT);
@ -468,26 +470,26 @@ drop view a2, a1;
drop table t_crashme;
#
# Bug #7215 information_schema: columns are longtext instead of varchar
# Bug #7217 information_schema: columns are varbinary() instead of timestamp
# Bug#7215 information_schema: columns are longtext instead of varchar
# Bug#7217 information_schema: columns are varbinary() instead of timestamp
#
select table_schema,table_name, column_name from
information_schema.columns
information_schema.columns
where data_type = 'longtext';
select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime';
#
# Bug #8164 subquery with INFORMATION_SCHEMA.COLUMNS, 100 % CPU
# Bug#8164 subquery with INFORMATION_SCHEMA.COLUMNS, 100 % CPU
#
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
WHERE NOT EXISTS
WHERE NOT EXISTS
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
AND A.TABLE_NAME = B.TABLE_NAME);
#
# Bug #9344 INFORMATION_SCHEMA, wrong content, numeric columns
# Bug#9344 INFORMATION_SCHEMA, wrong content, numeric columns
#
create table t1
@ -505,21 +507,22 @@ WHERE TABLE_NAME= 't1';
drop table t1;
#
# Bug#10261 INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user
# Bug#10261 INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user
#
grant select on test.* to mysqltest_4@localhost;
connect (user10261,localhost,mysqltest_4,,);
connection user10261;
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';
connection default;
disconnect user10261;
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
#
# Bug #9404 information_schema: Weird error messages
# Bug#9404 information_schema: Weird error messages
# with SELECT SUM() ... GROUP BY queries
#
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
@ -560,7 +563,7 @@ drop table t1;
#
# Bug #10964 Information Schema:Authorization check on privilege tables is improper
# Bug#10964 Information Schema:Authorization check on privilege tables is improper
#
create database mysqltest;
@ -604,12 +607,16 @@ select * from information_schema.user_privileges where grantee like '%user%'
order by grantee;
show grants;
connection default;
disconnect con1;
disconnect con2;
disconnect con3;
disconnect con4;
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
use test;
drop database mysqltest;
#
# Bug #11055 information_schema: routines.sql_data_access has wrong value
# Bug#11055 information_schema: routines.sql_data_access has wrong value
#
--disable_warnings
drop procedure if exists p1;
@ -624,13 +631,13 @@ drop procedure p1;
drop procedure p2;
#
# Bug #9434 SHOW CREATE DATABASE information_schema;
# Bug#9434 SHOW CREATE DATABASE information_schema;
#
show create database information_schema;
#
# Bug #11057 information_schema: columns table has some questionable contents
# Bug #12301 information_schema: NUMERIC_SCALE must be 0 for integer columns
# Bug#11057 information_schema: columns table has some questionable contents
# Bug#12301 information_schema: NUMERIC_SCALE must be 0 for integer columns
#
create table t1(f1 LONGBLOB, f2 LONGTEXT);
select column_name,data_type,CHARACTER_OCTET_LENGTH,
@ -646,7 +653,7 @@ where table_name='t1';
drop table t1;
#
# Bug #12127 triggers do not show in info_schema before they are used if set to the database
# Bug#12127 triggers do not show in info_schema before they are used if set to the database
#
create table t1 (f1 integer);
create trigger tr1 after insert on t1 for each row set @test_var=42;
@ -668,7 +675,7 @@ show columns from t1;
drop table t1;
#
# Bug #12636: SHOW TABLE STATUS with where condition containing a subquery
# Bug#12636 SHOW TABLE STATUS with where condition containing a subquery
# over information schema
#
@ -683,7 +690,7 @@ SHOW TABLE STATUS FROM test
DROP TABLE t1,t2;
#
# Bug #12905 show fields from view behaving erratically with current database
# Bug#12905 show fields from view behaving erratically with current database
#
create table t1(f1 int);
create view v1 (c) as select f1 from t1;
@ -691,28 +698,29 @@ connect (con5,localhost,root,,*NO-ONE*);
select database();
show fields from test.v1;
connection default;
disconnect con5;
drop view v1;
drop table t1;
#
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
# Bug#9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
#
--error ER_PARSE_ERROR
alter database information_schema;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
drop database information_schema;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
drop table information_schema.tables;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.tables;
#
# Bug #9683 INFORMATION_SCH: Creation of temporary table allowed in Information_schema DB
# Bug#9683 INFORMATION_SCH: Creation of temporary table allowed in Information_schema DB
#
use information_schema;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
create temporary table schemata(f1 char(10));
#
# Bug #10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA
# Bug#10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA
#
delimiter |;
--error ER_BAD_DB_ERROR
@ -723,11 +731,11 @@ END |
delimiter ;|
select ROUTINE_NAME from routines;
#
# Bug #10734 Grant of privileges other than 'select' and 'create view' should fail on schema
# Bug#10734 Grant of privileges other than 'select' and 'create view' should fail on schema
#
--error 1044
--error ER_DBACCESS_DENIED_ERROR
grant all on information_schema.* to 'user1'@'localhost';
--error 1044
--error ER_DBACCESS_DENIED_ERROR
grant select on information_schema.* to 'user1'@'localhost';
#
@ -753,9 +761,9 @@ where table_name="v1";
drop view v1;
#
# Bug #14387 SHOW COLUMNS doesn't work on temporary tables
# Bug #15224 SHOW INDEX from temporary table doesn't work
# Bug #12770 DESC cannot display the info. about temporary table
# Bug#14387 SHOW COLUMNS doesn't work on temporary tables
# Bug#15224 SHOW INDEX from temporary table doesn't work
# Bug#12770 DESC cannot display the info. about temporary table
#
create temporary table t1(f1 int, index(f1));
show columns from t1;
@ -839,6 +847,7 @@ connection con16681;
select * from information_schema.views
where table_name='v1' or table_name='v2';
connection default;
disconnect con16681;
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@ -855,7 +864,7 @@ drop table t1,t2;
#
# Bug#20230: routine_definition is not null
# Bug#20230 routine_definition is not null
#
--disable_warnings
DROP PROCEDURE IF EXISTS p1;
@ -888,7 +897,7 @@ DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
#
# Bug#18925: subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
# Bug#18925 subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
#
SELECT t.table_name, c1.column_name
@ -921,8 +930,8 @@ SELECT t.table_name, c1.column_name
);
#
# Bug#21231: query with a simple non-correlated subquery over
# INFORMARTION_SCHEMA.TABLES
# Bug#2123 query with a simple non-correlated subquery over
# INFORMARTION_SCHEMA.TABLES
#
SELECT MAX(table_name) FROM information_schema.tables;
@ -931,7 +940,7 @@ SELECT table_name from information_schema.tables
FROM information_schema.tables);
#
# Bug #23037: Bug in field "Default" of query "SHOW COLUMNS FROM table"
# Bug#23037 Bug in field "Default" of query "SHOW COLUMNS FROM table"
#
# Note, MyISAM/InnoDB can't take more that 65532 chars, because the row
# size is limited to 65535 bytes (BLOBs not counted)
@ -975,7 +984,7 @@ DROP FUNCTION get_value;
#
# Bug#22413: EXPLAIN SELECT FROM view with ORDER BY yield server crash
# Bug#22413 EXPLAIN SELECT FROM view with ORDER BY yield server crash
#
create view v1 as
select table_schema as object_schema,
@ -1001,7 +1010,7 @@ drop table t1,t2;
#
# Bug#24630 Subselect query crashes mysqld
# Bug#24630 Subselect query crashes mysqld
#
select 1 as f1 from information_schema.tables where "CHARACTER_SETS"=
(select cast(table_name as char) from information_schema.tables
@ -1028,8 +1037,8 @@ group by t.table_name order by num1, t.table_name;
#
create table t1(f1 int);
create view v1 as select f1+1 as a from t1;
create table t2 (f1 int, f2 int);
create view v2 as select f1+1 as a, f2 as b from t2;
create table t2 (f1 int, f2 int);
create view v2 as select f1+1 as a, f2 as b from t2;
select table_name, is_updatable from information_schema.views;
#
# Note: we can perform 'delete' for non updatable view.
@ -1039,7 +1048,7 @@ drop view v1,v2;
drop table t1,t2;
#
# Bug#25859 ALTER DATABASE works w/o parameters
# Bug#25859 ALTER DATABASE works w/o parameters
#
--error ER_PARSE_ERROR
alter database;
@ -1068,6 +1077,7 @@ show triggers;
select trigger_name from information_schema.triggers
where event_object_table='t1';
connection default;
disconnect con27629;
drop user mysqltest_1@localhost;
drop database mysqltest;
@ -1111,13 +1121,13 @@ select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
#
# Bug#30079 A check for "hidden" I_S tables is flawed
#
--error 1109
--error ER_UNKNOWN_TABLE
show fields from information_schema.table_names;
--error 1109
--error ER_UNKNOWN_TABLE
show keys from information_schema.table_names;
#
# Bug#34529: Crash on complex Falcon I_S select after ALTER .. PARTITION BY
# Bug#34529 Crash on complex Falcon I_S select after ALTER .. PARTITION BY
#
USE information_schema;
SET max_heap_table_size = 16384;
@ -1126,9 +1136,9 @@ CREATE TABLE test.t1( a INT );
# What we need to create here is a bit of a corner case:
# We need a star query with information_schema tables, where the first
# branch of the star join produces zero rows, so that reading of the
# branch of the star join produces zero rows, so that reading of the
# second branch never happens. At the same time we have to make sure
# that data for at least the last table is swapped from MEMORY/HEAP to
# that data for at least the last table is swapped from MEMORY/HEAP to
# MyISAM. This and only this triggers the bug.
SELECT *
FROM tables ta

View File

@ -24,17 +24,17 @@ let $1 = 100;
while ($1)
{
let $2 = 5;
eval insert into t1(t) values ('$1');
eval insert into t1(t) values ('$1');
while ($2)
{
eval insert into t2(id2,t) values ($1,'$2');
eval insert into t2(id2,t) values ($1,'$2');
let $3 = 10;
while ($3)
{
eval insert into t3(id3,t) values ($1,'$2');
eval insert into t3(id3,t) values ($1,'$2');
dec $3;
}
dec $2;
dec $2;
}
dec $1;
}
@ -79,11 +79,11 @@ let $1 = 1000;
while ($1)
{
let $2 = 5;
eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
while ($2)
{
eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
dec $2;
eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
dec $2;
}
dec $1;
}
@ -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
where 0=1;
delete t1, t2 from t2,t1
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
@ -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,'B01-Comp',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 t2;
drop table t1, t2;
@ -379,6 +379,9 @@ revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
connection default;
disconnect user1;
disconnect root;
#
# multi delete wrong table check
@ -393,7 +396,7 @@ drop table t1, t2, t3;
#
# multi* unique updating table check
#
create table t1 (col1 int);
create table t1 (col1 int);
create table t2 (col1 int);
-- error ER_UPDATE_TABLE_USED
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;
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
create table t1 (
aclid bigint not null primary key,
status tinyint(1) not null
aclid bigint not null primary key,
status tinyint(1) not null
) engine = innodb;
create table t2 (
refid bigint not null primary key,
aclid bigint, index idx_acl(aclid)
refid bigint not null primary key,
aclid bigint, index idx_acl(aclid)
) engine = innodb;
--enable_warnings
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';
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 t2(a int);
@ -428,7 +431,7 @@ drop table t1, t2;
# End of 4.1 tests
#
# Test for bug #1980.
# Test for Bug#1980.
#
--disable_warnings
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;
connect (updater,localhost,root,,test);
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;
connection locker;
# Wait till "update t1, v1 ..." is in work.
sleep 2;
unlock tables;
@ -500,8 +506,14 @@ select * from t2;
drop view v1;
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` (
@ -536,11 +548,12 @@ reset master;
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be the UPDATE query event */;
# cleanup bug#27716
# cleanup
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
@ -569,7 +582,7 @@ select count(*) from t3 /* must be 1 */;
# the query must be in binlog (no surprise though)
source include/show_binlog_events.inc;
# cleanup bug#29136
# cleanup
drop table t1, t2, t3;

View File

@ -1,6 +1,14 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,);
connection con1;
-- error 1064,1102,1280
--error ER_PARSE_ERROR,ER_WRONG_DB_NAME,ER_WRONG_NAME_FOR_INDEX
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
connection default;
disconnect con1;
# End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View File

@ -4,12 +4,18 @@
# swallowing them and returning an error
--source include/not_windows.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
#
# 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;
set global max_allowed_packet=100;
set max_allowed_packet=100;
@ -19,6 +25,8 @@ set net_buffer_length=100;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
# Should return NULL as 2000 is bigger than max_allowed_packet
select repeat('a',2000);
connection default;
disconnect con1;
#
# Connection 2 should get error for too big packets
@ -26,7 +34,7 @@ select repeat('a',2000);
connect (con2,localhost,root,,);
connection con2;
select @@net_buffer_length, @@max_allowed_packet;
--error 1153
--error ER_NET_PACKET_TOO_LARGE
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
set global max_allowed_packet=default;
set max_allowed_packet=default;
@ -34,5 +42,13 @@ set global net_buffer_length=default;
set net_buffer_length=default;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
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
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View File

@ -1,6 +1,10 @@
-- source include/have_query_cache.inc
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
#
# Tests with query cache
#
@ -79,7 +83,7 @@ show status like "Qcache_free_blocks";
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);
connection root;
@ -96,10 +100,13 @@ SELECT * FROM t1;
connection root;
SELECT * FROM t1;
drop table t1;
connection default;
disconnect root;
disconnect root2;
#
# query in QC from normal execution and SP (BUG#6897)
# improved to also test BUG#3583 and BUG#12990
# query in QC from normal execution and SP (Bug#6897)
# improved to also test Bug#3583 and Bug#12990
#
flush query cache;
reset query cache;
@ -181,7 +188,7 @@ drop procedure f4;
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;
--disable_warnings
@ -223,4 +230,36 @@ connection default;
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
# Wait till we reached the initial number of concurrent sessions
#--source include/wait_until_count_sessions.inc

View File

@ -5,6 +5,9 @@
# 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 (con2root,localhost,root,,);
connect (con3root,localhost,root,,);
@ -17,7 +20,7 @@ drop table if exists t1;
--enable_warnings
create table t1 (s1 int, s2 int, s3 int);
delimiter //;
delimiter //;
create procedure bug4934()
begin
insert into t1 values (1,0,1);
@ -38,7 +41,7 @@ drop table t1;
create table t1 (s1 int, s2 int, s3 int);
drop procedure bug4934;
delimiter //;
delimiter //;
create procedure bug4934()
begin
end//
@ -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
drop procedure if exists bug9486;
@ -87,8 +90,9 @@ reap;
drop procedure bug9486;
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
drop procedure if exists bug11158;
@ -114,8 +118,9 @@ connection con1root;
drop procedure bug11158;
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
drop function if exists bug11554;
@ -134,7 +139,7 @@ drop table t1;
drop view v1;
# BUG#12228
# Bug#12228 Crash happens during calling specific SP in multithread environment
--disable_warnings
drop procedure if exists p1;
drop procedure if exists p2;
@ -168,18 +173,26 @@ connection con2root;
unlock tables;
connection con1root;
# Crash will be here if we hit BUG#12228
# Crash will be here if we hit Bug#12228
reap;
drop procedure p1;
drop procedure p2;
drop table t1;
#
# BUG#NNNN: New bug synopsis
# Bug#NNNN New bug synopsis
#
#--disable_warnings
#drop procedure if exists bugNNNN;
#--enable_warnings
#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

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,13 @@
# 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
# table
# Test for Bug#2385 CREATE TABLE LIKE lacks locking on source and destination
# table
#
--disable_warnings
drop table if exists t1;
DROP TABLE IF EXISTS t1,t2;
--enable_warnings
connect (con1,localhost,root,,);
@ -12,12 +15,12 @@ connect (con2,localhost,root,,);
# locking of source:
CREATE TABLE t1 (x1 int);
CREATE TABLE t1 (x1 INT);
let $1= 10;
while ($1)
{
connection con1;
send ALTER TABLE t1 CHANGE x1 x2 int;
send ALTER TABLE t1 CHANGE x1 x2 INT;
connection con2;
CREATE TABLE t2 LIKE t1;
replace_result x1 xx x2 xx;
@ -25,7 +28,7 @@ while ($1)
DROP TABLE t2;
connection con1;
reap;
send ALTER TABLE t1 CHANGE x2 x1 int;
send ALTER TABLE t1 CHANGE x2 x1 INT;
connection con2;
CREATE TABLE t2 LIKE t1;
replace_result x1 xx x2 xx;
@ -37,4 +40,11 @@ while ($1)
}
DROP TABLE t1;
connection default;
disconnect con1;
disconnect con2;
# End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View File

@ -1,15 +1,18 @@
# Embedded server testing does not support grants
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings
drop tables if exists t1, t2;
drop view if exists v1;
--enable_warnings
#
# Test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone
# tables". We should allow implicit access to time zone description tables
# even for unprivileged users.
# Test for Bug#6116 SET time_zone := ... requires access to mysql.time_zone tables
# We should allow implicit access to time zone description tables even for
# unprivileged users.
#
# Let us prepare playground
@ -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')
where t1.a = t2.c and t2.d = (select max(d) from t2);
# But still these two statements should not work:
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
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;
connection default;
disconnect tzuser;
#
# Test for bug #6765 "Implicit access to time zone description tables
# requires privileges for them if some table or column level grants
# present"
# Bug#6765 Implicit access to time zone description tables requires privileges
# for them if some table or column level grants present
#
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
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
@ -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')
where t1.a = t2.c and t2.d = (select max(d) from t2);
# Again these two statements should not work (but with different errors):
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
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;
#
# Bug #9979: Use of CONVERT_TZ in multiple-table UPDATE causes bogus
# privilege error
# Bug#9979 Use of CONVERT_TZ in multiple-table UPDATE causes bogus
# privilege error
#
drop table t1, t2;
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
# Clean-up
connection default;
disconnect tzuser2;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
@ -89,10 +95,9 @@ drop table t1, t2;
# End of 4.1 tests
#
# Additional test for bug #15153: CONVERT_TZ() is not allowed in all
# places in views.
# Additional test for Bug#15153 CONVERT_TZ() is not allowed in all 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.
# Let us rely on that previous tests done proper cleanups
@ -109,7 +114,11 @@ drop view v1;
--error ER_TABLEACCESS_DENIED_ERROR
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1, mysql.time_zone;
connection default;
disconnect tzuser3;
drop table t1;
drop user mysqltest_1@localhost;
# End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc