Invalid error code (126)

Posted on 2006-04-28
Last Modified: 2012-08-13
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"?

Question by:rstaveley
    LVL 11

    Accepted 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.
    LVL 17

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (…
    All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now