summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@station.>2007-12-13 12:06:37 +0300
committerunknown <anozdrin/alik@station.>2007-12-13 12:06:37 +0300
commitf2b8de236827d12fdb3d48a15f9cac2fcd344cdf (patch)
tree9a07f340dee38c8809e640e9365a67fbbeb1086f /mysql-test
parent0d5caaa4a1213e7d2d52a27ed41de32f3da0c050 (diff)
parenta3a0d4359fef580a30704797ceeed613600deedc (diff)
downloadmariadb-git-f2b8de236827d12fdb3d48a15f9cac2fcd344cdf.tar.gz
Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into station.:/mnt/raid/alik/MySQL/devel/5.1-rt sql/ha_partition.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_report.pl1
-rw-r--r--mysql-test/r/events.result3
-rw-r--r--mysql-test/r/grant.result4
-rw-r--r--mysql-test/r/read_only.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result4
-rw-r--r--mysql-test/t/grant.test1
-rw-r--r--mysql-test/t/read_only.test35
8 files changed, 72 insertions, 8 deletions
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index a0a796dddf2..b1f15e5e187 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -304,6 +304,7 @@ sub mtr_report_stats ($) {
/Slave: Error .*Unknown table/ or
/Slave: Error in Write_rows event: / or
/Slave: Field .* of table .* has no default value/ or
+ /Slave: Field .* doesn't have a default value/ or
/Slave: Query caused different errors on master and slave/ or
/Slave: Table .* doesn't exist/ or
/Slave: Table width mismatch/ or
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index d1ee6d1c5a1..7b68914e219 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -403,9 +403,10 @@ ERROR 42S02: Table 'mysql.event' doesn't exist
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
-Error 1146 Table 'mysql.event' doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1146 Table 'mysql.event' doesn't exist
OK, there is an unnecessary warning about the non-existent table
but it's not easy to fix and no one complained about it.
A similar warning is printed if mysql.proc is missing.
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index c46f29b787f..0df3ac6de8a 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1269,9 +1269,7 @@ use test;
FLUSH PRIVILEGES without procs_priv table.
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
FLUSH PRIVILEGES;
-Warnings:
-Error 1146 Table 'mysql.procs_priv' doesn't exist
-Error 1548 Cannot load from mysql.mysql.procs_priv. The table is probably corrupted
+ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
Assigning privileges without procs_priv table.
CREATE DATABASE mysqltest1;
CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result
index f270f1ed5ad..cf81566f4e5 100644
--- a/mysql-test/r/read_only.result
+++ b/mysql-test/r/read_only.result
@@ -97,3 +97,31 @@ Note 1051 Unknown table 'ttt'
set global read_only=0;
drop table t1,t2;
drop user test@localhost;
+#
+# Bug #27440 read_only allows create and drop database
+#
+set global read_only= 1;
+drop database if exists mysqltest_db1;
+drop database if exists mysqltest_db2;
+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_%';
+delete from mysql.columns_priv where User like 'mysqltest_%';
+flush privileges;
+grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
+create database mysqltest_db1;
+grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
+flush privileges;
+create database mysqltest_db2;
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+show databases like '%mysqltest_db2%';
+Database (%mysqltest_db2%)
+drop database mysqltest_db1;
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+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_%';
+delete from mysql.columns_priv where User like 'mysqltest_%';
+flush privileges;
+drop database mysqltest_db1;
+set global read_only=0;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index 06dc90f18aa..a8e1c8602e0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1364
-Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index 3911fe89b7f..12203379269 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1364
-Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index d9ee38d0c14..16cccd1a1f4 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1362,6 +1362,7 @@ use test;
#
--echo FLUSH PRIVILEGES without procs_priv table.
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
+--error ER_NO_SUCH_TABLE
FLUSH PRIVILEGES;
--echo Assigning privileges without procs_priv table.
CREATE DATABASE mysqltest1;
diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test
index 709238c3d76..fd41a3225a6 100644
--- a/mysql-test/t/read_only.test
+++ b/mysql-test/t/read_only.test
@@ -225,3 +225,38 @@ connection default;
set global read_only=0;
drop table t1,t2;
drop user test@localhost;
+--echo #
+--echo # Bug #27440 read_only allows create and drop database
+--echo #
+set global read_only= 1;
+--disable_warnings
+drop database if exists mysqltest_db1;
+drop database if exists mysqltest_db2;
+--enable_warnings
+
+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_%';
+delete from mysql.columns_priv where User like 'mysqltest_%';
+flush privileges;
+
+grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
+create database mysqltest_db1;
+grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
+flush privileges;
+connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,$MASTER_MYPORT,);
+connection con_bug27440;
+--error ER_OPTION_PREVENTS_STATEMENT
+create database mysqltest_db2;
+show databases like '%mysqltest_db2%';
+--error ER_OPTION_PREVENTS_STATEMENT
+drop database mysqltest_db1;
+disconnect con_bug27440;
+connection default;
+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_%';
+delete from mysql.columns_priv where User like 'mysqltest_%';
+flush privileges;
+drop database mysqltest_db1;
+set global read_only=0;