I get the following error when trying to run update.php (`drush updb`):

$> drush updb -y

ultimate_cron module :
  7203 -   Fix index sizes.

Do you wish to run all pending updates? (y/n): y
SQLSTATE[HY000]: General error: 1089 Incorrect prefix key; the used      [error]
key part isn't a string, the used length is longer than the key part,
or the storage engine doesn't support unique prefix keys
Performed update: ultimate_cron_update_7203                                 [ok]

The db is stuck on this update hook. Please advise.

Comments

Chris Charlton created an issue. See original summary.

arnested’s picture

Status: Active » Postponed (maintainer needs more info)

What database are you using? MySQL, PostgreSQL? And which version? In case of MySQL which storage backend are you using (MyISAM, InnoDB)?

Chris Charlton’s picture

MySQL 5.5; InnoDB tables.

arnested’s picture

That is weird.

What version are you upgrading from?

bighappyface’s picture

Getting the same thing in my dev environment:

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  |
| version                 | 5.1.73              |
| version_comment         | Source distribution |
| version_compile_machine | x86_64              |
| version_compile_os      | redhat-linux-gnu    |
+-------------------------+---------------------+

Going to update and try again

bighappyface’s picture

Getting it in MySQL 5.5.51 too

$ drush updb -y
4 byte UTF-8 for mysql is disabled. See the documentation on adding 4 byte UTF-8 support for more information. (Currently using Database 4 [warning]
byte UTF-8 support Disabled)
 Ultimate_cron  7203  Fix index sizes.                                        
 Ultimate_cron  7204  Change {ultimate_cron_log} message schema to big text.
Do you wish to run all pending updates? (y/n): y
4 byte UTF-8 for mysql is disabled. See the documentation on adding 4 byte UTF-8 support for more information. (Currently using Database 4 [warning]
byte UTF-8 support Disabled)
SQLSTATE[HY000]: General error: 1089 Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part,  [error]
or the storage engine doesn't support unique prefix keys
Performed update: ultimate_cron_update_7203                                                                                                [ok]
strtr(): The second argument is not an array syslog.module:115                                                                             [warning]
'all' cache was cleared.                                                                                                                   [success]
Finished performing updates.                                                                                                               [ok]
mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------------------+
| Variable_name           | Value                                    |
+-------------------------+------------------------------------------+
| innodb_version          | 5.5.51                                   |
| protocol_version        | 10                                       |
| slave_type_conversions  |                                          |
| version                 | 5.5.51                                   |
| version_comment         | Distributed by The IUS Community Project |
| version_compile_machine | x86_64                                   |
| version_compile_os      | Linux                                    |
+-------------------------+------------------------------------------+
7 rows in set (0.00 sec)
arnested’s picture

I tried to reproduce this with MariaDB 10.1.16 and MySQL 5.5.51). But with no success.

How is the ultimate_cron_log defined before running the update? And which indexes are defined?

This is what I have when doing a clean install of Drupal 7.50 and Ultimate Cron 7.x-2.0-rc1:

DESC ultimate_cron_log;
+--------------+--------------+------+-----+---------+-------+
| Field        | Type         | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| lid          | varchar(255) | NO   | PRI | NULL    |       |
| name         | varchar(255) | NO   | MUL | NULL    |       |
| log_type     | int(11)      | NO   |     | 0       |       |
| start_time   | double       | NO   |     | 0       |       |
| end_time     | double       | NO   |     | 0       |       |
| uid          | int(11)      | NO   |     | 0       |       |
| init_message | text         | YES  |     | NULL    |       |
| message      | text         | YES  |     | NULL    |       |
| severity     | int(11)      | YES  |     | -1      |       |
+--------------+--------------+------+-----+---------+-------+
9 rows in set (0.01 sec)

MariaDB [drupal-7.50]> SHOW INDEXES IN ultimate_cron_log;
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table             | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| ultimate_cron_log |          0 | PRIMARY  |            1 | lid         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            1 | name        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            2 | start_time  | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            3 | end_time    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            4 | log_type    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
5 rows in set (0.01 sec)

After upgrading to Ultimate Cron 7.x-2.0-rc3 I have:

MariaDB [drupal-7.50]> DESC ultimate_cron_log;
+--------------+--------------+------+-----+---------+-------+
| Field        | Type         | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| lid          | varchar(255) | NO   | PRI | NULL    |       |
| name         | varchar(255) | NO   | MUL | NULL    |       |
| log_type     | int(11)      | NO   |     | 0       |       |
| start_time   | double       | NO   |     | 0       |       |
| end_time     | double       | NO   |     | 0       |       |
| uid          | int(11)      | NO   |     | 0       |       |
| init_message | text         | YES  |     | NULL    |       |
| message      | longtext     | YES  |     | NULL    |       |
| severity     | int(11)      | YES  |     | -1      |       |
+--------------+--------------+------+-----+---------+-------+
9 rows in set (0.00 sec)

MariaDB [drupal-7.50]> SHOW INDEXES IN ultimate_cron_log;
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table             | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| ultimate_cron_log |          0 | PRIMARY  |            1 | lid         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            1 | name        | A         |           0 |      128 | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            2 | start_time  | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            3 | end_time    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ultimate_cron_log |          1 | idx_last |            4 | log_type    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
5 rows in set (0.00 sec)

How many rows do you have in your ultimate_cron_log table?

MariaDB [drupal-7.50]> SELECT COUNT(1) FROM ultimate_cron_log;

Is there anything in the tables name field that doesn't look like a regular text string?

arnested’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this issue due to inactivity.