summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/grant_repair.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/grant_repair.test')
-rw-r--r--mysql-test/main/grant_repair.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/grant_repair.test b/mysql-test/main/grant_repair.test
new file mode 100644
index 00000000..f07e4df3
--- /dev/null
+++ b/mysql-test/main/grant_repair.test
@@ -0,0 +1,21 @@
+#
+# MDEV-20257 Server crashes in Grant_table_base::init_read_record upon crash-upgrade
+#
+source include/not_embedded.inc;
+
+call mtr.add_suppression("mysql.user");
+source include/switch_to_mysql_user.inc;
+
+let mysql_datadir=`select @@datadir`;
+flush tables;
+perl;
+ $f=$ENV{mysql_datadir} . '/mysql/user.MAI';
+ sysopen F, $f, 2 or die "sysopen $f: $!";
+ # set the open_count to 1, "table was not closed properly"
+ sysseek F, 24, O_RDWR or die "sysseek: $!";
+ syswrite F, 1, 1 or die "syswrite: $!";
+EOF
+replace_result \\ /;
+flush privileges;
+
+source include/switch_to_mysql_global_priv.inc;