@anonymous-piwik-user opened this Issue on December 30th 2009

The update to 0.5 drops an index and defines a new one. On my server that fails with the error message "1142 INDEX command denied to user 'XXX'@'localhost'". My provider gave me permission to use the INDEX command but it still did not work.

The queries you use are

'CREATE INDEX index_type_hash ON ' . Piwik::prefixTable('log_action') . ' (type, hash);' => '1061',
'DROP INDEX index_type_name ON ' . Piwik::prefixTable('log_action') . ';' => '1091',

The queries that worked for me are

ALTER TABLE `piwik_log_action` ADD INDEX `index_type_hash` ( `type` , `hash` )  
ALTER TABLE `piwik_log_action` DROP INDEX `index_type_name` 

I added/dropped manually and removed those lines from the updater to make the update process work.

@robocoder commented on December 30th 2009 Contributor

After your provider gave you INDEX privilege, you should have been able to run the updater instead of manually entering the queries.

The reason those queries failed is because those are written in PHP. These actually become:

CREATE INDEX index_type_hash ON `piwik_log_action` (type, hash);
DROP INDEX index_type_name ON `piwik_log_action`;

The CREATE|DROP INDEX commands are mapped internally by MySQL to the ALTER TABLE...ADD|DROP INDEX commands, so there's no need to change the update script.

This Issue was closed on December 30th 2009
Powered by GitHub Issue Mirror