MySQL Error: Tables Not Updating?

tkoby - April 15, 2008 - 19:56
Project:Node Find Replace
Version:5.x-1.1
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Anyone else getting mysql errors when attempting to insert into the "node_find_replace_history" table? The find/replace works fine - it seems the nodes get updated - but it also appears an INSERT query is trying to populate multiple columns that don't exist in that table (key1_name, key1_value, key2_name, key2_value).

The error message begins with:

user warning: Unknown column 'key1_name' in 'field list' query: INSERT INTO node_find_replace_history

In looking at the file "node_find_replace.install", I noticed a series of ALTER TABLE queries which appear like they haven't been executed as my "node_find_replace_history" table doesn't have the updated columns/fields.

I'm using Mysql version 5.0.32-Debian_7etch3-log, PHP version 5.2.0-8+etch10

Can somebody help shed some light on this? Thanks!

#1

tkoby - April 15, 2008 - 19:57

Forgot to mention I'm using Drupal 5.7 and I downloaded node_find_replace-5.x-1.1.tar.gz.

Thanks

#2

tkoby - April 16, 2008 - 20:03

Update - I manually altered the mysql tables using the six "alter table" queries found in node_find_replace.install. I attempted another find/replace and it worked without any error messages displayed. The undo/redo feature also worked without any problems. So it looks like those "alter table" queries just aren't being executed? Thanks.

#3

regx - April 24, 2008 - 04:16

you should always run the update.php after installing a module.
Running update.php should have taken care of the problems automatically.
I am glad you were able to get it working, and it is nice to know that other people are using this module.

I originally wrote this for 4.7 and ported it to 5, I might have missed something in the update, as the updates should run automatically.
I will check on this, as I am sure other people might just abandon the module instead of taking the initiative like you did, and this module is pretty useful.

#4

emerygjr - May 8, 2008 - 17:40

I am running Drupal 5.3 and get the error. The update process states that there are no updates available. I tried running the alter tables from the .install and they did not execute. They give sql errors.

I dropped the table and ran this script to correct the problem.

CREATE TABLE {node_find_replace_history} (
id int(11) NOT NULL auto_increment,
hid int(11) NOT NULL default '0',
key1_name varchar(256),
key2_name varchar(256),
key3_name varchar(256),
key3_value varchar(256),
key1_value varchar(256),
key2_value varchar(256),
table_name varchar(32) default NULL,
field_name varchar(32) default NULL,
old_value longtext,
new_value longtext,
find_string varchar(60) default NULL,
replace_string varchar(60) default NULL,
timestamp timestamp NULL default NULL on update CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

After this it worked.

Emery Gordon

#5

regx - May 9, 2008 - 11:47

Yes, I will have to fix the update. What I meant was if you simply select the last update from the dropdown for this module in the update script then it will run and fix the problem.
The updates are currently not running, but drupal is acting like they did and setting the schema version in the system table.

#6

regx - May 12, 2008 - 07:31

I posted a new release, but the update is still not run automatically. You simply have to run the update script after installing and select update 1 for the node_find_replace module.
If anyone knows why this is happening, please let me know or post a patch and I will post a new release.

#7

regx - May 27, 2008 - 18:42
Status:active» fixed

I moved all of the update code into the initial install code. Not sure why updates where not happening automatically, but this fixes the problem.

#8

Anonymous (not verified) - June 10, 2008 - 18:43
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.