This is a bug that was recently fixed in update.php:
http://drupal.org/node/767408
with an accepted patch: http://drupal.org/files/issues/fix-semaphore-upgrade-errors.patch

However, the bug still persists in drush updatedb.

The same patch needs to be applied to drush/commands/core/drupal/update_6.inc, otherwise a number of errors occur when upgrading from 5.x using drush updatedb the first time on a fresh D6.16+ install.

Attached is a tested patch that fixes the issue for me (sorry - not from CVS, so probably won't apply cleanly).
Patch simply adds following code to the end of function update_fix_d6_requirements()


    // Create the semaphore table now -- the menu system after 6.15 depends on
    // this table, and menu code runs in updates prior to the table being
    // created in its original update function, system_update_6054().
    $schema['semaphore'] = array(
      'fields' => array(
        'name' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => ''),
        'value' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => ''),
        'expire' => array(
          'type' => 'float',
          'size' => 'big',
          'not null' => TRUE),
        ),
      'indexes' => array('expire' => array('expire')),
      'primary key' => array('name'),
    );
    db_create_table($ret, 'semaphore', $schema['semaphore']);

Comments

jfall’s picture

Not quite...

this fixed the issue and created a clearer upgrade, but updatedb tries to create the semaphore table on every subsequent run, yielding a table already exists error. Will look further... any advice would be welcome here.

jfall’s picture

StatusFileSize
new1.18 KB

OK - clever me.
Added create outside of conditional so it was being run every update.

Fixed. Attached updated patch.

gdl’s picture

Version: All-versions-4.2 »
StatusFileSize
new1.41 KB

jfall's patch in #2 is working for me.

I took the liberty of generating a version of the patch in what I believe is the proper CVS format, from today's HEAD.

Thanks to jfall for the patch, and thanks for drush!
-G

greg.1.anderson’s picture

Status: Active » Needs review
guidot’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies cleanly to drush 4.2. I successfully upgraded from Drupal 5.23 to 6.20.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Committed. Needs backport. Commit 297ca0417b595462391cdea24b8ee9ab16b39553

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Backported to 4.x.

Status: Fixed » Closed (fixed)

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