I recently upgrade a site from Drupal 5 to Drupal 6 to Drupal 7 with the signature forum module to update. I found that there was an error during the update.php script. The error included the following:

The following updates returned messages
signature_forum module
Update #7000
Failed: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'signature' at row 1: UPDATE {users}, {users_signature} SET {users}.signature = {users_signature}.signature WHERE {users}.uid = {users_signature}.uid; Array ( ) in signature_forum_update_7000() (line 130 of /var/www/html/drupal/_stage_d7/drupal-7.18/sites/all/modules/signature_forum/signature_forum.install).

I looked in the database and compared the {users}.signature column with the {users_signature}.signature column and found that the signature column in the {users} table is "varchar(255)" whereas the one in the {user_signature} table is "text".

This prompted me to investigate this further using:
SELECT uid, signature, LENGTH( signature )
FROM `users_signature`
WHERE LENGTH( users_signature.signature ) >255

Which I then discovered that there were indeed records in the {users_signature}.signature column to be greater than 255 chars. Needless to say that this was the primary cause of my update script failure. I subsequently deleted all the offending entries, and that resolved the immediate issue, but another error followed.

signature_forum module
Update #7000
    Failed: DatabaseSchemaObjectDoesNotExistException: Cannot rename signature_post to signature_forum_post : table signature_post doesn't exist. in DatabaseSchema_mysql->renameTable() (line 304 of /var/www/html/drupal/drupal-7.18/includes/database/mysql/schema.inc).

Any thoughts would be helpful. Thanks.

Comments

diakonos’s picture

It appears that the table signature_post does not exist in my database. According to the install script for the drupal7 version the following entry was used to migrate from drupal6.

db_rename_table('signature_post', 'signature_forum_post');

I checked and discovered that the table did not exist in versions drupal5 or drupal6. It is now a mystery as to why this table is being referenced? I will try to check on older versions to find more details on this mysterious table. If this table is of any significance, how did it disappear, or perhaps it never existed. Another bizarre thing is there is this line:

db_drop_table('signature_signature');

right before the rename code. I am wondering if this is the missing table?

Liam McDermott’s picture

Sorry to ask you to do the investigative work, but my only quick guess (before I get back to my day job) is that this table might have been created in the 6.x-1.x-dev version, but never made it into a stable version.

So, if you're looking at older versions, start there. The table was for a feature developed by some other people, but I could never get it to function quite right, so it never made it into a stable version of the module.

Liam McDermott’s picture

Status: Active » Fixed

This should have been fixed when I fixed #1898806: Latest dev fails update, since the update now checks for the existence of the table before trying to rename it.

deanflory’s picture

I have just received the same error today with the latest dev version available today (2013/02/12):

Failed: DatabaseSchemaObjectDoesNotExistException: Cannot rename signature_post to signature_forum_post: table signature_post doesn't exist. in DatabaseSchema_mysql->renameTable() (line 304 of /../drupal/includes/database/mysql/schema.inc).

I'll try uninstalling and reinstalling (sigh) but clearly something isn't right.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

edited the second error message to clean the format.