Error during upgrade: "1142 DROP command denied to user"

I have setup the Piwik database user to not being able to issue the DROP statement (for security reasons).

This resulted in the following error during upgrade:

Critical Error during the update process:

/var/www/core/Updates/1.8.4-b1.php:
Error trying to execute the query ’ DROP TABLE IF EXISTS piwik_log_action_duplicates;
'.
The error was: SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user ‘user’@‘host’ for table ‘piwik_log_action_duplicates’

The thing is that this table does not even exist.

So while MySQL could be smarter and skip/ignore this command (because of the “IF EXISTS” ), Piwik itself could check if the table exists before executing this command.