I am locating 'duplicate entries in a table and updating a status field
accordingly. The idea is to locate rows which have a matching 'Name' field,
and mark them for subsequent processing. However, my update query *ALWAYS*
returns Error 127, even on a newly created table if the matching name field
is 8 characters or more???.

Below is a minimum script which always results in the error "Got error 127
from table handler", with only two records in the table. Change the name
fields from AAAAAAAA (8 chars) to AAAAAAA (7 chars) and no error.

I would appreciate any help in tracking this down, or a suggestion for
another way of detecting duplicate records which doesn't cause the problem.

Ian

# -----------------------------------------------------------------------
USE test;
#
# Table structure for table 'error127'
#
DROP TABLE IF EXISTS `error127`;
CREATE TABLE `error127` (
  `ItemID` int(11) NOT NULL default '0',
  `Name` varchar(70) NOT NULL default '',
  `Status` int(11) NOT NULL default '0',
  PRIMARY KEY  (`ItemID`),
  KEY `Name` (`Name`)
) TYPE=MyISAM;
#
# Dumping data for table 'error127'
#
INSERT INTO `error127` (`ItemID`, `Name`) VALUES("1", "AAAAAAAA");
INSERT INTO `error127` (`ItemID`, `Name`) VALUES("2", "AAAAAAAA");
#
# Set status
#
UPDATE error127 AS a,error127 AS b SET a.status=2 WHERE a.name = b.name AND
a.itemid != b.itemid;

# -----------------------------------------------------------------------



MySQL 4.011g, WinXP Prof

--
Ian Wall




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to