• smh

    (@killing)


    Looks like there’s a bug in your upgrade script for v2.61
    $wpdb->query(“ALTER TABLE $wpdb->pollsip ADD INDEX pollip_ip (pollip_id);”);

    As pollip_id is the Primary key for the table I can only assume this is a typo and you mean’t pollip_ip not pollip_id e.g.
    $wpdb->query(“ALTER TABLE $wpdb->pollsip ADD INDEX pollip_ip (pollip_ip);”);

    In addition these two ALTER TABLE statements cause php errors when the plugin is re-enabled after already being upgraded.

    http://wordpress.org/extend/plugins/wp-polls/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Do you have the php error on hand? I can’t remember why I did that but you are right, id is already the PRIMARY KEY and therefore the index is not required.

    Thread Starter smh

    (@killing)

    Here’s the errors from the log for you

    [31-Mar-2013 08:37:48 UTC] WordPress database error Duplicate key name 'pollip_ip' for query ALTER TABLE wp_pollsip ADD INDEX pollip_ip (pollip_ip); made by activate_plugins, activate_plugin, do_action('activate_wp-polls/wp-polls.php'), call_user_func_array, create_poll_table
    [31-Mar-2013 08:37:48 UTC] WordPress database error Duplicate key name 'pollip_qid' for query ALTER TABLE wp_pollsip ADD INDEX pollip_qid (pollip_qid); made by activate_plugins, activate_plugin, do_action('activate_wp-polls/wp-polls.php'), call_user_func_array, create_poll_table

    They are expected as there’s no validation as to which version is already installed, so its trying to add the index each time the plugin is enabled, instead of only when its moving from an old version to the new one.

    Plugin Author Lester Chan

    (@gamerz)

    Yea, because of previous mistakes of not having versioning within the plugin. I will just remove the line alotgether

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP-Polls] Bug in upgrade’ is closed to new replies.