Skip to content

Commit d4baeca

Browse files
committed
Windows : Fix server compile errors when compile with /Zc:strictStrings option
1 parent fc673a2 commit d4baeca

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

client/mysqlbinlog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static const char* sock= 0;
106106
static char *opt_plugindir= 0, *opt_default_auth= 0;
107107

108108
#ifdef HAVE_SMEM
109-
static char *shared_memory_base_name= 0;
109+
static const char *shared_memory_base_name= 0;
110110
#endif
111111
static char* user = 0;
112112
static char* pass = 0;

include/my_global.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,9 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
10781078
static inline char *dlerror(void)
10791079
{
10801080
static char win_errormsg[2048];
1081-
if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
1082-
0, GetLastError(), 0, win_errormsg, 2048, NULL))
1083-
return win_errormsg;
1084-
return "";
1081+
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
1082+
0, GetLastError(), 0, win_errormsg, 2048, NULL);
1083+
return win_errormsg;
10851084
}
10861085
#define HAVE_DLOPEN 1
10871086
#define HAVE_DLERROR 1

sql/mysql_install_db.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ static int register_service()
386386
CloseServiceHandle(sc_manager);
387387
die("CreateService failed (%u)", GetLastError());
388388
}
389-
390-
SERVICE_DESCRIPTION sd= { "MariaDB database server" };
389+
char description[] = "MariaDB database server";
390+
SERVICE_DESCRIPTION sd= { description };
391391
ChangeServiceConfig2(sc_service, SERVICE_CONFIG_DESCRIPTION, &sd);
392392
CloseServiceHandle(sc_service);
393393
CloseServiceHandle(sc_manager);

sql/mysqld.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE;
14141414
Query_cache query_cache;
14151415
#endif
14161416
#ifdef HAVE_SMEM
1417-
char *shared_memory_base_name= default_shared_memory_base_name;
1417+
const char *shared_memory_base_name= default_shared_memory_base_name;
14181418
my_bool opt_enable_shared_memory;
14191419
HANDLE smem_event_connect_request= 0;
14201420
#endif

sql/mysqld.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ extern my_bool sp_automatic_privileges, opt_noacl;
118118
extern ulong use_stat_tables;
119119
extern my_bool opt_old_style_user_limits, trust_function_creators;
120120
extern uint opt_crash_binlog_innodb;
121-
extern char *shared_memory_base_name, *mysqld_unix_port;
121+
extern const char *shared_memory_base_name;
122+
extern char *mysqld_unix_port;
122123
extern my_bool opt_enable_shared_memory;
123124
extern ulong opt_replicate_events_marked_for_skip;
124125
extern char *default_tz_name;

sql/nt_servc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ BOOL NTService::IsService(LPCSTR ServiceName)
508508
}
509509
/* ------------------------------------------------------------------------
510510
-------------------------------------------------------------------------- */
511-
BOOL NTService::got_service_option(char **argv, char *service_option)
511+
BOOL NTService::got_service_option(char **argv, const char *service_option)
512512
{
513513
char *option;
514514
for (option= argv[1]; *option; option++)

sql/nt_servc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class NTService
6161
BOOL SeekStatus(LPCSTR szInternName, int OperationType);
6262
BOOL Remove(LPCSTR szInternName);
6363
BOOL IsService(LPCSTR ServiceName);
64-
BOOL got_service_option(char **argv, char *service_option);
64+
BOOL got_service_option(char **argv, const char *service_option);
6565
BOOL is_super_user();
6666

6767
/*

0 commit comments

Comments
 (0)