Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b500a155
Commit
b500a155
authored
Jan 04, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added creation of mysqld_ername.h
extra/Makefile.am: Added rule for creating mysqld_ername.h
parent
0b842a55
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
extra/Makefile.am
extra/Makefile.am
+3
-2
extra/comp_err.c
extra/comp_err.c
+15
-1
No files found.
extra/Makefile.am
View file @
b500a155
...
...
@@ -19,7 +19,7 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include \
-I
$(top_srcdir)
/extra
LDADD
=
@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a
\
../dbug/libdbug.a ../strings/libmystrings.a
BUILT_SOURCES
=
mysqld_error.h sql_state.h
BUILT_SOURCES
=
mysqld_error.h sql_state.h
mysqld_ername.h
pkginclude_HEADERS
=
$(BUILT_SOURCES)
created_sources
=
created_include_files
CLEANFILES
=
$(created_sources)
...
...
@@ -29,10 +29,11 @@ all: $(created_sources)
# This will build mysqld_error.h and sql_state.h
mysqld_error.h
:
created_include_files
mysqld_ername.h
:
created_include_files
sql_state.h
:
created_include_files
created_include_files
:
comp_err
$(top_builddir)
/extra/comp_err
--charset
=
$(srcdir)
/../sql/share/charsets
--out-dir
=
$(top_builddir)
/sql/share/
--header_file
=
$(top_builddir)
/extra/mysqld_error.h
--state_file
=
$(top_builddir)
/extra/sql_state.h
--in_file
=
$(srcdir)
/../sql/share/errmsg.txt
$(top_builddir)
/extra/comp_err
--charset
=
$(srcdir)
/../sql/share/charsets
--out-dir
=
$(top_builddir)
/sql/share/
--header_file
=
$(top_builddir)
/extra/mysqld_error.h
--
name_file
=
$(top_builddir)
/extra/mysqld_ername.h
--
state_file
=
$(top_builddir)
/extra/sql_state.h
--in_file
=
$(srcdir)
/../sql/share/errmsg.txt
touch
created_include_files
bin_PROGRAMS
=
replace comp_err perror resolveip my_print_defaults
\
...
...
extra/comp_err.c
View file @
b500a155
...
...
@@ -37,6 +37,7 @@
#define ER_PREFIX "ER_"
static
char
*
OUTFILE
=
(
char
*
)
"errmsg.sys"
;
static
char
*
HEADERFILE
=
(
char
*
)
"mysqld_error.h"
;
static
char
*
NAMEFILE
=
(
char
*
)
"mysqld_ername.h"
;
static
char
*
STATEFILE
=
(
char
*
)
"sql_state.h"
;
static
char
*
TXTFILE
=
(
char
*
)
"../sql/share/errmsg.txt"
;
static
char
*
DATADIR
=
(
char
*
)
"../sql/share/"
;
...
...
@@ -117,6 +118,8 @@ static struct my_option my_long_options[]=
(
gptr
*
)
&
OUTFILE
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"header_file"
,
'H'
,
"mysqld_error.h file "
,
(
gptr
*
)
&
HEADERFILE
,
(
gptr
*
)
&
HEADERFILE
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"name_file"
,
'N'
,
"mysqld_ername.h file "
,
(
gptr
*
)
&
NAMEFILE
,
(
gptr
*
)
&
NAMEFILE
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"state_file"
,
'S'
,
"sql_state.h file"
,
(
gptr
*
)
&
STATEFILE
,
(
gptr
*
)
&
STATEFILE
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
...
...
@@ -192,7 +195,7 @@ int main(int argc, char *argv[])
static
int
create_header_files
(
struct
errors
*
error_head
)
{
uint
er_count
=
0
;
FILE
*
er_definef
,
*
sql_statef
;
FILE
*
er_definef
,
*
sql_statef
,
*
er_namef
;
struct
errors
*
tmp_error
;
DBUG_ENTER
(
"create_header_files"
);
...
...
@@ -205,9 +208,16 @@ static int create_header_files(struct errors *error_head)
my_fclose
(
er_definef
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
if
(
!
(
er_namef
=
my_fopen
(
NAMEFILE
,
O_WRONLY
,
MYF
(
MY_WME
))))
{
my_fclose
(
er_definef
,
MYF
(
0
));
my_fclose
(
sql_statef
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
fprintf
(
er_definef
,
"/* Autogenerated file, please don't edit */
\n\n
"
);
fprintf
(
sql_statef
,
"/* Autogenerated file, please don't edit */
\n\n
"
);
fprintf
(
er_namef
,
"/* Autogenerated file, please don't edit */
\n\n
"
);
for
(
tmp_error
=
error_head
;
tmp_error
;
tmp_error
=
tmp_error
->
next_error
)
{
...
...
@@ -223,6 +233,10 @@ static int create_header_files(struct errors *error_head)
fprintf
(
sql_statef
,
"%-40s,
\"
%s
\"
,
\"
%s
\"
,
\n
"
,
tmp_error
->
er_name
,
tmp_error
->
sql_code1
,
tmp_error
->
sql_code2
);
/*generating er_name file */
fprintf
(
er_namef
,
"{
\"
%s
\"
, %d },
\n
"
,
tmp_error
->
er_name
,
tmp_error
->
d_code
);
er_count
++
;
}
/* finishing off with mysqld_error.h */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment