Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
grypyrg opened this issue Nov 18, 2015 · 2 comments

Comments

@grypyrg
Copy link

grypyrg commented Nov 18, 2015

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
@deadmantfa
Copy link

+1

@DJUserkent
Copy link

DJUserkent commented Aug 8, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants