I have MySQL configured in such a way that MySQL can't drop the database but it can drop the files. drush v3 happily ignored ERROR 1010 (HY000) at line 1: Error dropping database (can't rmdir './drupal7m', errno: 16) but v4 insists on not continuing. Commenting out the return drush_set_error(dt('Could not drop and create database: @name', array('@name' => $db_name)));
in ./commands/core/site_install.drush.inc makes it work again.

CommentFileSizeAuthor
#2 drush-si-drop-tables.patch3.28 KBgreg.1.anderson

Comments

greg.1.anderson’s picture

Assigned: Unassigned » greg.1.anderson
Priority: Normal » Major

The set error should just be a log 'error', or perhaps a log 'warning'.

greg.1.anderson’s picture

Status: Active » Needs review
StatusFileSize
new3.28 KB

Actually, if the create db failed, or if the database exists but contains junk, then bad things might happen in site-install. This patch falls back to _drush_sql_drop, which drops all tables, if the drop db / create db operation fails. If _drush_sql_drop also fails, then site-install aborts as before.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I like it. RTBC.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed

Status: Fixed » Closed (fixed)

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