Error Code Ranges •Class =  ’00’  indicates success. •Class =  ’01’  indicates a warning. •Class =  ’02’  indicates “not found.”  This is relevant within the context of cursors and is used to control what happens when a cursor reaches the end of a data set. This condition also occurs for SELECT ... INTO  var_list  statements that retrieve no rows. •Class >  ’02’  indicates an exception. •Message string: This string provides a textual description of the error. •1 to 999: Global error codes. This error code range is called “global”  because it is a shared range that is used by the server as well as by clients. •1,000 to 1,999: Server error codes reserved for messages sent to clients. •2,000 to 2,999: Client error codes reserved for use by the client library. •3,000 to 4,999: Server error codes reserved for messages sent to clients. •5,000 to 5,999: Error codes reserved for use by X Plugin for messages sent to clients. •10,000 to 49,999: Server error codes reserved for messages to be written to the error log (not sent to clients). •50,000 to 51,999: Error codes reserved for use by third parties. •When the server writes a message to the error log, it pads the error code with leading zeros to six digits and adds a prefix of  MY-  (examples:  MY-000022 ,  MY-010048 ). •When the server sends a message to a client program, it adds no zero-padding or prefix to the error code (examples:  1036 ,  3013 ). For server-side errors, not all MySQL error numbers have corresponding SQLSTATE values. In these cases,  ’HY000’  (general error) is used. For client-side errors, the SQLSTATE value is always  ’HY000’  (general error), so it is not meaningful for distinguishing one client error from another. The set of error codes used in error messages is partitioned into distinct ranges, each with its own purpose: When an error in this range originates on the server side, the server writes it to the error log, padding the error code with leading zeros to six digits and adding a prefix of  MY- . When an error in this range originates on the client side, the client library makes it available to the client program with no zero-padding or prefix. When an error in this range occurs, the server writes it to the error log, padding the error code with leading zeros to six digits and adding a prefix of  MY- . The server handles error messages written to the error log differently from error messages sent to clients: B.2 Error Information Interfaces Error Code Ranges 5283