There was an error when running the update.php after installing the 2.6 update from 2.4. Here are the errors:

* warning: Invalid argument supplied for foreach() in /usr/local/apache2/vhosts/mysite.com/htdocs/includes/database.mysql-common.inc on line 109.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: ALTER TABLE ad_flash ADD PRIMARY KEY () in /usr/local/apache2/vhosts/mysite.com/htdocs/includes/database.mysql-common.inc on line 374.
* warning: Invalid argument supplied for foreach() in /usr/local/apache2/vhosts/mysite.com/htdocs/includes/database.mysql-common.inc on line 109.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: ALTER TABLE ad_flash ADD INDEX aid () in /usr/local/apache2/vhosts/mysite.com/htdocs/includes/database.mysql-common.inc on line 434.
The following queries were executed:
ad_flash module
Update #6000
    * ALTER TABLE {ad_flash} DROP KEY aid
    * Failed: ALTER TABLE {ad_flash} ADD PRIMARY KEY ()
    * Failed: ALTER TABLE {ad_flash} ADD INDEX aid ()

Ads seem to still be displaying and functioning correctly afterward. Are these errors to be worried about? Why did they occur?

CommentFileSizeAuthor
#1 815326.patch565 bytessvendecabooter

Comments

svendecabooter’s picture

StatusFileSize
new565 bytes

I have the same problem.
Attached is a patch that fixes it.

gregarios’s picture

Status: Active » Patch (to be ported)

Verified. The patch in the previous comment by svendecabooter fixes the issue completely.

Alex Andrascu’s picture

will do

ball.in.th’s picture

i just ran into the same problem while upgrading from 2.4 to 2.6 .

danyg’s picture

use the patch above, or manually type the SQL-query into phpmyadmin or console.

ALTER TABLE ad_flash ADD PRIMARY KEY ( aid ) 
ALTER TABLE ad_flash ADD INDEX aid (aid)

Btw "Primary key" and "Index" use the same field, I think one of the is unnecessary.

tonku’s picture

I think the created index should be fid instead of aid (like in the module's clean install database). So should the batch be updated?

Alex Andrascu’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
Assigned: Unassigned » Alex Andrascu
Status: Patch (to be ported) » Needs review

Sorry for not beeing arround for awhile now.
This patch is now ported in the dev version. Please review and comment.
@jollydiver - If you are so kind to commit a patch against the head i'll happy commit it.
Thanks svendecabooter for this patch

Alex Andrascu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.