Note: This section is included for historical purposes. In practice, no new error messages should be added to error message files for versions of MySQL prior to 5.0.3. Doing so and merging the messages upward would cause error numbers to change in more recent versions.
Before MySQL 5.0.3, error messages are stored in
errmsg.txt files in the language directories
sql/share. The files have names like
danish/errmsg.txt, and so forth, and each one
is language-specific. Each of these language-specific files must
contain a line for each error message, so adding a new message
involves adding a line to the
for every language. The procedure involves adding the English
message to the
english/errmsg.txt file and
running a script that adds the message to the other
language-specific files. Translators may translate the message
errmsg.txt files later.
Open the file
sql/share/english/errmsg.txtin an editor.
Add new error messages at the end of this file. Each message should be on a separate line, and it must be quoted within double quote ('
"') characters. By convention, every message line except the last should end with a comma ('
,') following the second double quote.
For each new error message, add a
#defineline to the
include/mysqld_error.hfile before the last line (
Adjust the value of
ER_ERROR_MESSAGESto the new number of error messages.
Add the defined error symbols to
include/sql_state.h. This file contains the SQL states for the error messages. If the new errors don't have SQL states, add a comment instead. Note that this file must be kept sorted according to the value of the error number. That is, although the
sql_state.hfile might not contain an entry for every symbol in
mysqld_error.h, those entries that are present in
sql_state.hmust appear in the same order as those for the corresponding entries in
Go to the
sqldirectory in a terminal window and type ./add_errmsg N. This will copy the last N error messages from
share/english.txtto all the other language files in
Translate the error message for those languages that you know by editing the files
Make a full build (configure + make). A make all is insufficient to build the