Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51549

MariaDb version check

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 2.7.8, 2.7.10, 2.8.7, 2.8.8, 2.9.1, 2.9.2
    • Database SQL/XMLDB
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Easy

      As it was seen on this already closed bug:

      https://tracker.moodle.org/browse/MDL-45070

      Moodle has some troubles detecting the version of MariaDB since it has two major branches which has two version branches: 5+ and 10+.

      In this commit, https://github.com/moodle/moodle/commit/1dd74afe9e035200b75955d9e7366f6091055b31
      the issue was fixed in case the server's got the PHP configured to use the MariaDB plugin but, since there are servers that use MySQL's one to configure MariaDB, it won't work in all the cases.

      The issue is easily fixed by changing the get_server_info() function that is also present in the mysqli_native_moodle_database.php file and make it to return the same info that it's done in the commit previously shown:

      public function get_server_info() {
      $version = $this->mysqli->server_info;
      $matches = null;
      if (preg_match('/^5\.5\.5-(10\..+)-MariaDB$/i', $version, $matches))

      { $version = $matches[1]; }

      return array('description'=>$this->mysqli->server_info, 'version'=>$version);
      }

      I did it in my server and now it's working perfectly.

      Thank you for your colaboration and best regards.

            Unassigned Unassigned
            saso222 Ignacio Ruiz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.