Closed (works as designed)
Project:
Page Title
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2009 at 09:48 UTC
Updated:
22 Jul 2009 at 13:48 UTC
I have have a problem with the tables "page_title_old" and "page_title_temp" making the SQL ALTER- and CREATE-statements broken. I'm updating from 2.0 to 2.2, but this problem also exists in 2.1.
I get these errors when i runt update.php:
page_title module
Update #6200
* Failed: CREATE TABLE {page_title_temp} ( `type` VARCHAR(15) NOT NULL DEFAULT 'node', `id` INT unsigned NOT NULL DEFAULT 0, `page_title` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (type, id) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* Failed: INSERT INTO {page_title_temp} (id, page_title) SELECT nid, page_title FROM {page_title}
* Failed: ALTER TABLE {page_title} RENAME TO {page_title_old}
* Failed: ALTER TABLE {page_title_temp} RENAME TO {page_title}
Perhaps these DROP TABLE is sufficient clean-up - to run before ALTER and CREATE:
DROP TABLE {page_title_temp};
DROP TABLE {page_title_old};
or you could probably use the function db_drop_table().
I could remove the tables by hand, but I have 50+ sites in a multisite-installation on our production server. And even more sites on our development server.
Comments
Comment #1
nicholasthompsonThe reason I'm doing it this way is to help protect against lost data...
1) it SHOULD move the old page_title table to page_title_old... This is so you have a backup of existing page titles...
2) It SHOULD rename the page_title_temp to page_title (to take the place of page_title moving to page_title_old).
Nick
Comment #2
Tarnaurion commentedHi Nick.
I know what they do, which is fine. I know why they fail. I know how to fix it manually, by removing the tables by hand.
I don't know if I was unclear, but please read through my post again.
Since I have a total of 100 to 150 installations using this module and most of them have the same problem, it would take me a couple hours to fix. A few weeks ago I had to restore all our clients databases after upgrading due to this bug. This is was our second attempt.
What I'm suggesting is that in future updates that you remove tables that may already exist before trying to CREATE or ALTER them.
Something like this:
I commented the lines so you would see which lines that were added.