6383eb
diff -up qt-everywhere-opensource-src-4.8.7/src/sql/drivers/mysql/qsql_mysql.cpp.mariadb qt-everywhere-opensource-src-4.8.7/src/sql/drivers/mysql/qsql_mysql.cpp
6383eb
--- qt-everywhere-opensource-src-4.8.7/src/sql/drivers/mysql/qsql_mysql.cpp.mariadb	2015-05-07 09:14:48.000000000 -0500
6383eb
+++ qt-everywhere-opensource-src-4.8.7/src/sql/drivers/mysql/qsql_mysql.cpp	2017-10-23 14:13:15.871808984 -0500
6383eb
@@ -1105,11 +1105,16 @@ static void qLibraryInit()
6383eb
     }
6383eb
 # endif // MYSQL_VERSION_ID
6383eb
 #endif // Q_NO_MYSQL_EMBEDDED
6383eb
+
6383eb
+#if defined(MARIADB_BASE_VERSION) || defined(MARIADB_VERSION_ID)
6383eb
+    qAddPostRoutine(mysql_server_end);
6383eb
+#endif
6383eb
 }
6383eb
 
6383eb
 static void qLibraryEnd()
6383eb
 {
6383eb
 #ifndef Q_NO_MYSQL_EMBEDDED
6383eb
+#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID)
6383eb
 # if MYSQL_VERSION_ID > 40000
6383eb
 #  if (MYSQL_VERSION_ID >= 40110 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50003
6383eb
     mysql_library_end();
6383eb
@@ -1118,6 +1123,7 @@ static void qLibraryEnd()
6383eb
 #  endif
6383eb
 # endif
6383eb
 #endif
6383eb
+#endif
6383eb
 }
6383eb
 
6383eb
 QMYSQLDriver::QMYSQLDriver(QObject * parent)