mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed some simple warnings on Windows.
This commit is contained in:
@@ -38,10 +38,10 @@ int func1()
|
|||||||
|
|
||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
#ifdef DBUG_OFF
|
#ifdef DBUG_OFF
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#else
|
||||||
|
int i;
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -83,4 +83,5 @@ int main (int argc, char *argv[])
|
|||||||
DBUG_SET(""); /* to not have my_end() in the traces */
|
DBUG_SET(""); /* to not have my_end() in the traces */
|
||||||
my_end(0);
|
my_end(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif /* DBUG_OFF */
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,7 @@ static struct my_option my_long_options[] =
|
|||||||
{"defaults-extra-file", 'e',
|
{"defaults-extra-file", 'e',
|
||||||
"Read this file after the global config file and before the config "
|
"Read this file after the global config file and before the config "
|
||||||
"file in the users home directory; should be the first option",
|
"file in the users home directory; should be the first option",
|
||||||
&my_defaults_extra_file, &my_defaults_extra_file, 0,
|
(void *)&my_defaults_extra_file, (void *)&my_defaults_extra_file, 0,
|
||||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"defaults-group-suffix", 'g',
|
{"defaults-group-suffix", 'g',
|
||||||
"In addition to the given groups, read also groups with this suffix",
|
"In addition to the given groups, read also groups with this suffix",
|
||||||
@@ -75,8 +75,8 @@ static struct my_option my_long_options[] =
|
|||||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"extra-file", 'e',
|
{"extra-file", 'e',
|
||||||
"Deprecated. Synonym for --defaults-extra-file.",
|
"Deprecated. Synonym for --defaults-extra-file.",
|
||||||
&my_defaults_extra_file,
|
(void *)&my_defaults_extra_file,
|
||||||
&my_defaults_extra_file, 0, GET_STR,
|
(void *)&my_defaults_extra_file, 0, GET_STR,
|
||||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
|
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@@ -2969,10 +2969,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||||||
const char *scramble_plugin;
|
const char *scramble_plugin;
|
||||||
ulong pkt_length;
|
ulong pkt_length;
|
||||||
NET *net= &mysql->net;
|
NET *net= &mysql->net;
|
||||||
#ifdef MYSQL_SERVER
|
|
||||||
thr_alarm_t alarmed;
|
|
||||||
ALARM alarm_buff;
|
|
||||||
#endif
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
||||||
#endif
|
#endif
|
||||||
@@ -3181,17 +3177,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||||||
|
|
||||||
my_snprintf(host_info=buff, sizeof(buff)-1, ER(CR_TCP_CONNECTION), host);
|
my_snprintf(host_info=buff, sizeof(buff)-1, ER(CR_TCP_CONNECTION), host);
|
||||||
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host, port));
|
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host, port));
|
||||||
#ifdef MYSQL_SERVER
|
|
||||||
thr_alarm_init(&alarmed);
|
|
||||||
thr_alarm(&alarmed, mysql->options.connect_timeout, &alarm_buff);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DBUG_PRINT("info",("IP '%s'", "client"));
|
DBUG_PRINT("info",("IP '%s'", "client"));
|
||||||
|
|
||||||
#ifdef MYSQL_SERVER
|
|
||||||
thr_end_alarm(&alarmed);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_socktype= SOCK_STREAM;
|
hints.ai_socktype= SOCK_STREAM;
|
||||||
hints.ai_protocol= IPPROTO_TCP;
|
hints.ai_protocol= IPPROTO_TCP;
|
||||||
|
@@ -150,7 +150,7 @@ public:
|
|||||||
void count_only_length();
|
void count_only_length();
|
||||||
void count_real_length();
|
void count_real_length();
|
||||||
void count_decimal_length();
|
void count_decimal_length();
|
||||||
inline bool get_arg0_date(MYSQL_TIME *ltime, uint fuzzy_date)
|
inline bool get_arg0_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
|
||||||
{
|
{
|
||||||
return (null_value=args[0]->get_date(ltime, fuzzy_date));
|
return (null_value=args[0]->get_date(ltime, fuzzy_date));
|
||||||
}
|
}
|
||||||
|
@@ -2220,8 +2220,8 @@ static void network_init(void)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_SYS_UN_H
|
#ifdef HAVE_SYS_UN_H
|
||||||
struct sockaddr_un UNIXaddr;
|
struct sockaddr_un UNIXaddr;
|
||||||
#endif
|
|
||||||
int arg;
|
int arg;
|
||||||
|
#endif
|
||||||
DBUG_ENTER("network_init");
|
DBUG_ENTER("network_init");
|
||||||
|
|
||||||
if (MYSQL_CALLBACK_ELSE(thread_scheduler, init, (), 0))
|
if (MYSQL_CALLBACK_ELSE(thread_scheduler, init, (), 0))
|
||||||
|
@@ -167,7 +167,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||||||
"where mysqld died. If you see no messages after this, something went\n"
|
"where mysqld died. If you see no messages after this, something went\n"
|
||||||
"terribly wrong...\n");
|
"terribly wrong...\n");
|
||||||
my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL,
|
my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL,
|
||||||
my_thread_stack_size);
|
(ulong)my_thread_stack_size);
|
||||||
}
|
}
|
||||||
if (thd)
|
if (thd)
|
||||||
{
|
{
|
||||||
|
@@ -4155,8 +4155,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
|
|||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0;
|
||||||
String error_msg;
|
String error_msg;
|
||||||
ulong inc_pos;
|
ulonglong inc_pos;
|
||||||
ulong event_pos;
|
ulonglong event_pos;
|
||||||
Relay_log_info *rli= &mi->rli;
|
Relay_log_info *rli= &mi->rli;
|
||||||
mysql_mutex_t *log_lock= rli->relay_log.get_log_lock();
|
mysql_mutex_t *log_lock= rli->relay_log.get_log_lock();
|
||||||
ulong s_id;
|
ulong s_id;
|
||||||
|
@@ -618,8 +618,8 @@ Open streams: %10lu\n",
|
|||||||
(ulong) my_file_opened,
|
(ulong) my_file_opened,
|
||||||
(ulong) my_stream_opened);
|
(ulong) my_stream_opened);
|
||||||
|
|
||||||
ALARM_INFO alarm_info;
|
|
||||||
#ifndef DONT_USE_THR_ALARM
|
#ifndef DONT_USE_THR_ALARM
|
||||||
|
ALARM_INFO alarm_info;
|
||||||
thr_alarm_info(&alarm_info);
|
thr_alarm_info(&alarm_info);
|
||||||
printf("\nAlarm status:\n\
|
printf("\nAlarm status:\n\
|
||||||
Active alarms: %u\n\
|
Active alarms: %u\n\
|
||||||
|
@@ -214,6 +214,15 @@ IF (MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|||||||
PROPERTIES COMPILE_FLAGS -Od)
|
PROPERTIES COMPILE_FLAGS -Od)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
# Avoid "unreferenced label" warning in generated file
|
||||||
|
GET_FILENAME_COMPONENT(_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/pars0grm.c
|
||||||
|
PROPERTIES COMPILE_FLAGS "/wd4102")
|
||||||
|
SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/lexyy.c
|
||||||
|
PROPERTIES COMPILE_FLAGS "/wd4003")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
|
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
|
||||||
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
|
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
|
||||||
data/data0data.c data/data0type.c
|
data/data0data.c data/data0type.c
|
||||||
|
@@ -23,7 +23,9 @@
|
|||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
#include <tap.h>
|
#include <tap.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <direct.h> /* rmdir */
|
||||||
|
#endif
|
||||||
#ifndef WITH_ARIA_STORAGE_ENGINE
|
#ifndef WITH_ARIA_STORAGE_ENGINE
|
||||||
/*
|
/*
|
||||||
If Aria is not compiled in, normally we don't come to building this test.
|
If Aria is not compiled in, normally we don't come to building this test.
|
||||||
|
@@ -289,7 +289,7 @@ int main(int argc __attribute__((unused)),
|
|||||||
fprintf(stderr, "End of memory\n");
|
fprintf(stderr, "End of memory\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
for (i= 0; i < (LONG_BUFFER_SIZE + 7 * 2 + 2); i++)
|
for (i= 0; i < (uint32)(LONG_BUFFER_SIZE + 7 * 2 + 2); i++)
|
||||||
long_buffer[i]= (i & 0xFF);
|
long_buffer[i]= (i & 0xFF);
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
|
@@ -823,16 +823,14 @@ const char *sanitize_table_schema_name(const char *unsafe)
|
|||||||
intptr first= (intptr) &table_share_array[0];
|
intptr first= (intptr) &table_share_array[0];
|
||||||
intptr last= (intptr) &table_share_array[table_share_max];
|
intptr last= (intptr) &table_share_array[table_share_max];
|
||||||
|
|
||||||
PFS_table_share dummy;
|
|
||||||
|
|
||||||
/* Check if unsafe points inside table_share_array[] */
|
/* Check if unsafe points inside table_share_array[] */
|
||||||
if (likely((first <= ptr) && (ptr < last)))
|
if (likely((first <= ptr) && (ptr < last)))
|
||||||
{
|
{
|
||||||
intptr offset= (ptr - first) % sizeof(PFS_table_share);
|
intptr offset= (ptr - first) % sizeof(PFS_table_share);
|
||||||
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
|
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
|
||||||
intptr len= sizeof(dummy.m_key.m_hash_key);
|
|
||||||
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
|
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
|
||||||
if (likely((from <= offset) && (offset < from + len)))
|
if (likely((from <= offset) && (offset < from + PFS_TABLESHARE_HASHKEY_SIZE)))
|
||||||
{
|
{
|
||||||
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
|
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
|
||||||
/* Check if unsafe really is the schema name */
|
/* Check if unsafe really is the schema name */
|
||||||
@@ -849,16 +847,14 @@ const char *sanitize_table_object_name(const char *unsafe)
|
|||||||
intptr first= (intptr) &table_share_array[0];
|
intptr first= (intptr) &table_share_array[0];
|
||||||
intptr last= (intptr) &table_share_array[table_share_max];
|
intptr last= (intptr) &table_share_array[table_share_max];
|
||||||
|
|
||||||
PFS_table_share dummy;
|
|
||||||
|
|
||||||
/* Check if unsafe points inside table_share_array[] */
|
/* Check if unsafe points inside table_share_array[] */
|
||||||
if (likely((first <= ptr) && (ptr < last)))
|
if (likely((first <= ptr) && (ptr < last)))
|
||||||
{
|
{
|
||||||
intptr offset= (ptr - first) % sizeof(PFS_table_share);
|
intptr offset= (ptr - first) % sizeof(PFS_table_share);
|
||||||
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
|
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
|
||||||
intptr len= sizeof(dummy.m_key.m_hash_key);
|
|
||||||
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
|
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
|
||||||
if (likely((from <= offset) && (offset < from + len)))
|
if (likely((from <= offset) && (offset < from + PFS_TABLESHARE_HASHKEY_SIZE)))
|
||||||
{
|
{
|
||||||
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
|
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
|
||||||
/* Check if unsafe really is the table name */
|
/* Check if unsafe really is the table name */
|
||||||
|
@@ -128,6 +128,8 @@ struct PFS_thread_class
|
|||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define PFS_TABLESHARE_HASHKEY_SIZE (NAME_LEN + 1 + NAME_LEN + 1)
|
||||||
|
|
||||||
/** Key identifying a table share. */
|
/** Key identifying a table share. */
|
||||||
struct PFS_table_share_key
|
struct PFS_table_share_key
|
||||||
{
|
{
|
||||||
@@ -137,7 +139,7 @@ struct PFS_table_share_key
|
|||||||
the format is "<schema_name><0x00><object_name><0x00>"
|
the format is "<schema_name><0x00><object_name><0x00>"
|
||||||
@see create_table_def_key
|
@see create_table_def_key
|
||||||
*/
|
*/
|
||||||
char m_hash_key[NAME_LEN + 1 + NAME_LEN + 1];
|
char m_hash_key[PFS_TABLESHARE_HASHKEY_SIZE];
|
||||||
/** Length in bytes of @c m_hash_key. */
|
/** Length in bytes of @c m_hash_key. */
|
||||||
uint m_key_length;
|
uint m_key_length;
|
||||||
};
|
};
|
||||||
|
@@ -50,7 +50,6 @@
|
|||||||
#else
|
#else
|
||||||
// Windows-specific
|
// Windows-specific
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#define strcasecmp stricmp
|
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|
||||||
#define RECV_FLAGS 0
|
#define RECV_FLAGS 0
|
||||||
|
Reference in New Issue
Block a user