Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error backing up database if field is set() type #4298

Closed
robinsowell opened this issue May 7, 2024 · 1 comment
Closed

Error backing up database if field is set() type #4298

robinsowell opened this issue May 7, 2024 · 1 comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@robinsowell
Copy link
Contributor

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.

@robinsowell robinsowell added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label May 7, 2024
@bryannielsen
Copy link
Contributor

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

bryannielsen added a commit that referenced this issue Jun 13, 2024
Resolved #4298 error backing up table with set type column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
Development

No branches or pull requests

2 participants