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
4b7cf43b
Commit
4b7cf43b
authored
Apr 15, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fixes for BUG46587 and BUG47059 to trunk-bugfixing.
parents
3cfae69d
593b0bd2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
15 deletions
+44
-15
include/mysql/plugin_audit.h
include/mysql/plugin_audit.h
+4
-3
plugin/audit_null/audit_null.c
plugin/audit_null/audit_null.c
+38
-10
sql/sql_audit.cc
sql/sql_audit.cc
+1
-0
storage/archive/azlib.h
storage/archive/azlib.h
+1
-2
No files found.
include/mysql/plugin_audit.h
View file @
4b7cf43b
...
...
@@ -24,7 +24,7 @@
#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
#define MYSQL_AUDIT_INTERFACE_VERSION 0x0
1
00
#define MYSQL_AUDIT_INTERFACE_VERSION 0x0
2
00
/*
The first word in every event class struct indicates the specific
...
...
@@ -32,7 +32,7 @@
*/
struct
mysql_event
{
int
event_class
;
unsigned
int
event_class
;
};
...
...
@@ -52,7 +52,8 @@ struct mysql_event
struct
mysql_event_general
{
int
event_class
;
unsigned
int
event_class
;
unsigned
int
event_subclass
;
int
general_error_code
;
unsigned
long
general_thread_id
;
const
char
*
general_user
;
...
...
plugin/audit_null/audit_null.c
View file @
4b7cf43b
...
...
@@ -22,6 +22,9 @@
#endif
static
volatile
int
number_of_calls
;
/* for SHOW STATUS, see below */
static
volatile
int
number_of_calls_general_log
;
static
volatile
int
number_of_calls_general_error
;
static
volatile
int
number_of_calls_general_result
;
/*
...
...
@@ -41,6 +44,9 @@ static volatile int number_of_calls; /* for SHOW STATUS, see below */
static
int
audit_null_plugin_init
(
void
*
arg
__attribute__
((
unused
)))
{
number_of_calls
=
0
;
number_of_calls_general_log
=
0
;
number_of_calls_general_error
=
0
;
number_of_calls_general_result
=
0
;
return
(
0
);
}
...
...
@@ -60,7 +66,6 @@ static int audit_null_plugin_init(void *arg __attribute__((unused)))
static
int
audit_null_plugin_deinit
(
void
*
arg
__attribute__
((
unused
)))
{
printf
(
"audit_null was invoked %u times
\n
"
,
number_of_calls
);
return
(
0
);
}
...
...
@@ -76,11 +81,29 @@ static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
*/
static
void
audit_null_notify
(
MYSQL_THD
thd
__attribute__
((
unused
)),
const
struct
mysql_event
*
event
__attribute__
((
unused
)))
const
struct
mysql_event
*
event
)
{
/* prone to races, oh well */
number_of_calls
++
;
if
(
event
->
event_class
==
MYSQL_AUDIT_GENERAL_CLASS
)
{
const
struct
mysql_event_general
*
event_general
=
(
const
struct
mysql_event_general
*
)
event
;
switch
(
event_general
->
event_subclass
)
{
case
MYSQL_AUDIT_GENERAL_LOG
:
number_of_calls_general_log
++
;
break
;
case
MYSQL_AUDIT_GENERAL_ERROR
:
number_of_calls_general_error
++
;
break
;
case
MYSQL_AUDIT_GENERAL_RESULT
:
number_of_calls_general_result
++
;
break
;
default:
break
;
}
}
}
...
...
@@ -90,10 +113,10 @@ static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
static
struct
st_mysql_audit
audit_null_descriptor
=
{
MYSQL_AUDIT_INTERFACE_VERSION
,
/* interface version
*/
NULL
,
/* release_thd function
*/
audit_null_notify
,
/* notify function
*/
{
(
unsigned
long
)
-
1
}
/* class mask
*/
MYSQL_AUDIT_INTERFACE_VERSION
,
/* interface version
*/
NULL
,
/* release_thd function
*/
audit_null_notify
,
/* notify function
*/
{
(
unsigned
long
)
MYSQL_AUDIT_GENERAL_CLASSMASK
}
/* class mask
*/
};
/*
...
...
@@ -102,8 +125,13 @@ static struct st_mysql_audit audit_null_descriptor=
static
struct
st_mysql_show_var
simple_status
[]
=
{
{
"audit_null_called"
,
(
char
*
)
&
number_of_calls
,
SHOW_INT
},
{
0
,
0
,
0
}
{
"Audit_null_called"
,
(
char
*
)
&
number_of_calls
,
SHOW_INT
},
{
"Audit_null_general_log"
,
(
char
*
)
&
number_of_calls_general_log
,
SHOW_INT
},
{
"Audit_null_general_error"
,
(
char
*
)
&
number_of_calls_general_error
,
SHOW_INT
},
{
"Audit_null_general_result"
,
(
char
*
)
&
number_of_calls_general_result
,
SHOW_INT
},
{
0
,
0
,
0
}
};
...
...
@@ -121,7 +149,7 @@ mysql_declare_plugin(audit_null)
PLUGIN_LICENSE_GPL
,
audit_null_plugin_init
,
/* init function (when loaded) */
audit_null_plugin_deinit
,
/* deinit function (when unloaded) */
0x000
1
,
/* version */
0x000
2
,
/* version */
simple_status
,
/* status variables */
NULL
,
/* system variables */
NULL
...
...
sql/sql_audit.cc
View file @
4b7cf43b
...
...
@@ -65,6 +65,7 @@ static void general_class_handler(THD *thd, uint event_subtype, va_list ap)
{
mysql_event_general
event
;
event
.
event_class
=
MYSQL_AUDIT_GENERAL_CLASS
;
event
.
event_subclass
=
event_subtype
;
event
.
general_error_code
=
va_arg
(
ap
,
int
);
event
.
general_thread_id
=
thd
?
thd
->
thread_id
:
0
;
event
.
general_time
=
va_arg
(
ap
,
time_t
);
...
...
storage/archive/azlib.h
View file @
4b7cf43b
...
...
@@ -33,10 +33,9 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
#include <zlib.h>
#include "../../mysys/mysys_priv.h"
#include <my_dir.h>
#include <zlib.h>
#ifdef __cplusplus
extern
"C"
{
...
...
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