Commit bd917e08 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix clang-cl warnings

parent 9c9e0ac7
...@@ -1009,7 +1009,6 @@ static int fix_win_file_permissions(const char *file) ...@@ -1009,7 +1009,6 @@ static int fix_win_file_permissions(const char *file)
ACL* pOldDACL; ACL* pOldDACL;
SECURITY_DESCRIPTOR* pSD = NULL; SECURITY_DESCRIPTOR* pSD = NULL;
EXPLICIT_ACCESS ea = { 0 }; EXPLICIT_ACCESS ea = { 0 };
BOOL isWellKnownSID = FALSE;
PSID pSid = NULL; PSID pSid = NULL;
GetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, GetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL,
...@@ -1030,15 +1029,15 @@ static int fix_win_file_permissions(const char *file) ...@@ -1030,15 +1029,15 @@ static int fix_win_file_permissions(const char *file)
ea.Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN; ea.Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
ACL* pNewDACL = 0; ACL* pNewDACL = 0;
DWORD err = SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); DWORD err = SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL);
if (pNewDACL) if (!err)
{ {
DBUG_ASSERT(pNewDACL);
SetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, SetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL,
pNewDACL, NULL); pNewDACL, NULL);
LocalFree((HLOCAL)pNewDACL);
} }
if (pSD != NULL) if (pSD != NULL)
LocalFree((HLOCAL)pSD); LocalFree((HLOCAL)pSD);
if (pNewDACL != NULL)
LocalFree((HLOCAL)pNewDACL);
CloseHandle(hFile); CloseHandle(hFile);
return 0; return 0;
} }
......
...@@ -90,6 +90,7 @@ static int deinitialize_plugin(void *unused) ...@@ -90,6 +90,7 @@ static int deinitialize_plugin(void *unused)
return plugin_deinit(); return plugin_deinit();
} }
#ifdef PLUGIN_GSSAPI
/* system variable */ /* system variable */
static MYSQL_SYSVAR_STR(keytab_path, srv_keytab_path, static MYSQL_SYSVAR_STR(keytab_path, srv_keytab_path,
PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY,
...@@ -97,6 +98,8 @@ static MYSQL_SYSVAR_STR(keytab_path, srv_keytab_path, ...@@ -97,6 +98,8 @@ static MYSQL_SYSVAR_STR(keytab_path, srv_keytab_path,
NULL, NULL,
NULL, NULL,
""); "");
#endif
static MYSQL_SYSVAR_STR(principal_name, srv_principal_name, static MYSQL_SYSVAR_STR(principal_name, srv_principal_name,
PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY,
"GSSAPI target name - service principal name for Kerberos authentication.", "GSSAPI target name - service principal name for Kerberos authentication.",
......
...@@ -188,7 +188,7 @@ int main(int argc, char **argv) ...@@ -188,7 +188,7 @@ int main(int argc, char **argv)
die("--datadir option not provided, and default datadir not found"); die("--datadir option not provided, and default datadir not found");
my_print_help(my_long_options); my_print_help(my_long_options);
} }
strncat(default_datadir, "\\data", sizeof(default_datadir)); strncat_s(default_datadir, sizeof(default_datadir), "\\data", _TRUNCATE);
opt_datadir= default_datadir; opt_datadir= default_datadir;
printf("Default data directory is %s\n",opt_datadir); printf("Default data directory is %s\n",opt_datadir);
} }
......
...@@ -514,7 +514,7 @@ int main(int argc, char **argv) ...@@ -514,7 +514,7 @@ int main(int argc, char **argv)
} }
char pipe_name[64]; char pipe_name[64];
snprintf(pipe_name, sizeof(pipe_name), "\\\\.\\pipe\\mysql_upgrade_service_%u", snprintf(pipe_name, sizeof(pipe_name), "\\\\.\\pipe\\mysql_upgrade_service_%u",
GetCurrentProcessId()); (uint)GetCurrentProcessId());
for (;;) for (;;)
{ {
if (WaitForSingleObject(mysqld_process, 0) != WAIT_TIMEOUT) if (WaitForSingleObject(mysqld_process, 0) != WAIT_TIMEOUT)
......
...@@ -371,6 +371,7 @@ IF(MSVC) ...@@ -371,6 +371,7 @@ IF(MSVC)
# Temporarily disable "conversion from size_t .." # Temporarily disable "conversion from size_t .."
IF(CMAKE_SIZEOF_VOID_P EQUAL 8) IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267")
ENDIF() ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
......
...@@ -5588,6 +5588,9 @@ AIO::AIO( ...@@ -5588,6 +5588,9 @@ AIO::AIO(
ulint n, ulint n,
ulint segments) ulint segments)
: :
#ifdef WIN_ASYNC_IO
m_completion_port(new_completion_port()),
#endif
m_slots(n), m_slots(n),
m_n_segments(segments), m_n_segments(segments),
m_n_reserved() m_n_reserved()
...@@ -5595,9 +5598,6 @@ AIO::AIO( ...@@ -5595,9 +5598,6 @@ AIO::AIO(
,m_aio_ctx(), ,m_aio_ctx(),
m_events(m_slots.size()) m_events(m_slots.size())
# endif /* LINUX_NATIVE_AIO */ # endif /* LINUX_NATIVE_AIO */
#ifdef WIN_ASYNC_IO
,m_completion_port(new_completion_port())
#endif
{ {
ut_a(n > 0); ut_a(n > 0);
ut_a(m_n_segments > 0); ut_a(m_n_segments > 0);
......
...@@ -5709,6 +5709,7 @@ int spider_db_simple_action( ...@@ -5709,6 +5709,7 @@ int spider_db_simple_action(
#endif #endif
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);
error_num = 0;
break; break;
} }
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
......
...@@ -1865,7 +1865,7 @@ static enum json_types smart_read_value(json_engine_t *je, ...@@ -1865,7 +1865,7 @@ static enum json_types smart_read_value(json_engine_t *je,
*value_len= (int) ((char *) je->s.c_str - *value); *value_len= (int) ((char *) je->s.c_str - *value);
} }
return je->value_type; return (enum json_types)je->value_type;
err_return: err_return:
return JSV_BAD_JSON; return JSV_BAD_JSON;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment