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

Add support for MySQL 8 and use of grouping as name for a column #2872

Closed
rafaeldtinoco opened this issue Aug 2, 2019 · 7 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@rafaeldtinoco
Copy link

rafaeldtinoco commented Aug 2, 2019

Describe the bug

Table "aggregate_graph_templates" variable "grouping" is a keyword in recent
MySQL versions.

To Reproduce

Steps to reproduce the behavior: Try to import cacti.sql into a MySQL 8, for example.

Expected behavior

Well, unfortunately it isn't cacti's fault that MySQL project created a function named "grouping" in recent versions. Unfortunately, because of that, cacti.sql will have to change the field name. Nevertheless, looking at cacti's code, I could not find a reference to that field, possibly it is being used through positional reference and not name.

Desktop (please complete the following information):

  • OS: Debian & Ubuntu (We are merging new MySQL 8 version into Ubuntu, and this but came from autopkgtests). Issue has been reported here.
  • I suggested, through Debian, the following simple change.

Additional context

We, the Canonical Server Team, are making sure Cacti is good in Ubuntu Eoan. We need this fix landing in Upstream and Debian in order to reduce Ubuntu delta. Thanks a lot for considering this, or suggesting a better fix for us to consider.

@rafaeldtinoco
Copy link
Author

ERROR 1064 (42000) at line 1666: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grouping char(2) NOT NULL default '',
t_unit_value char(2) default '',
unit_' at line 38

@rafaeldtinoco
Copy link
Author

According to:
https://dev.mysql.com/doc/refman/8.0/en/keywords.html

GROUPING (R); added in 8.0.1 (reserved)
GROUPS (R); added in 8.0.2 (reserved)

@rafaeldtinoco
Copy link
Author

ALRIGHT .. so instead of changing the field name, we could use `` in "grouping" keyword, just as it was used in the beginning of cacti. There is another issue for MySQL 8 as well:

ERROR 1231 (42000) at line 6: Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'

NO_AUTO_CREATE_USER is the default moe now and the SQL_MODE does not exist anymore. I'll provide patches fixing those 2 issues and suggest it here.

@rafaeldtinoco
Copy link
Author

I have proposed:

b14b3da

To address this issue.

Thanks for considering it.

@rafaeldtinoco
Copy link
Author

Just got feedback that I have to address MariaDB versions also. Will re-push with a fix.

@rafaeldtinoco
Copy link
Author

Alright I have addressed MySQL and MariaDB now.

Merge Request
Thanks!

@cigamit
Copy link
Member

cigamit commented Aug 11, 2019

Yup merged and fixed. Next time, please update the CHANGELOG file too. Thanks for sure though!!!

@cigamit cigamit changed the title Table "aggregate_graph_templates" variable "grouping" is a keyword in recent MySQL versions. Cacti support for MySQL 8 and use of grouping table column Aug 11, 2019
cigamit added a commit that referenced this issue Aug 11, 2019
Cacti support for MySQL 8 and use of grouping table column
@cigamit cigamit added bug Undesired behaviour resolved A fixed issue labels Aug 11, 2019
@cigamit cigamit added this to the v1.2.6 milestone Aug 11, 2019
@cigamit cigamit closed this as completed Aug 11, 2019
@netniV netniV changed the title Cacti support for MySQL 8 and use of grouping table column Add support for MySQL 8 and use of grouping as name for a column Sep 1, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants