summaryrefslogtreecommitdiff
path: root/mysql-test/t/read_only.test
diff options
context:
space:
mode:
authorMatthias Leich <Matthias.Leich@sun.com>2009-03-03 21:34:18 +0100
committerMatthias Leich <Matthias.Leich@sun.com>2009-03-03 21:34:18 +0100
commit140cc614c944154282fce87064f5e3552406a14c (patch)
treef6603b5abdb12bdc27567a91a4cf7efd469d9c8f /mysql-test/t/read_only.test
parente1a197caba314ab7c9fdc608fb57787367236c3d (diff)
downloadmariadb-git-140cc614c944154282fce87064f5e3552406a14c.tar.gz
Last slice of fix for Bug#42003 tests missing the disconnect of connections <> default
+ Fix for Bug#43114 wait_until_count_sessions too restrictive, random PB failures + Removal of a lot of other weaknesses found + modifications according to review
Diffstat (limited to 'mysql-test/t/read_only.test')
-rw-r--r--mysql-test/t/read_only.test28
1 files changed, 18 insertions, 10 deletions
diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test
index cca9bbd6fde..fdb68b28fdf 100644
--- a/mysql-test/t/read_only.test
+++ b/mysql-test/t/read_only.test
@@ -4,6 +4,9 @@
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
--enable_warnings
@@ -40,24 +43,24 @@ connection con1;
select @@global.read_only;
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
create table t3 (a int);
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t1 values(1);
# if a statement, after parse stage, looks like it will update a
# non-temp table, it will be rejected, even if at execution it would
# have turned out that 0 rows would be updated
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
update t1 set a=1 where 1=0;
# multi-update is special (see sql_parse.cc) so we test it
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
# check multi-delete to be sure
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
delete t1,t2 from t1,t2 where t1.a=t2.a;
# With temp tables updates should be accepted:
@@ -71,7 +74,7 @@ insert into t3 values(1);
insert into t4 select * from t3;
# a non-temp table updated:
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
# no non-temp table updated (just swapped):
@@ -79,7 +82,7 @@ update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a;
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
delete t1 from t1,t3 where t1.a=t3.a;
delete t3 from t1,t3 where t1.a=t3.a;
@@ -98,11 +101,11 @@ delete t1 from t1,t3 where t1.a=t3.a;
drop table t1;
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t1 values(1);
#
-# BUG #22077 "DROP TEMPORARY TABLE fails with wrong error if read_only is set"
+# Bug#22077 DROP TEMPORARY TABLE fails with wrong error if read_only is set
#
# check if DROP TEMPORARY on a non-existing temporary table returns the right
# error
@@ -114,11 +117,12 @@ drop temporary table ttt;
drop temporary table if exists ttt;
connection default;
+disconnect con1;
drop table t1,t2;
drop user test@localhost;
--echo #
---echo # Bug #27440 read_only allows create and drop database
+--echo # Bug#27440 read_only allows create and drop database
--echo #
--disable_warnings
drop database if exists mysqltest_db1;
@@ -151,3 +155,7 @@ delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges;
drop database mysqltest_db1;
set global read_only=0;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+