I see in CVS revision 1.9 of actions.install, you increased the size of op in actions_assignments from 32 to 40. I have a couple workflow items that aren't upgrading properly because 40 is still too small. Partial update error:

UPDATE actions_assignments SET op = 'workflow-content_canadian_signage_request-174' WHERE hook = 'workflow' AND op = 'workflow-174' AND aid = '' AND weight = 0 in /Users/davidnorman/Sites/lowessigns/includes/database.mysql.inc on line 172.

I was able to increase it to 46 without MySQL complaining, but 47 made it "#1071 - Specified key was too long; max key length is 1000 bytes", otherwise I'd ask for it to be like 128. The error doesn't make much sense to me since the other two columns in the key are 32 and 255, but could you raise it to 46?

// 40 chars is still a little small for op. Use 46 instead.
function actions_update_5202() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {actions_assignments} CHANGE op op VARCHAR(46)");
      break;

    case 'pgsql':
      $ret[] = update_sql("BEGIN;
        ALTER TABLE {actions_assignments} ADD COLUMN op_temp VARCHAR(46);
        UPDATE op_temp SET new_col = CAST(op AS VARCHAR(46));
        ALTER TABLE {actions_assignments} DROP COLUMN op;
        RENAME op_temp TO op;
        COMMIT;");
      break;
  }
  return $ret;
}

Comments

jvandyk’s picture

Status: Needs review » Fixed

The error happens because the compound key exceeds MySQL's limit of 1000 bytes. UTF-8 may take multiple bytes per character. See

http://dev.mysql.com/doc/refman/5.0/en/indexes.html

http://forums.mysql.com/read.php?10,221261,221270#msg-221270

deekayen’s picture

Category: bug » feature
Status: Fixed » Needs review

What I'm saying is 46 characters for that column still fits within the allowed 1000 bytes and allows for a longer string in the op column, which I need for converting my workflow actions from actions1. Right now the column crops at 40 characters, so I'd like it to be expanded to the max the key can hold (46).

jvandyk’s picture

Status: Needs review » Fixed

Yes, it has been committed and is in 5.x-2.6.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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