Ticket #12811: MythWeb-SQL_mode_patch.diff

File MythWeb-SQL_mode_patch.diff, 512 bytes (added by sphery, 5 years ago)

Set the SQL mode when connecting to the database

  • classes/Database.

    old new  
    120120            $class = "Database_$engine";
    121121            $dbh = new $class($db_name, $login, $password, $server, $port, $options);
    122122        }
     123    // Set SQL mode
     124        $dbh->query('SET SESSION sql_mode = "";');
    123125    // Set database connection to utf8
    124126        $dbh->query('SET NAMES utf8;');
    125127    // Make sure UNIX_TIMESTAMP AND FROM_UNIXTIME do the right things