Anemometer icon indicating copy to clipboard operation
Anemometer copied to clipboard

mariadb 10.0 has performance schema statement digest, but anemometer doesn't like it

Open grypyrg opened this issue 8 years ago • 2 comments

Fatal error: Uncaught exception 'Exception' with message 'Datasource dbv1 has a source_type of performance_schema which requires mysql version >= 5.6. Found version: 10.0.19-MariaDB-2~wheezy-log' in /var/www/anemometer/lib/AnemometerModel.php:138 Stack trace: #0 /var/www/anemometer/lib/Anemometer.php(64): AnemometerModel->set_data_source('dbv1') #1 /var/www/anemometer/index.php(40): Anemometer->__construct(Array) #2 {main} thrown in /var/www/anemometer/lib/AnemometerModel.php on line 138

grypyrg avatar Nov 18 '15 15:11 grypyrg

+1

deadmantfa avatar Aug 07 '16 15:08 deadmantfa

Looks like a 2 minute fix - can someone also get this patched in github? To stop the Anemometer error with mariaDB: " performance_schema which requires mysql version 5.6".

I've not tested in the real world, - but looking at the source code: seems like the Anemometer version check breaks when mariaDB returns a version number that contains text: ( 10.0.19-MariaDB-2~wheezy-log), which causes the test that the version is >= 5.6 to fail. Simple to fix in PHP, or just delete the whole check.

Look into the Anemometer code at AnemometerModel.php, and see the line: if ($row['@@version'] >= '5.6')

in the code block below:

           // check for correct mysql version with performance schema source type
            $this->connect_to_datasource();
            $result = $this->mysqli->query("SELECT @@version");
            $version = 'unknown';
            if (is_object($result))
            {
                $row = $result->fetch_assoc();
                if ($row['@@version'] >= '5.6')
                {
                    return true;
                }
                $version = $row['@@version'];
            }
            throw new Exception("Datasource {$name} has a source_type of performance_schema which requires mysql version >= 5.6.  Found version: {$version}");
        }

https://github.com/box/Anemometer/blob/master/lib/AnemometerModel.php

DJUserkent avatar Aug 08 '16 17:08 DJUserkent