From 06e3bc4390ee286fd20b34526510768f1b32ed7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= <marko.makela@mariadb.com>
Date: Thu, 17 Mar 2022 10:33:06 +0200
Subject: [PATCH] MDEV-17841 fixup: GCC -Wmaybe-uninitialized

In commit ab38b7511bad8cc03a67f0d43e7169e6dfcac9fa
an added "goto err" would seemingly cause a read of
an uninitialized variable old_info if errpos>=5.

However, because we would have errpos=0 at that point,
there was no real error.
---
 storage/maria/ma_open.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index db15778bc23..cf5bf2a5fea 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-   Copyright (c) 2009, 2021, MariaDB Corporation Ab
+   Copyright (c) 2009, 2022, MariaDB Corporation Ab
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -276,7 +276,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
   char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
        data_name[FN_REFLEN];
   uchar *UNINIT_VAR(disk_cache), *disk_pos, *end_pos;
-  MARIA_HA info, *UNINIT_VAR(m_info), *old_info;
+  MARIA_HA info, *UNINIT_VAR(m_info), *old_info= NULL;
   MARIA_SHARE share_buff,*share;
   double *rec_per_key_part;
   ulong  *nulls_per_key_part;
@@ -327,7 +327,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
   }
 #endif /* WITH_S3_STORAGE_ENGINE */
 
-  old_info= 0;
   if (!internal_table)
     mysql_mutex_lock(&THR_LOCK_maria);
   if ((open_flags & HA_OPEN_COPY) ||
-- 
2.30.9