summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/grant_repair.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/grant_repair.test
parentInitial commit. (diff)
downloadmariadb-upstream.tar.xz
mariadb-upstream.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;