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

Fixed possible NumericValueOutOfRange error on hardwares.memory_mb column #40

Closed
wants to merge 1 commit into from

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented Jul 11, 2017

Custom report was throwing error when trying to convert value frommemory_mb to bytes

https://bugzilla.redhat.com/show_bug.cgi?id=1464154

@miq-bot add-label bug

\cc @gtanzillo

@miq-bot
Copy link
Member

miq-bot commented Jul 11, 2017

@yrudman unrecognized command 'bug', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@miq-bot miq-bot added the bug label Jul 11, 2017
@miq-bot
Copy link
Member

miq-bot commented Jul 11, 2017

Checked commit yrudman@67ee4d6 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@yrudman
Copy link
Contributor Author

yrudman commented Jul 13, 2017

there is alternative solution for reported bug in ManageIQ/manageiq#15554 - Cast virtual attribute Hardware#ram_size_in_bytes to bigint.

@Fryguy
Copy link
Member

Fryguy commented Jul 13, 2017

This feels like the wrong fix for the problem. While I don't mind changing this, the current columns holds the value in MB, so the max value it can hold is 2147483647 megabytes => 2.147483647 petabytes, which is way more memory that any computer system I've ever heard of.

I think your alternative solution handles it better.

@Fryguy
Copy link
Member

Fryguy commented Jul 13, 2017

Closing in favor of ManageIQ/manageiq#15554

@Fryguy Fryguy closed this Jul 13, 2017
@yrudman
Copy link
Contributor Author

yrudman commented Jul 13, 2017

right, for keeping value integer is OK, error thrown when trying to execute report and show virtual column defined as memory_mb * 1.megabyte ( = memory_mb * 1048576) and max value it can hold before out of range is 2147483647 / 1048576 = 2048 MB

@yrudman yrudman deleted the change-memory-mb-to-bigint branch July 20, 2017 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants