Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12062

Unicode check returns MySQL server default collation rather than the database collation - problem on hosted servers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.8
    • Installation, Language
    • None
    • MySQL
    • MOODLE_18_STABLE

      During installation, to ensure that the database uses unicode, there is a check to make sure that the database is using UTF8; however, the current check returns the collation default for the MySQL server rather than the particular database. As a result, if a hosted website by default uses latin1 but the user creates a utf8 database they still cannot install Moodle.

      After researching the issue, I discovered that in MySQL 5.0.6 it became possible to check the collation of a particular database and I think we should use that rather than then previous method to help avoid issues on hosted sites. I am attaching the PMA_getDbCollation function used by phpMyAdmin to show how things work.

      In essence I am proposing that if the database is MySQL 5.0.6 and greater that we use:

      SELECT DEFAULT_COLLATION_NAME
      FROM information_schema.SCHEMATA
      WHERE SCHEMA_NAME = 'database_name';

      rather than SHOW VARIABLES LIKE 'character_set_database';

      Peace - Anthony

            dougiamas Martin Dougiamas
            aborrow Anthony Borrow
            Nobody Nobody
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.