The table being corrupted is defined as: CREATE TABLE `swt_order_data` ( `recordID` int(11) NOT NULL AUTO_INCREMENT, `swa_customerID` varchar(200) NOT NULL DEFAULT '', `id` varchar(250) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `createdBy` varchar(200) DEFAULT NULL, `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modifiedBy` varchar(200) DEFAULT NULL, `active` tinyint(2) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `order_number` int(11) NOT NULL DEFAULT '0', `user_id` varchar(250) NOT NULL DEFAULT '', `bill_company` varchar(200) NOT NULL DEFAULT '', `bill_fname` varchar(40) NOT NULL DEFAULT '', `bill_lname` varchar(40) NOT NULL DEFAULT '', `bill_addr` text, `bill_city` varchar(200) NOT NULL DEFAULT '', `bill_region` varchar(200) DEFAULT NULL, `bill_postal_code` varchar(100) NOT NULL DEFAULT '', `bill_country` varchar(200) NOT NULL DEFAULT '', `bill_phone` varchar(100) NOT NULL DEFAULT '', `bill_fax` varchar(100) DEFAULT NULL, `bill_email` varchar(200) NOT NULL DEFAULT '', `ship_company` varchar(200) NOT NULL DEFAULT '', `ship_fname` varchar(40) NOT NULL DEFAULT '', `ship_lname` varchar(40) NOT NULL DEFAULT '', `ship_addr` text, `ship_city` varchar(200) NOT NULL DEFAULT '', `ship_region` varchar(200) DEFAULT NULL, `ship_postal_code` varchar(100) NOT NULL DEFAULT '', `ship_country` varchar(200) NOT NULL DEFAULT '', `ship_phone` varchar(100) NOT NULL DEFAULT '', `ship_fax` varchar(100) DEFAULT NULL, `ship_email` varchar(200) NOT NULL DEFAULT '', `client_ip` varchar(16) NOT NULL DEFAULT '0.0.0.0', `client_browser` varchar(255) NOT NULL DEFAULT '', `ship_method` varchar(200) NOT NULL DEFAULT '', `ship_cost` decimal(15,2) NOT NULL DEFAULT '0.00', `ship_weight` decimal(15,1) NOT NULL DEFAULT '0.0', `ship_origin_postal_code` varchar(100) NOT NULL DEFAULT '', `ship_origin_country` varchar(200) NOT NULL DEFAULT '', `ship_tracking_number` varchar(255) NOT NULL DEFAULT '', `ship_date` datetime DEFAULT NULL, `order_subtotal` decimal(15,2) NOT NULL DEFAULT '0.00', `order_discounts` decimal(15,2) NOT NULL DEFAULT '0.00', `order_ship` decimal(15,2) NOT NULL DEFAULT '0.00', `order_ship_discounts` decimal(15,2) NOT NULL DEFAULT '0.00', `order_tax` decimal(15,2) NOT NULL DEFAULT '0.00', `order_total` decimal(15,2) NOT NULL DEFAULT '0.00', `promo_code_id` varchar(250) DEFAULT NULL, PRIMARY KEY (`recordID`), KEY `swt_order_customerID` (`swa_customerID`), KEY `swt_order_id` (`id`), KEY `swt_order_createdBy` (`createdBy`), KEY `swt_order_modifiedBy` (`modifiedBy`), KEY `swt_order_search` (`id`), CONSTRAINT `swt_order_createdBy_fk` FOREIGN KEY (`createdBy`) REFERENCES `swt_people_data` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `swt_order_data_foreign_key` FOREIGN KEY (`swa_customerID`) REFERENCES `swa_TOOLS_customers` (`swa_customerID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `swt_order_modifiedBy_fk` FOREIGN KEY (`modifiedBy`) REFERENCES `swt_people_data` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=309 DEFAULT CHARSET=utf8; The table has 3 triggers defined as: CREATE DEFINER=`chris`@`localhost` TRIGGER swt_order_data_after_insert AFTER INSERT ON swt_order_data FOR EACH ROW BEGIN INSERT INTO swt_order_data_versions (recordID, swa_customerID, id, created, createdBy, modified, modifiedBy, active, deleted, order_number, user_id, bill_company, bill_fname, bill_lname, bill_addr, bill_city, bill_region, bill_postal_code, bill_country, bill_phone, bill_fax, bill_email, ship_company, ship_fname, ship_lname, ship_addr, ship_city, ship_region, ship_postal_code, ship_country, ship_phone, ship_fax, ship_email, client_ip, client_browser, ship_method, ship_cost, ship_weight, ship_origin_postal_code, ship_origin_country, ship_tracking_number, ship_date, order_subtotal, order_discounts, order_ship, order_ship_discounts, order_tax, order_total, promo_code_id) VALUES (NEW.recordID, NEW.swa_customerID, NEW.id, NEW.created, NEW.createdBy, NEW.modified, NEW.modifiedBy, NEW.active, NEW.deleted, NEW.order_number, NEW.user_id, NEW.bill_company, NEW.bill_fname, NEW.bill_lname, NEW.bill_addr, NEW.bill_city, NEW.bill_region, NEW.bill_postal_code, NEW.bill_country, NEW.bill_phone, NEW.bill_fax, NEW.bill_email, NEW.ship_company, NEW.ship_fname, NEW.ship_lname, NEW.ship_addr, NEW.ship_city, NEW.ship_region, NEW.ship_postal_code, NEW.ship_country, NEW.ship_phone, NEW.ship_fax, NEW.ship_email, NEW.client_ip, NEW.client_browser, NEW.ship_method, NEW.ship_cost, NEW.ship_weight, NEW.ship_origin_postal_code, NEW.ship_origin_country, NEW.ship_tracking_number, NEW.ship_date, NEW.order_subtotal, NEW.order_discounts, NEW.order_ship, NEW.order_ship_discounts, NEW.order_tax, NEW.order_total, NEW.promo_code_id); END; CREATE DEFINER=`chris`@`localhost` TRIGGER swt_order_data_after_update AFTER UPDATE ON swt_order_data FOR EACH ROW BEGIN INSERT INTO swt_order_data_versions (recordID, swa_customerID, id, created, createdBy, modified, modifiedBy, active, deleted, order_number, user_id, bill_company, bill_fname, bill_lname, bill_addr, bill_city, bill_region, bill_postal_code, bill_country, bill_phone, bill_fax, bill_email, ship_company, ship_fname, ship_lname, ship_addr, ship_city, ship_region, ship_postal_code, ship_country, ship_phone, ship_fax, ship_email, client_ip, client_browser, ship_method, ship_cost, ship_weight, ship_origin_postal_code, ship_origin_country, ship_tracking_number, ship_date, order_subtotal, order_discounts, order_ship, order_ship_discounts, order_tax, order_total, promo_code_id) VALUES (NEW.recordID, NEW.swa_customerID, NEW.id, NEW.created, NEW.createdBy, NEW.modified, NEW.modifiedBy, NEW.active, NEW.deleted, NEW.order_number, NEW.user_id, NEW.bill_company, NEW.bill_fname, NEW.bill_lname, NEW.bill_addr, NEW.bill_city, NEW.bill_region, NEW.bill_postal_code, NEW.bill_country, NEW.bill_phone, NEW.bill_fax, NEW.bill_email, NEW.ship_company, NEW.ship_fname, NEW.ship_lname, NEW.ship_addr, NEW.ship_city, NEW.ship_region, NEW.ship_postal_code, NEW.ship_country, NEW.ship_phone, NEW.ship_fax, NEW.ship_email, NEW.client_ip, NEW.client_browser, NEW.ship_method, NEW.ship_cost, NEW.ship_weight, NEW.ship_origin_postal_code, NEW.ship_origin_country, NEW.ship_tracking_number, NEW.ship_date, NEW.order_subtotal, NEW.order_discounts, NEW.order_ship, NEW.order_ship_discounts, NEW.order_tax, NEW.order_total, NEW.promo_code_id); END; CREATE DEFINER=`chris`@`localhost` TRIGGER swt_order_data_after_delete AFTER DELETE ON swt_order_data FOR EACH ROW BEGIN INSERT INTO swt_order_data_versions (version_is_del, recordID, swa_customerID, id, created, createdBy, modified, modifiedBy, active, deleted, order_number, user_id, bill_company, bill_fname, bill_lname, bill_addr, bill_city, bill_region, bill_postal_code, bill_country, bill_phone, bill_fax, bill_email, ship_company, ship_fname, ship_lname, ship_addr, ship_city, ship_region, ship_postal_code, ship_country, ship_phone, ship_fax, ship_email, client_ip, client_browser, ship_method, ship_cost, ship_weight, ship_origin_postal_code, ship_origin_country, ship_tracking_number, ship_date, order_subtotal, order_discounts, order_ship, order_ship_discounts, order_tax, order_total, promo_code_id) VALUES (1, OLD.recordID, OLD.swa_customerID, OLD.id, OLD.created, OLD.createdBy, OLD.modified, OLD.modifiedBy, OLD.active, OLD.deleted, OLD.order_number, OLD.user_id, OLD.bill_company, OLD.bill_fname, OLD.bill_lname, OLD.bill_addr, OLD.bill_city, OLD.bill_region, OLD.bill_postal_code, OLD.bill_country, OLD.bill_phone, OLD.bill_fax, OLD.bill_email, OLD.ship_company, OLD.ship_fname, OLD.ship_lname, OLD.ship_addr, OLD.ship_city, OLD.ship_region, OLD.ship_postal_code, OLD.ship_country, OLD.ship_phone, OLD.ship_fax, OLD.ship_email, OLD.client_ip, OLD.client_browser, OLD.ship_method, OLD.ship_cost, OLD.ship_weight, OLD.ship_origin_postal_code, OLD.ship_origin_country, OLD.ship_tracking_number, OLD.ship_date, OLD.order_subtotal, OLD.order_discounts, OLD.order_ship, OLD.order_ship_discounts, OLD.order_tax, OLD.order_total, OLD.promo_code_id); END; The referenced table `swt_order_data_versions` is: CREATE TABLE `swt_order_data_versions` ( `ship_email` varchar(200) NOT NULL DEFAULT '', `bill_email` varchar(200) NOT NULL DEFAULT '', `version_id` int(11) NOT NULL AUTO_INCREMENT, `version_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `version_is_del` tinyint(1) NOT NULL DEFAULT '0', `recordID` int(11) NOT NULL DEFAULT '0', `swa_customerID` varchar(200) NOT NULL DEFAULT '', `id` varchar(250) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `createdBy` varchar(200) DEFAULT NULL, `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modifiedBy` varchar(200) DEFAULT NULL, `active` tinyint(2) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `order_number` int(11) NOT NULL DEFAULT '0', `user_id` varchar(250) NOT NULL DEFAULT '', `status` enum('New','In Progress','Shipped','Cancelled','Split') DEFAULT NULL, `bill_company` varchar(200) NOT NULL DEFAULT '', `bill_fname` varchar(40) NOT NULL DEFAULT '', `bill_lname` varchar(40) NOT NULL DEFAULT '', `bill_addr` text, `bill_city` varchar(200) NOT NULL DEFAULT '', `bill_region` varchar(200) DEFAULT NULL, `bill_postal_code` varchar(100) NOT NULL DEFAULT '', `bill_country` varchar(200) NOT NULL DEFAULT '', `bill_phone` varchar(100) NOT NULL DEFAULT '', `bill_fax` varchar(100) DEFAULT NULL, `ship_company` varchar(200) NOT NULL DEFAULT '', `ship_fname` varchar(40) NOT NULL DEFAULT '', `ship_lname` varchar(40) NOT NULL DEFAULT '', `ship_addr` text, `ship_city` varchar(200) NOT NULL DEFAULT '', `ship_region` varchar(200) DEFAULT NULL, `ship_postal_code` varchar(100) NOT NULL DEFAULT '', `ship_country` varchar(200) NOT NULL DEFAULT '', `ship_phone` varchar(100) NOT NULL DEFAULT '', `ship_fax` varchar(100) DEFAULT NULL, `client_ip` varchar(16) NOT NULL DEFAULT '0.0.0.0', `client_browser` varchar(255) NOT NULL DEFAULT '', `ship_method` varchar(200) NOT NULL DEFAULT '', `ship_cost` decimal(15,2) NOT NULL DEFAULT '0.00', `ship_weight` decimal(15,1) NOT NULL DEFAULT '0.0', `ship_origin_postal_code` varchar(100) NOT NULL DEFAULT '', `ship_origin_country` varchar(200) NOT NULL DEFAULT '', `ship_tracking_number` varchar(255) NOT NULL DEFAULT '', `ship_date` datetime DEFAULT NULL, `order_subtotal` decimal(15,2) NOT NULL DEFAULT '0.00', `order_discounts` decimal(15,2) NOT NULL DEFAULT '0.00', `order_ship` decimal(15,2) NOT NULL DEFAULT '0.00', `order_ship_discounts` decimal(15,2) NOT NULL DEFAULT '0.00', `order_tax` decimal(15,2) NOT NULL DEFAULT '0.00', `order_total` decimal(15,2) NOT NULL DEFAULT '0.00', `promo_code_id` varchar(250) DEFAULT NULL, PRIMARY KEY (`version_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1485 DEFAULT CHARSET=utf8; The initial record was: --- row --- recordID: 295 swa_customerID: 9e55471ba84686ade677ffe595c45992 id: 24ea8b6e95bac5f219a01c3bdb5c46d0 created: 2008-06-17 18:49:21 createdBy: 8fff3371f0c4f2a703386f6003ea0b6a modified: 2008-06-17 18:49:21 modifiedBy: 8fff3371f0c4f2a703386f6003ea0b6a active: 1 deleted: 0 order_number: 18332 user_id: 8fff3371f0c4f2a703386f6003ea0b6a status: NULL bill_company: bill_fname: some bill_lname: user bill_addr: 123 Main St. bill_city: Great Falls bill_region: MT bill_postal_code: 59404 bill_country: US bill_phone: 5555551212 bill_fax: bill_email: some.user@some.place.com ship_company: ship_fname: some ship_lname: user ship_addr: 123 Main St. ship_city: Great Falls ship_region: MT ship_postal_code: 59404 ship_country: US ship_phone: 5555551212 ship_fax: ship_email: some.user@some.place.com client_ip: 127.0.0.1 client_browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 ship_method: UPS,03 ship_cost: 0.00 ship_weight: 1.0 ship_origin_postal_code: 97301 ship_origin_country: US ship_tracking_number: ship_date: NULL order_subtotal: 56.00 order_discounts: 0.00 order_ship: 9.18 order_ship_discounts: 0.00 order_tax: 0.00 order_total: 65.18 promo_code_id: NULL --- end --- (Appropriate data was changed so that this doesn't indicate the specific end user, since this is likely to end up in a public location.) The initial insert of this row into swt_order_data should have invoked the trigger and copied the record into swt_order_data_versions; the value in the version_id field is 1425, and the value in the version_stamp field is the same as the created & modified fields on the initial record. At 2008-06-18 11:22:07, the following query was executed to update the row: --- begin --- UPDATE swt_order_data SET modified = NOW(), modifiedBy = '96ed12ce2cacde9ec8a5dc692efa5409' WHERE id = '24ea8b6e95bac5f219a01c3bdb5c46d0' AND swa_customerID = '9e55471ba84686ade677ffe595c45992' --- end --- This correctly resulted in a new row being added to swt_order_data_versions, with the value of the 'modified' field being set to '2008-06-18 11:22:07' and the 'modifiedBy' field being set to the value specified in the query. The row in question had 'version_id' = 1434 and 'version_stamp' = '2008-06-18 11:22:07'. At 2008-06-18 16:03:05, the following query was executed: --- begin --- UPDATE swt_order_data SET ship_tracking_number = 'UPS_TRACKING_NUMBER_HERE', ship_date = '2008-06-18 00:00:00', modified = NOW(), modifiedBy = '96ed12ce2cacde9ec8a5dc692efa5409' WHERE id = '24ea8b6e95bac5f219a01c3bdb5c46d0' AND swa_customerID = '9e55471ba84686ade677ffe595c45992' --- end --- [The tracking number has been removed from the query.] This was the last update made to this record. In this case, it looks like the stored record in the main ('swt_order_data') table has the correct information; however, the copy of the data in the 'swt_order_data_version' table has the following differences: - bill_addr = '3386f6003ea0b6' [this is part of the value in the "createdBy" and "user_id" fields] - ship_addr = 'tal.montana.ed' [this is a fragment of the original email address from the "bill_email" and "ship_email" fields, 33 characters long, and this is a substring of the 14 characters immediately before the end of it.] It so happens, as well, that the actual values of the "ship_addr" and "bill_addr" fields (which have been changed in this bug report so as to not cause issues for our users) were 14 characters long.