• ResolvedPlugin Contributor osfans

    (@osfans)


    Fatal error: Uncaught Migrate.php(259) : SwitchToIndividualAnswers – Error executing ‘query’ with: CREATE TABLE wp_t_answers ( answer_id bigint UNSIGNED auto_increment NOT NULL, question_id bigint UNSIGNED NOT NULL, global_answer_id bigint UNSIGNED, answer_title text DEFAULT ”, PRIMARY KEY (answer_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8; Reason: BLOB/TEXT column ‘answer_title’ can’t have a default value thrown in …\wp-content\plugins\wp-testing\vendor\ruckusing\ruckusing-migrations\lib\Task\Db\Migrate.php on line 259

    MySQL server is running on Windows.
    According to the page,
    Windows MySQL v5 throws an error, but Linux and other versions only raise a warning. This needs to be fixed.

    https://www.ads-software.com/plugins/wp-testing/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor osfans

    (@osfans)

    The doc of MySQL5.0 says, BLOB and TEXT columns cannot have DEFAULT values. And on MS Windows the “no DEFAULT” rule is an error, while on other platforms it is often a warning. While not a bug, it’s possible to get trapped by this if you write code on a lenient platform, and later run it on a strict platform.

    Plugin Contributor osfans

    (@osfans)

    I add $this->execute("SET SESSION SQL_MODE = ''"); in 20141126191658_SwitchToIndividualAnswers.php.
    And it works.
    But I’m not sure of its side effects

    Plugin Contributor ustimenko

    (@ustimenko)

    osfans, I think it’s better to do it to be same as other WP’s *_title columns.

    I’ll create a branch on github — can you then test it on windows?

    Plugin Contributor ustimenko

    (@ustimenko)

    As I see only one ‘text’ column has this default. And as I remember it was done intentionally when I implemented individual answers feature.

    Anyway I’ll research how to make it without such default.

    Plugin Contributor osfans

    (@osfans)

    OK, I’m glad to test that. I’m watching your github repo now.
    But I think I have to study the backup and restore of wp-testing database before that.

    Plugin Contributor ustimenko

    (@ustimenko)

    See the mocha’s tests — they will.. Oops )) They are for linux.

    Ok, then if you will invent something — just send PR for such tool too.

    Plugin Contributor ustimenko

    (@ustimenko)

    osfans, can you try another option?

    Comment out or remove this string with default: https://github.com/garex/wp-testing/blob/08e7882445aa3772c6f3fc438a652d95ee0c4645/db/migrations/wp_testing/20141126191658_SwitchToIndividualAnswers.php#L28

    If all possible answers will work ok (global, individual, individualized), then I will just remove it.

    Plugin Contributor osfans

    (@osfans)

    I comment out the line, and it works when the answer is global, individual or individualized global.

    Thanks!

    Plugin Contributor ustimenko

    (@ustimenko)

    Ok, will remove then. Will do this in develop so it will be in next release — not hotfix.

    Plugin Contributor ustimenko

    (@ustimenko)

    Removed in develop. Will be in next release.

    Deleting line worked for me on Windows. Also for some reason windows defender thinks your plugin is a virus. I literally download a 1000 plugins a year and yours was the first that reacted like this.

    Plugin Contributor ustimenko

    (@ustimenko)

    djmceltic, post it on windows defender support )) Or better use Kaspersky.

    In this plugin there are no code that can be run on windows.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘fatal error when activate(default value for text column)’ is closed to new replies.