You are here

function date_api_update_6005 in Date 6.2

Make sure MYSQL does not stupidly do case-insensitive searches and indexes on our formats.

See also

http://pure.rednoize.com/2006/11/26/mysql-collation-matters-when-using-u...

http://jjinux.blogspot.com/2009/03/mysql-case-sensitivity-hell.html

http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html

File

./date_api.install, line 484

Code

function date_api_update_6005() {
  global $db_type;
  $ret = array();
  if ($db_type == 'mysql' || $db_type == 'mysqli') {
    $sql = "ALTER TABLE {date_formats} CHANGE format format VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL";
    $ret[] = update_sql($sql);
    $sql = "ALTER TABLE {date_format_locale} CHANGE format format VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL";
    $ret[] = update_sql($sql);
  }
  return $ret;
}