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
5c106961
Commit
5c106961
authored
May 05, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended perror to enable printing of storage engine specific errors for ndb
parent
d90b362f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
extra/Makefile.am
extra/Makefile.am
+1
-1
extra/perror.c
extra/perror.c
+23
-1
No files found.
extra/Makefile.am
View file @
5c106961
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
INCLUDES
=
@MT_INCLUDES@
-I
$(top_srcdir)
/include
INCLUDES
=
@MT_INCLUDES@
-I
$(top_srcdir)
/include
@ndbcluster_includes@
LDADD
=
@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a
\
LDADD
=
@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a
\
../dbug/libdbug.a ../strings/libmystrings.a
../dbug/libdbug.a ../strings/libmystrings.a
bin_PROGRAMS
=
replace comp_err perror resolveip my_print_defaults
\
bin_PROGRAMS
=
replace comp_err perror resolveip my_print_defaults
\
...
...
extra/perror.c
View file @
5c106961
...
@@ -23,15 +23,27 @@
...
@@ -23,15 +23,27 @@
#include <m_string.h>
#include <m_string.h>
#include <errno.h>
#include <errno.h>
#include <my_getopt.h>
#include <my_getopt.h>
#ifdef HAVE_NDBCLUSTER_DB
#include "../ndb/src/ndbapi/ndberror.c"
#endif
static
my_bool
verbose
,
print_all_codes
;
static
my_bool
verbose
,
print_all_codes
;
#ifdef HAVE_NDBCLUSTER_DB
static
my_bool
ndb_code
;
static
char
ndb_string
[
1024
];
#endif
static
struct
my_option
my_long_options
[]
=
static
struct
my_option
my_long_options
[]
=
{
{
{
"help"
,
'?'
,
"Displays this help and exits."
,
0
,
0
,
0
,
GET_NO_ARG
,
{
"help"
,
'?'
,
"Displays this help and exits."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"info"
,
'I'
,
"Synonym for --help."
,
0
,
0
,
0
,
GET_NO_ARG
,
{
"info"
,
'I'
,
"Synonym for --help."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#ifdef HAVE_NDBCLUSTER_DB
{
"ndb"
,
0
,
"Ndbcluster storage engine specific error codes."
,
(
gptr
*
)
&
ndb_code
,
(
gptr
*
)
&
ndb_code
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
#endif
#ifdef HAVE_SYS_ERRLIST
#ifdef HAVE_SYS_ERRLIST
{
"all"
,
'a'
,
"Print all the error messages and the number."
,
{
"all"
,
'a'
,
"Print all the error messages and the number."
,
(
gptr
*
)
&
print_all_codes
,
(
gptr
*
)
&
print_all_codes
,
0
,
GET_BOOL
,
NO_ARG
,
(
gptr
*
)
&
print_all_codes
,
(
gptr
*
)
&
print_all_codes
,
0
,
GET_BOOL
,
NO_ARG
,
...
@@ -199,7 +211,17 @@ int main(int argc,char *argv[])
...
@@ -199,7 +211,17 @@ int main(int argc,char *argv[])
{
{
found
=
0
;
found
=
0
;
code
=
atoi
(
*
argv
);
code
=
atoi
(
*
argv
);
msg
=
strerror
(
code
);
#ifdef HAVE_NDBCLUSTER_DB
if
(
ndb_code
)
{
if
(
ndb_error_string
(
code
,
ndb_string
,
1024
)
<
0
)
msg
=
0
;
else
msg
=
ndb_string
;
}
else
#endif
msg
=
strerror
(
code
);
if
(
msg
)
if
(
msg
)
{
{
found
=
1
;
found
=
1
;
...
...
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