From 817c8f2492c77c1dd7ef5dcb9399dff243ea6172 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 24 May 2018 13:26:36 +0200 Subject: [PATCH] [ADDED] Check MySQL 5.7 in version string for admin setup page --- .../admin/checks/check_mysql_version.inc.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/pages/admin/checks/check_mysql_version.inc.php diff --git a/include/pages/admin/checks/check_mysql_version.inc.php b/include/pages/admin/checks/check_mysql_version.inc.php new file mode 100644 index 00000000..2d8fd520 --- /dev/null +++ b/include/pages/admin/checks/check_mysql_version.inc.php @@ -0,0 +1,21 @@ +query('SELECT VERSION() AS version')->fetch_object()->version; + +// This should be set if we are running on 5.7 +$mysql_mode = $mysqli->query('SELECT @@GLOBAL.sql_mode AS sql_mode')->fetch_object()->sql_mode; + +// see if it includes 5.7 +if (strpos($mysql_version, '5.7') !== false && $mysql_mode != 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION') { + $newerror = array(); + $newerror['name'] = "MySQL Version"; + $newerror['level'] = 3; + $newerror['description'] = "SQL version not fully supported."; + $newerror['configvalue'] = "db.*"; + $newerror['extdesc'] = "You are using MySQL Version $mysql_version which is not fully supported. You may run into issues during payout when using this version of MySQL. Please see our Wiki FAQ on how to workaround any potential issues. This check only matches your version string against `5.7` so you may still be fine."; + $newerror['helplink'] = ""; + $error[] = $newerror; + $newerror = null; +}