• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1542
  • Last Modified:

Invalid error code (126)

We have a-b-a replication between servers in data centres and have started seeing the following appearing when you run show slave status:

Query caused different errors on master and slave. Error on master: 'Invalid error code' (126), Error on slave: 'no error' (0). Default database: 'EMFMTA_1_2'. Query: 'REPLACE INTO rescan_schedule SELECT MailInID,RecipID,ADDDATE(NOW(),INTERVAL IFNULL(ELT(Attempts,60,60,120,240,480,900,1800,3600,7200,14400),SUBSTRING_INDEX('60,60,120,240,480,900,1800,3600,7200,14400',',',IF(Attempts<1,1,-1))) SECOND),NULL FROM recip WHERE RecipID in (2181280448,2181280452)'

The servers are both the same MySQL version (5.0.18-max-log). What might cause an "invalid error code"?

1 Solution
Query is fine, the reason why it is failing may be
index file is crashed or file format is wrong. Try repairing the table.
Here is the list of error codes
126 = Index file is crashed / Wrong file format
127 = Record-file is crashed
132 = Old database file
134 = Record was already deleted (or record file crashed)
135 = No more room in record file
136 = No more room in index file
141 = Duplicate unique key or constraint on write or update
144 = Table is crashed and last repair failed
145 = Table was marked as crashed and should be repaired
28 = You ran out of disk space. Delete unnecesary files, or move the MySQL data files to another partition.
1045: Access denied for user: = You forgot to specify a password, or you used the wrong one. Use the -u and -p options when starting the client. (use mysql --help to see how)
1046: No Database Selected = You must use the command USE database_name or the mysql_select_db() function to select a database to use.
1062: Duplicate entry 'x' for key n = You have attempted to insert or update data that would break the integrity of a UNIQUE index (most likely the primary key). You must redefine either the data you're trying to insert, or the indexes which you have imposed on the table.
1064: Syntax error = You wrote something that doesn't match the syntax definitions in the manual. When you have checked everything else, here's something to consider: A common error is to put a space between a function name and its opening parenthesis '('. Another common error is to use a reserved word out of its normal context.
2000: parse error near ... = see explanation for 1064: Syntax error
2002: Can't connect to local MySQL server = The MySQL socket file (usually, /tmp/mysql.sock) is missing. See the notes on connecting to the server.
rstaveleyAuthor Commented:
Thanks, star_trek. I wonder why the library lists it as an "invalid" error code. That table is very useful and yes, repairing the table provides a fix. I'll need to investigate to find out how often this is happening now. I'm seeing it on a couple of servers.

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now