diff options
Diffstat (limited to 'include/mysys_err.h')
-rw-r--r-- | include/mysys_err.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/mysys_err.h b/include/mysys_err.h index 19106dc3553..341e6950792 100644 --- a/include/mysys_err.h +++ b/include/mysys_err.h @@ -20,14 +20,20 @@ extern "C" { #endif -#define GLOB 0 /* Error maps */ -#define GLOBERRS 29 /* Max number of error messages in map's */ -#define EE(X) globerrs[ X ] /* Defines to add error to right map */ +#define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */ +#define EE(X) (globerrs[(X) - EE_ERROR_FIRST]) extern const char * NEAR globerrs[]; /* my_error_messages is here */ /* Error message numbers in global map */ -#define EE_FILENOTFOUND 0 +/* + Do not add error numbers before EE_ERROR_FIRST. + If necessary to add lower numbers, change EE_ERROR_FIRST accordingly. + + We start with error 1 to not confuse peoples with 'error 0' +*/ + +#define EE_ERROR_FIRST 1 /*Copy first error nr.*/ #define EE_CANTCREATEFILE 1 #define EE_READ 2 #define EE_WRITE 3 @@ -55,6 +61,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_REALPATH 26 #define EE_SYNC 27 #define EE_UNKNOWN_COLLATION 28 +#define EE_FILENOTFOUND 29 +#define EE_ERROR_LAST 29 /*Copy last error nr.*/ +/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* exit codes for all MySQL programs */ |