|
1 | 1 | .. _error_pad: |
2 | 2 |
|
3 | | -========================== |
4 | | - Error Code Compatibility |
5 | | -========================== |
| 3 | +======================== |
| 4 | +Error Code Compatibility |
| 5 | +======================== |
6 | 6 |
|
7 | | -|Percona Server| with |XtraDB| has error code incompatibilities with |MySQL| 5.5. It is important to maintain compatibility in the error codes used by the servers. For example, scripts that may be run on both servers could contain references to error codes. |
| 7 | +|Percona Server| has error code incompatibilities with |MySQL| 5.5. This could |
| 8 | +cause issues if, for example, scripts that should be run on both servers |
| 9 | +contain the references to error codes. |
8 | 10 |
|
9 | 11 | The reasons for the current incompatibilities are: |
10 | 12 |
|
11 | | - * |Percona Server| with |XtraDB| contains features that have been backported from MyQL 5.5. Some of the |MySQL| 5.5 features added new error codes. |
| 13 | + * |Percona Server| contains features that have been backported from newer |
| 14 | + versions of |MySQL|. Some of the these backported features have added new |
| 15 | + error codes. |
12 | 16 |
|
13 | | - * Some |Percona Server| with |XtraDB| features have added new error codes. |
| 17 | + * Some |Percona Server| features have added new error codes. |
14 | 18 |
|
15 | | -The solution to the first problem is to preserve |MySQL| 5.5 error codes in the |Percona Server|. An example of where this has been done is |Percona Server| feature Query Cache Enhancements. This feature adds error ``ER_QUERY_CACHE_DISABLED`` to the |Percona Server|, which is defined as error code 1651 in |MySQL| 5.5. |
| 19 | +The solution to the first problem is to preserve the |MySQL| error codes in |
| 20 | +|Percona Server|. An example of where this has been done is |Percona Server| |
| 21 | +:ref:`query_cache_enhance` feature. This feature adds new |
| 22 | +``ER_QUERY_CACHE_DISABLED`` error to the |Percona Server|, which is defined as |
| 23 | +an error code ``1651`` in |MySQL|. |
16 | 24 |
|
17 | | -After migrating |Percona Server| / |XtraDB| to |MySQL| 5.5, users might experience troubles because of this. |
| 25 | +In case some |Percona Server| features introduce the new new error codes. Users |
| 26 | +might experience issues after migrating from |Percona Server| to |MySQL| where |
| 27 | +this error code already exists as a |MySQL| specific error code. |
18 | 28 |
|
19 | | -The solution to the second problem is to insure that unique error codes are chosen, when adding new ones to |Percona Server|, that will never be duplicated during |MySQL| development. |
| 29 | +The avoid this |Percona Server| insures that unique error codes are chosen, |
| 30 | +when new features are being added and that these codes will never be |
| 31 | +duplicated during |MySQL| development. |
20 | 32 |
|
21 | | -For example, |MySQL| has a tool ``comp_err`` that generates: |
| 33 | +This has been implemented by extending the |MySQL| :program:`comp_err` tool. |
| 34 | +This tool is used to generate the :file:`errmsg.sys` and error message header |
| 35 | +files. |
22 | 36 |
|
23 | | - - :file:`errmsg.sys` files |
| 37 | +Because :program:`comp_err` assigns the error code numbers sequentially and |
| 38 | +without gaps, to keep the error numbers consistent. :program:`comp_err` now |
| 39 | +padds the empty intervals (from the last error code number) by custom message |
| 40 | +(like ``ER_QUERY_CACHE_DISABLED padding to 1651 error``). |
24 | 41 |
|
25 | | - - header file :file:`include/mysqld_error.h` |
26 | | - |
27 | | - - header file :file:`include/mysqld_ername.h` |
28 | | - |
29 | | -from the file :file:`errmsg.txt`. |
30 | | - |
31 | | -To keep error numbers consistent, we should add some fictive errors to :file:`errmsg.txt`, because ``comp_err`` assigns error code numbers sequentially, without gaps. |
32 | | - |
33 | | -I propose patch to ``comp_err``. |
34 | | - |
35 | | -This patch allows usage of a new syntax, with prefix ``PADD``, for example: :: |
36 | | - |
37 | | - PADD_QUERY_CACHE_DISABLED 1651 |
38 | | - eng "ER_QUERY_CACHE_DISABLED padding to 1651 error" |
39 | | - ER_QUERY_CACHE_DISABLED |
40 | | - eng "Query cache is disabled; restart the server with query_cache_type=1 to enable it" |
41 | | - |
42 | | -comp_err with my patch padds empty intervals (from last error code number to 1651) by error message ``ER_QUERY_CACHE_DISABLED padding to 1651 error``, i.e. and ``ER_QUERY_CACHE_DISABLED`` now has error code 1651 (as desired). I propose to use this patch for Percona errors, for example: :: |
43 | | - |
44 | | - PADD_PERCONA_NEW_ERROR_CODE 4000 |
45 | | - end "Padd empty space to error code number 4000 (Percona error codes)" |
46 | | - ...some percona error codes... |
47 | | - |
48 | | -Patch only adds prefix ``PADD_`` and padds error in sys files. All other |MySQL| code (load*.sys files, my_error, etc) works as old one. |
| 42 | +This feature only adds prefix ``PADD_`` and padds error in ``sys`` files. All |
| 43 | +other |MySQL| code (``load*.sys`` files, ``my_error``, etc) works without |
| 44 | +change. |
49 | 45 |
|
50 | 46 |
|
51 | 47 | Version-Specific Information |
|
0 commit comments