Moodle 3.10 wrongly identifies MariaDB version...

Re: Moodle 3.10 wrongly identifies MariaDB version...

by Peter Eliyahu Kornfeld -
Number of replies: 0
For all who has the same problem...

First of all - I found that it is a Azure related problem...
https://docs.microsoft.com/en-us/azure/mysql/concepts-limits

Current known issues
MySQL server instance displays the wrong server version after connection is established. To get the correct server instance engine version, use the select version(); command.

And finally to resolve it I changed the get_server_info method in lib/dml/mysqli_native_moodle_database.php to look like this:

public function get_server_info() { 

    $res = $this->mysqli->query("SELECT VERSION() AS VERSION;"); 

    $res->data_seek(0); 

    $data = $res->fetch_array(); 

    return array('description'=>$data["VERSION"], 'version'=>$data["VERSION"]); 

}

Average of ratings: Useful (3)