ExpressionEngine / ExpressionEngine

ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.

Home Page:https://expressionengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error backing up database if field is set() type

robinsowell opened this issue · comments

User was trying to backup the database using the Utilities tool, and gets a

Cannot Make Backup
Non-existant column requested: exp_m_accounts.account_active

I dig- field does exist. I describe:

account_active 	set('YES','NO')

Turns out, when figuring out the mysql table field types, we do (service/database/backup/query.php):

    protected function getDataType($column_type)
    {
        $type = strtolower($column_type);

        if (strpos($type, 'binary') !== false or
            strpos($type, 'blob') !== false) {
            return self::BINARY_TYPE;
        } elseif (strpos($type, 'char') !== false or
            strpos($type, 'text') !== false or
            strpos($type, 'date') !== false or
            strpos($type, 'time') !== false or
            strpos($type, 'enum') !== false) {
            return self::STRING_TYPE;
        } elseif (strpos($type, 'int') !== false or
            strpos($type, 'float') !== false or
            strpos($type, 'double') !== false or
            strpos($type, 'decimal') !== false) {
            return self::NUMBER_TYPE;
        }
    }

And set is never included. I think it's an easy fix, but I couldn't figure out whether it should be a string or number type or... idk. So I'm dropping it here. Rare case, but... it happens.

I think it should be a String, does your backup work if you add 'set' to the list of STRING_TYPE columns?