Skip to content
  • Richard Mansfield's avatar
    Use MySQL database collation for string literals (bug #985608) · ddc69cb0
    Richard Mansfield authored
    
    
    In MySQL, the collation for string literals in SQL expressions is
    defined by the connection collation, which can be different from the
    column collations inside the database.  When comparing string literals
    to values selected from the database, this can result in an "Illegal
    mix of collations" error, even if both the connection and the database
    use the same character set.
    
    Mahara already requires the column and connection character sets to be
    utf8, but doesn't care about the collations, so we can fix this with
    the MySQL "SET CHARACTER SET" statement, which sets the connection
    collation to match the database collation.
    
    Change-Id: Ied6fcf7062fae5aa315a43ec9ce80883e6ef5b2e
    Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
    ddc69cb0