summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/grant4.test31
-rw-r--r--mysql-test/t/information_schema_prepare.test7
-rw-r--r--mysql-test/t/multi_update.test31
-rw-r--r--mysql-test/t/multi_update_big.opt (renamed from mysql-test/t/multi_update2-master.opt)0
-rw-r--r--mysql-test/t/multi_update_big.test (renamed from mysql-test/t/multi_update2.test)0
-rw-r--r--mysql-test/t/view_grant.test5
6 files changed, 73 insertions, 1 deletions
diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test
index a3578c9b85a..93e016ace75 100644
--- a/mysql-test/t/grant4.test
+++ b/mysql-test/t/grant4.test
@@ -145,6 +145,34 @@ disconnect con1;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
+#
+# MDEV-18241 Downgrade from 10.4 to 10.3 crashes
+#
+call mtr.add_suppression("Table 'mysql.user' doesn't exist");
+call mtr.add_suppression("'mysql.user' is not TABLE");
+rename table mysql.user to mysql.user1;
+create view mysql.user as select * from mysql.user1;
+--error ER_WRONG_OBJECT
+flush privileges;
+drop view mysql.user;
+create temporary table mysql.user select * from mysql.user1 limit 0;
+--error ER_NO_SUCH_TABLE
+flush privileges;
+drop temporary table mysql.user;
+rename table mysql.user1 to mysql.user;
+
+#
+# Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH
+#
+call mtr.add_suppression('mysql.user table is damaged');
+rename table mysql.user to mysql.user1;
+create table mysql.user (Host char(100), User char(100));
+--error ER_UNKNOWN_ERROR
+flush privileges;
+drop table mysql.user;
+rename table mysql.user1 to mysql.user;
+
+--echo End of 5.5 tests
--echo #
--echo # Additional coverage for refactoring which is made as part
@@ -235,5 +263,6 @@ create user foo3 identified via mysql_old_password using '00';
--error ER_PASSWD_LENGTH
create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111';
-
set GLOBAL sql_mode=default;
+
+--echo End of 10.1 tests
diff --git a/mysql-test/t/information_schema_prepare.test b/mysql-test/t/information_schema_prepare.test
new file mode 100644
index 00000000000..c5f3f89ff29
--- /dev/null
+++ b/mysql-test/t/information_schema_prepare.test
@@ -0,0 +1,7 @@
+#
+# MDEV-15907 ASAN heap-use-after-free in strnmov / .. / fill_effective_table_privileges on concurrent GRANT and CREATE VIEW
+#
+PREPARE stmt2 FROM "CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES";
+FLUSH PRIVILEGES;
+EXECUTE stmt2;
+DROP VIEW v;
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 0297280340d..8399c465562 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -1056,6 +1056,37 @@ deallocate prepare stmt1;
drop view v3,v2,v1;
drop table t1,t2,t3;
+
+#
+# MDEV-18507 can't update temporary table when joined with table with triggers on read-only
+#
+create table t1 (id int not null, v1 varchar(10) not null);
+insert into t1 values (1,1),(2,2);
+create table t2 (log varchar(10) not null);
+create trigger t1_after_update after update on t1
+ for each row insert into t2 values ('triggered');
+
+create user foo;
+grant select, insert, update, delete, create, drop, reload, index, alter, show databases, create temporary tables, lock tables, execute, create view, show view, create routine, alter routine, trigger on *.* to 'foo'@'%';
+
+set global read_only=1;
+connect a, localhost, foo;
+
+create temporary table temp_t1 (id int not null, update_me varchar(10));
+insert into temp_t1 values (1,1),(2,2),(3,3);
+update temp_t1 left join t1 on temp_t1.id = t1.id set temp_t1.update_me = 'hello';
+
+connection default;
+set global read_only = 0;
+
+create table t3 (id int not null);
+insert t3 values (2);
+update t1 left join t3 on t1.id = t3.id set t1.v1 = 'hello';
+select * from t2;
+
+drop table t1,t2, t3;
+drop user foo;
+
--echo end of 5.5 tests
diff --git a/mysql-test/t/multi_update2-master.opt b/mysql-test/t/multi_update_big.opt
index da78f987af3..da78f987af3 100644
--- a/mysql-test/t/multi_update2-master.opt
+++ b/mysql-test/t/multi_update_big.opt
diff --git a/mysql-test/t/multi_update2.test b/mysql-test/t/multi_update_big.test
index a0f17fabec4..a0f17fabec4 100644
--- a/mysql-test/t/multi_update2.test
+++ b/mysql-test/t/multi_update_big.test
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 6d0cd8e5c28..4f10d48ee77 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -244,6 +244,8 @@ create table mysqltest.t1 (a int, b int, primary key(a));
insert into mysqltest.t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
create table mysqltest.t2 (x int);
insert into mysqltest.t2 values (3), (4), (5), (6);
+create table mysqltest.t3 (x int);
+insert into mysqltest.t3 values (3), (4), (5), (6);
create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
@@ -251,6 +253,7 @@ create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
create user mysqltest_1@localhost;
grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
grant update on mysqltest.v1 to mysqltest_1@localhost;
+grant update on mysqltest.t3 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
connection user1;
@@ -265,6 +268,8 @@ update t2,v2 set v2.a=v2.a+v2.c where t2.x=v2.c;
select * from t1;
update v2 set a=a+c;
select * from t1;
+# update a table, select only on view
+update t3,v3 set t3.x=t3.x+v3.c where t3.x=v3.c;
# no rights on column
--error ER_COLUMNACCESS_DENIED_ERROR
update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;