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

Update to 0.5: DB Update fails at INDEX #1094

Closed
anonymous-matomo-user opened this issue Dec 30, 2009 · 1 comment
Closed

Update to 0.5: DB Update fails at INDEX #1094

anonymous-matomo-user opened this issue Dec 30, 2009 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@anonymous-matomo-user
Copy link

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
Copy link
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants