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

Sorting plugins by version can lead to unexpected ordering #2905

Closed
ddb4github opened this issue Aug 20, 2019 · 5 comments
Closed

Sorting plugins by version can lead to unexpected ordering #2905

ddb4github opened this issue Aug 20, 2019 · 5 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@ddb4github
Copy link
Contributor

Describe the bug
Console --> Plugins sort by version fail if version is two digit number: 1.5.1 < 10.2 < 2.3

To Reproduce
Steps to reproduce the behavior:

  1. Change maint plugin version from 1.2 to 10.2
  2. Access Console --> Plugins
  3. Order by version column
  4. See error

Expected behavior
10.2 should bigger than 4.4

Screenshots
image

@netniV
Copy link
Member

netniV commented Aug 20, 2019

That is because the version is stored as a text field within the database. There is a calculation that gets used in 1.3 to have better version comparision. We could potentially store that calculated result to ensure fields are sorted as expected but that would be a full enhancement rather than a bug fix.

@netniV netniV changed the title Console --> Plugins sort by version fail if version is two digit number Sorting plugins by version can lead to unexpected ordering Aug 20, 2019
@ddb4github
Copy link
Contributor Author

Just test, 'ORDER BY INET_ATON(version)' is workable

mysql>SELECT id, directory, name, version FROM plugin_config ORDER BY INET_ATON(version);
+----+---------------+--------------------------------+---------+
| id | directory     | name                           | version |
+----+---------------+--------------------------------+---------+
| 13 | webseer       | Web Service Monitor            | 0.3.0.0 |
|  2 | audit         | Audit Plugin for Cacti         | 1.0     |
| 42 | wmi           | WMI Information Collector      | 1.0     |
| 35 | reportit      | Reporting tool for Cacti       | 1.1.3   |
|  6 | thold         | Thresholds                     | 1.3.2   |
|  5 | gexport       | Graph Export Package for Cacti | 1.4.2   |
| 12 | routerconfigs | Router Configs                 | 1.5.1   |
| 10 | mikrotik      | MikroTik Switch Tool           | 2.3     |
| 38 | syslog        | Syslog Monitoring              | 2.4     |
| 14 | monitor       | Device Monitoring              | 2.3.6   |
|  4 | flowview      | FlowView                       | 3.0.0   |
|  8 | hmib          | Host MIB Tool                  | 3.1     |
|  1 | cycle         | Cycle Graphs                   | 4.2     |
|  3 | mactrack      | Device Tracking                | 4.4     |
| 43 | maint         | Maintenance Scheduler          | 10.2    |
+----+---------------+--------------------------------+---------+

@TheWitness
Copy link
Member

Well Jing, you've been playing. ;)

@netniV
Copy link
Member

netniV commented Aug 21, 2019

I like that! A new one to me but it appears to work, presumably because it's converting it like an IP address.

@netniV
Copy link
Member

netniV commented Aug 21, 2019

This should now be resolved, thanks @ddb4github

@netniV netniV closed this as completed Aug 21, 2019
@netniV netniV self-assigned this Aug 21, 2019
@netniV netniV added bug Undesired behaviour resolved A fixed issue labels Aug 21, 2019
@netniV netniV added this to the v1.2.6 milestone Aug 21, 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

3 participants