Skip to content

Commit 39f1950

Browse files
committed
MDEV-19068 - rename eventlog source to MariaDB.
1 parent 8d27f1e commit 39f1950

File tree

5 files changed

+26
-34
lines changed

5 files changed

+26
-34
lines changed

sql/MSG00001.bin

-148 Bytes
Binary file not shown.

sql/log.cc

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ static void setup_windows_event_source()
24492449

24502450
// Create the event source registry key
24512451
dwError= RegCreateKey(HKEY_LOCAL_MACHINE,
2452-
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MySQL",
2452+
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MariaDB",
24532453
&hRegKey);
24542454

24552455
/* Name of the PE module that contains the message resource */
@@ -8697,18 +8697,35 @@ bool flush_error_log()
86978697
}
86988698

86998699
#ifdef _WIN32
8700+
struct eventlog_source
8701+
{
8702+
HANDLE handle;
8703+
eventlog_source()
8704+
{
8705+
setup_windows_event_source();
8706+
handle = RegisterEventSource(NULL, "MariaDB");
8707+
}
8708+
8709+
~eventlog_source()
8710+
{
8711+
if (handle)
8712+
DeregisterEventSource(handle);
8713+
}
8714+
};
8715+
8716+
static eventlog_source eventlog;
8717+
87008718
static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
87018719
size_t length, size_t buffLen)
87028720
{
8703-
HANDLE event;
8721+
HANDLE event= eventlog.handle;
87048722
char *buffptr= buff;
87058723
DBUG_ENTER("print_buffer_to_nt_eventlog");
87068724

87078725
/* Add ending CR/LF's to string, overwrite last chars if necessary */
87088726
strmov(buffptr+MY_MIN(length, buffLen-5), "\r\n\r\n");
87098727

8710-
setup_windows_event_source();
8711-
if ((event= RegisterEventSource(NULL,"MySQL")))
8728+
if (event)
87128729
{
87138730
switch (level) {
87148731
case ERROR_LEVEL:
@@ -8724,7 +8741,6 @@ static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
87248741
0, (LPCSTR*) &buffptr, NULL);
87258742
break;
87268743
}
8727-
DeregisterEventSource(event);
87288744
}
87298745

87308746
DBUG_VOID_RETURN;

sql/message.h

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
#ifndef MESSAGE_INCLUDED
2-
#define MESSAGE_INCLUDED
3-
/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
4-
Use is subject to license terms.
5-
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU General Public License as published by
8-
the Free Software Foundation; version 2 of the License.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU General Public License for more details.
14-
15-
You should have received a copy of the GNU General Public License
16-
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
18-
191
/*
202
To change or add messages mysqld writes to the Windows error log, run
213
mc.exe message.mc
@@ -24,10 +6,8 @@
246
mc.exe can be installed with Windows SDK, some Visual Studio distributions
257
do not include it.
268
*/
27-
28-
299
//
30-
// Values are 32 bit values layed out as follows:
10+
// Values are 32 bit values laid out as follows:
3111
//
3212
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
3313
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
@@ -67,11 +47,8 @@
6747
//
6848
// MessageText:
6949
//
70-
// %1For more information, see Help and Support Center at http://www.mysql.com.
71-
//
72-
//
50+
// %1
51+
//
7352
//
7453
#define MSG_DEFAULT 0xC0000064L
7554

76-
#endif /* MESSAGE_INCLUDED */
77-

sql/message.mc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ Severity = Error
1111
Facility = Application
1212
SymbolicName = MSG_DEFAULT
1313
Language = English
14-
%1For more information, see Help and Support Center at http://www.mysql.com.
15-
14+
%1
1615

sql/message.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
LANGUAGE 0x9,0x1
2-
1 11 MSG00001.bin
2+
1 11 "MSG00001.bin"

0 commit comments

Comments
 (0)