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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0302f48c
Commit
0302f48c
authored
Mar 28, 2007
by
msvensson@pilot.blaudden
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.blaudden:/home/msvensson/mysql/bug27490/my50-bug27490
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
parents
c2bbf3c0
b82b20cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
sql/log.cc
sql/log.cc
+11
-23
No files found.
sql/log.cc
View file @
0302f48c
...
@@ -283,7 +283,7 @@ err:
...
@@ -283,7 +283,7 @@ err:
#ifdef __NT__
#ifdef __NT__
static
int
eventSource
=
0
;
static
int
eventSource
=
0
;
void
setup_windows_event_source
()
static
void
setup_windows_event_source
()
{
{
HKEY
hRegKey
=
NULL
;
HKEY
hRegKey
=
NULL
;
DWORD
dwError
=
0
;
DWORD
dwError
=
0
;
...
@@ -2229,7 +2229,7 @@ static bool test_if_number(register const char *str,
...
@@ -2229,7 +2229,7 @@ static bool test_if_number(register const char *str,
}
/* test_if_number */
}
/* test_if_number */
void
print_buffer_to_file
(
enum
loglevel
level
,
const
char
*
buffer
)
static
void
print_buffer_to_file
(
enum
loglevel
level
,
const
char
*
buffer
)
{
{
time_t
skr
;
time_t
skr
;
struct
tm
tm_tmp
;
struct
tm
tm_tmp
;
...
@@ -2326,23 +2326,15 @@ void MYSQL_LOG::signal_update()
...
@@ -2326,23 +2326,15 @@ void MYSQL_LOG::signal_update()
}
}
#ifdef __NT__
#ifdef __NT__
void
print_buffer_to_nt_eventlog
(
enum
loglevel
level
,
char
*
buff
,
static
void
print_buffer_to_nt_eventlog
(
enum
loglevel
level
,
char
*
buff
,
uint
length
,
int
buffLen
)
uint
length
,
int
buffLen
)
{
{
HANDLE
event
;
HANDLE
event
;
char
*
buffptr
;
char
*
buffptr
=
buff
;
LPCSTR
*
buffmsgptr
;
DBUG_ENTER
(
"print_buffer_to_nt_eventlog"
);
DBUG_ENTER
(
"print_buffer_to_nt_eventlog"
);
buffptr
=
buff
;
/* Add ending CR/LF's to string, overwrite last chars if necessary */
if
(
length
>
(
uint
)(
buffLen
-
5
))
strmov
(
buffptr
+
min
(
length
,
buffLen
-
5
),
"
\r\n\r\n
"
);
{
char
*
newBuff
=
new
char
[
length
+
5
];
strcpy
(
newBuff
,
buff
);
buffptr
=
newBuff
;
}
strmov
(
buffptr
+
length
,
"
\r\n\r\n
"
);
buffmsgptr
=
(
LPCSTR
*
)
&
buffptr
;
// Keep windows happy
setup_windows_event_source
();
setup_windows_event_source
();
if
((
event
=
RegisterEventSource
(
NULL
,
"MySQL"
)))
if
((
event
=
RegisterEventSource
(
NULL
,
"MySQL"
)))
...
@@ -2350,24 +2342,20 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
...
@@ -2350,24 +2342,20 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
switch
(
level
)
{
switch
(
level
)
{
case
ERROR_LEVEL
:
case
ERROR_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_ERROR_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
ReportEvent
(
event
,
EVENTLOG_ERROR_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsg
ptr
,
NULL
);
(
LPCSTR
*
)
&
buff
ptr
,
NULL
);
break
;
break
;
case
WARNING_LEVEL
:
case
WARNING_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_WARNING_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
ReportEvent
(
event
,
EVENTLOG_WARNING_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsg
ptr
,
NULL
);
(
LPCSTR
*
)
&
buff
ptr
,
NULL
);
break
;
break
;
case
INFORMATION_LEVEL
:
case
INFORMATION_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_INFORMATION_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
ReportEvent
(
event
,
EVENTLOG_INFORMATION_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsg
ptr
,
NULL
);
0
,
(
LPCSTR
*
)
&
buff
ptr
,
NULL
);
break
;
break
;
}
}
DeregisterEventSource
(
event
);
DeregisterEventSource
(
event
);
}
}
/* if we created a string buffer, then delete it */
if
(
buffptr
!=
buff
)
delete
[]
buffptr
;
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
#endif
/* __NT__ */
#endif
/* __NT__ */
...
@@ -2405,7 +2393,7 @@ void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
...
@@ -2405,7 +2393,7 @@ void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
uint
length
;
uint
length
;
DBUG_ENTER
(
"vprint_msg_to_log"
);
DBUG_ENTER
(
"vprint_msg_to_log"
);
length
=
my_vsnprintf
(
buff
,
sizeof
(
buff
)
-
5
,
format
,
args
);
length
=
my_vsnprintf
(
buff
,
sizeof
(
buff
),
format
,
args
);
print_buffer_to_file
(
level
,
buff
);
print_buffer_to_file
(
level
,
buff
);
#ifdef __NT__
#ifdef __NT__
...
...
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