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

fix: Alter the database to set the proper character set and collation #6189

Merged
merged 1 commit into from Mar 14, 2017

Conversation

Projects
None yet
5 participants
@murrant
Copy link
Member

murrant commented Mar 13, 2017

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

@mention-bot

This comment has been minimized.

Copy link

mention-bot commented Mar 13, 2017

Thank you for submitting a PR @murrant! We have found the following @f0o, @laf and @clinta based on the history of these files to review this PR.

@LibreNMS-CI

This comment has been minimized.

Copy link

LibreNMS-CI commented Mar 13, 2017

Auto-Deploy finished, Test PR at http://6189.ci.librenms.org or https://6189.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Copy link

scrutinizer-notifier commented Mar 13, 2017

The inspection completed: No new issues

@laf

This comment has been minimized.

Copy link
Member

laf commented Mar 13, 2017

This will run every 5 minutes as it's called from discovery.php.

Is it worth moving to validate.php and not throwing a fail just fixing it?

@murrant

This comment has been minimized.

Copy link
Member Author

murrant commented Mar 13, 2017

@laf If you look closely, it will only run if the schema is out of date.

Also, the ALTER query (assuming no change is needed) takes about the same time as the query to check what character set and collation are set to.

@laf

This comment has been minimized.

Copy link
Member

laf commented Mar 13, 2017

That's the issue when diffs only show the changes and no info is provided :)

@@ -59,6 +59,9 @@
return;
}
// Set Database Character set and Collation
dbQuery('ALTER DATABASE ? CHARACTER SET utf8 COLLATE utf8_unicode_ci;', array(array($config['db_name'])));

This comment has been minimized.

Copy link
@laf

laf Mar 13, 2017

Member

I'm assuming the double array is needed?

This comment has been minimized.

Copy link
@murrant

murrant Mar 14, 2017

Author Member

Yes, the second array removes the surrounding quotes.

Otherwise, the query is ALTER DATABASE 'librenms' CHARACTER SET utf8 COLLATE utf8_unicode_ci;

@laf laf merged commit 0f5091d into librenms:master Mar 14, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@murrant murrant deleted the murrant:db-charset-collation branch Mar 14, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.