The latest changes to redirect.install have caused the schema for new and existing installations to diverge:

  1. #2828083: Fields 'redirect_options', 'source_options' should be BLOB not TEXT changed the type of redirect.source_options and redirect.redirect_options to "blob". The update hook applied an incomplete schema that discarded the "not null" declaration.
  2. #2194099: Create database index on the redirect column added an update hook that creates an index for redirect.redirect. The index is missing in redirect_schema().
  3. #2057615: Increase size of source field to hold long URLs increased the length for redirect.source and redirect.redirect to 900 characters. No update hook was added.

Comments

ciss created an issue. See original summary.

ciss’s picture

Note that the increased column size may cause index creation to fail with the error

Furthermore, creating the index may cause the error

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

For the status_source_language index the workaround used was to specify a max key length of 255 for the source column. This solution may not be adequate. To properly support large URLs it may be necessary to introduce indexed hashes for redirect.source and redirect.redirect.

ciss’s picture

Issue summary: View changes
pendaco’s picture

After updating from rc3 to 7.x-1.0-rc4 I get similar schema mismatches as indicated by the Schema module

column source - difference on: length
declared: array('description' => 'TODO: please describe this field!', 'type' => 'varchar', 'length' => 900, 'not null' => TRUE)
actual: array('description' => 'The source path to redirect from.', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE)

column source_options - difference on: not null
declared: array('description' => 'TODO: please describe this field!', 'type' => 'blob', 'not null' => TRUE)
actual: array('description' => 'TODO: please describe this field!', 'type' => 'blob', 'not null' => FALSE)

column redirect - difference on: length
declared: array('description' => 'TODO: please describe this field!', 'type' => 'varchar', 'length' => 900, 'not null' => TRUE)
actual: array('description' => 'The destination path to redirect to.', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE)

column redirect_options - difference on: not null
declared: array('description' => 'TODO: please describe this field!', 'type' => 'blob', 'not null' => TRUE)
actual: array('description' => 'TODO: please describe this field!', 'type' => 'blob', 'not null' => FALSE)

indexes status_source_language:
declared: array('status', array('source', 255), 'language')
actual: array('status', 'source', 'language')

indexes redirect:
declared: array(array('redirect', 255))
actual: array('redirect')
wylbur’s picture

Status: Active » Closed (outdated)

Closing this as Outdated as Drupal 7 is EOL.