mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Compile 10.0 on Windows
This commit is contained in:
@ -39,8 +39,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
|
#FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
|
||||||
FILE(APPEND bootstrap.sql ${CONTENTS})
|
#FILE(APPEND bootstrap.sql ${CONTENTS})
|
||||||
|
|
||||||
|
|
||||||
FILE(REMOVE_RECURSE mysql)
|
FILE(REMOVE_RECURSE mysql)
|
||||||
@ -58,8 +58,6 @@ SET(BOOTSTRAP_COMMAND
|
|||||||
--basedir=.
|
--basedir=.
|
||||||
--datadir=.
|
--datadir=.
|
||||||
--default-storage-engine=MyISAM
|
--default-storage-engine=MyISAM
|
||||||
--loose-skip-innodb
|
|
||||||
--loose-skip-ndbcluster
|
|
||||||
--max_allowed_packet=8M
|
--max_allowed_packet=8M
|
||||||
--net_buffer_length=16K
|
--net_buffer_length=16K
|
||||||
)
|
)
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B) ; bfill(A, trash_tmp, C); MEM_UNDEFINED(A, trash_tmp); } while (0)
|
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B) ; bfill(A, trash_tmp, C); MEM_UNDEFINED(A, trash_tmp); } while (0)
|
||||||
#else
|
#else
|
||||||
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
|
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute__((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
|
||||||
#endif
|
#endif
|
||||||
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
|
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
|
||||||
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
|
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
|
||||||
|
@ -263,11 +263,6 @@ struct st_vio
|
|||||||
my_bool (*has_data) (Vio*);
|
my_bool (*has_data) (Vio*);
|
||||||
int (*io_wait)(Vio*, enum enum_vio_io_event, int);
|
int (*io_wait)(Vio*, enum enum_vio_io_event, int);
|
||||||
my_bool (*connect)(Vio*, struct sockaddr *, socklen_t, int);
|
my_bool (*connect)(Vio*, struct sockaddr *, socklen_t, int);
|
||||||
#ifdef _WIN32
|
|
||||||
HANDLE hPipe;
|
|
||||||
DWORD thread_id; /* Used on XP only by vio_shutdown() */
|
|
||||||
OVERLAPPED overlapped;
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
void *ssl_arg;
|
void *ssl_arg;
|
||||||
#endif
|
#endif
|
||||||
@ -282,5 +277,13 @@ struct st_vio
|
|||||||
size_t shared_memory_remain;
|
size_t shared_memory_remain;
|
||||||
char *shared_memory_pos;
|
char *shared_memory_pos;
|
||||||
#endif /* HAVE_SMEM */
|
#endif /* HAVE_SMEM */
|
||||||
|
#ifdef _WIN32
|
||||||
|
HANDLE hPipe;
|
||||||
|
OVERLAPPED overlapped;
|
||||||
|
DWORD thread_id; /* Used on XP only by vio_shutdown() */
|
||||||
|
OVERLAPPED pipe_overlapped;
|
||||||
|
DWORD read_timeout_ms;
|
||||||
|
DWORD write_timeout_ms;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif /* vio_violite_h_ */
|
#endif /* vio_violite_h_ */
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../sql/sql_bootstrap.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is an internal tool used during the build process only,
|
This is an internal tool used during the build process only,
|
||||||
- do not make a library just for this,
|
- do not make a library just for this,
|
||||||
@ -80,12 +78,6 @@ static void print_query(FILE *out, const char *query)
|
|||||||
fprintf(out, "\"");
|
fprintf(out, "\"");
|
||||||
while (*ptr)
|
while (*ptr)
|
||||||
{
|
{
|
||||||
if (column >= 120)
|
|
||||||
{
|
|
||||||
/* Wrap to the next line, tabulated. */
|
|
||||||
fprintf(out, "\"\n \"");
|
|
||||||
column= 2;
|
|
||||||
}
|
|
||||||
switch(*ptr)
|
switch(*ptr)
|
||||||
{
|
{
|
||||||
case '\n':
|
case '\n':
|
||||||
@ -103,6 +95,9 @@ static void print_query(FILE *out, const char *query)
|
|||||||
fprintf(out, "\\\"");
|
fprintf(out, "\\\"");
|
||||||
column++;
|
column++;
|
||||||
break;
|
break;
|
||||||
|
case '\\':
|
||||||
|
fprintf(out, "\\\\");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
putc(*ptr, out);
|
putc(*ptr, out);
|
||||||
column++;
|
column++;
|
||||||
@ -135,6 +130,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(out, " Do not edit this file, it is automatically generated from:\n");
|
fprintf(out, " Do not edit this file, it is automatically generated from:\n");
|
||||||
fprintf(out, " <%s>\n", infile_name);
|
fprintf(out, " <%s>\n", infile_name);
|
||||||
fprintf(out, "*/\n");
|
fprintf(out, "*/\n");
|
||||||
|
fprintf(out, "#include <stdlib.h>\n"); /* NULL */
|
||||||
fprintf(out, "const char* %s[]={\n", struct_name);
|
fprintf(out, "const char* %s[]={\n", struct_name);
|
||||||
|
|
||||||
for ( ; ; )
|
for ( ; ; )
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"Usage: mysql_install_db.exe [OPTIONS]\n" \
|
"Usage: mysql_install_db.exe [OPTIONS]\n" \
|
||||||
"OPTIONS:"
|
"OPTIONS:"
|
||||||
|
|
||||||
extern "C" const char mysql_bootstrap_sql[];
|
extern "C" const char* mysql_bootstrap_sql[];
|
||||||
|
|
||||||
char default_os_user[]= "NT AUTHORITY\\NetworkService";
|
char default_os_user[]= "NT AUTHORITY\\NetworkService";
|
||||||
static int create_db_instance();
|
static int create_db_instance();
|
||||||
@ -247,7 +247,7 @@ static char *init_bootstrap_command_line(char *cmdline, size_t size)
|
|||||||
"\"\"%s\" --no-defaults --bootstrap"
|
"\"\"%s\" --no-defaults --bootstrap"
|
||||||
" \"--language=%s\\share\\english\""
|
" \"--language=%s\\share\\english\""
|
||||||
" --basedir=. --datadir=. --default-storage-engine=myisam"
|
" --basedir=. --datadir=. --default-storage-engine=myisam"
|
||||||
" --max_allowed_packet=9M --loose-skip-innodb --loose-skip-pbxt"
|
" --max_allowed_packet=9M "
|
||||||
" --net-buffer-length=16k\"", mysqld_path, basedir);
|
" --net-buffer-length=16k\"", mysqld_path, basedir);
|
||||||
return cmdline;
|
return cmdline;
|
||||||
}
|
}
|
||||||
@ -565,12 +565,16 @@ static int create_db_instance()
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the bootstrap script to stdin. */
|
int i;
|
||||||
if (fwrite(mysql_bootstrap_sql, strlen(mysql_bootstrap_sql), 1, in) != 1)
|
for (i=0; mysql_bootstrap_sql[i]; i++)
|
||||||
{
|
{
|
||||||
verbose("ERROR: Cannot write to mysqld's stdin");
|
/* Write the bootstrap script to stdin. */
|
||||||
ret= 1;
|
if (fwrite(mysql_bootstrap_sql, strlen(mysql_bootstrap_sql[i]), 1, in) != 1)
|
||||||
goto end;
|
{
|
||||||
|
verbose("ERROR: Cannot write to mysqld's stdin");
|
||||||
|
ret= 1;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove default user, if requested. */
|
/* Remove default user, if requested. */
|
||||||
|
@ -5582,11 +5582,8 @@ void handle_connections_sockets()
|
|||||||
fds[socket_count].events= POLLIN; \
|
fds[socket_count].events= POLLIN; \
|
||||||
socket_count++
|
socket_count++
|
||||||
#else
|
#else
|
||||||
fd_set readFDs,clientFDs;
|
|
||||||
uint max_used_connection= (uint)
|
|
||||||
max(max(mysql_socket_getfd(base_ip_sock), mysql_socket_getfd(unix_sock)),
|
|
||||||
mysqld_socket_getfd(extra_ip_sock)) + 1;
|
|
||||||
#define setup_fds(X) FD_SET(mysql_socket_getfd(X),&clientFDs)
|
#define setup_fds(X) FD_SET(mysql_socket_getfd(X),&clientFDs)
|
||||||
|
fd_set readFDs,clientFDs;
|
||||||
FD_ZERO(&clientFDs);
|
FD_ZERO(&clientFDs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5615,8 +5612,7 @@ void handle_connections_sockets()
|
|||||||
retval= poll(fds, socket_count, -1);
|
retval= poll(fds, socket_count, -1);
|
||||||
#else
|
#else
|
||||||
readFDs=clientFDs;
|
readFDs=clientFDs;
|
||||||
|
retval= select((int) 0,&readFDs,0,0,0);
|
||||||
retval= select((int) max_used_connection,&readFDs,0,0,0);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
@ -5648,13 +5644,13 @@ void handle_connections_sockets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else // HAVE_POLL
|
#else // HAVE_POLL
|
||||||
if (FD_ISSET(base_ip_sock,&readFDs))
|
if (FD_ISSET(mysql_socket_getfd(base_ip_sock),&readFDs))
|
||||||
{
|
{
|
||||||
sock= base_ip_sock;
|
sock= base_ip_sock;
|
||||||
flags= ip_flags;
|
flags= ip_flags;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (FD_ISSET(extra_ip_sock,&readFDs))
|
if (FD_ISSET(mysql_socket_getfd(extra_ip_sock),&readFDs))
|
||||||
{
|
{
|
||||||
sock= extra_ip_sock;
|
sock= extra_ip_sock;
|
||||||
flags= extra_ip_flags;
|
flags= extra_ip_flags;
|
||||||
|
@ -193,6 +193,10 @@ public:
|
|||||||
MYSQL_ERROR::enum_warning_level get_level() const
|
MYSQL_ERROR::enum_warning_level get_level() const
|
||||||
{ return m_level; }
|
{ return m_level; }
|
||||||
|
|
||||||
|
/** Destructor. */
|
||||||
|
~MYSQL_ERROR()
|
||||||
|
{}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*
|
/*
|
||||||
The interface of MYSQL_ERROR is mostly private, by design,
|
The interface of MYSQL_ERROR is mostly private, by design,
|
||||||
@ -234,9 +238,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
MYSQL_ERROR(MEM_ROOT *mem_root);
|
MYSQL_ERROR(MEM_ROOT *mem_root);
|
||||||
|
|
||||||
/** Destructor. */
|
|
||||||
~MYSQL_ERROR()
|
|
||||||
{}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copy optional condition items attributes.
|
Copy optional condition items attributes.
|
||||||
|
@ -255,7 +255,7 @@ int init_io(connection_t *connection, THD *thd)
|
|||||||
{
|
{
|
||||||
case VIO_TYPE_SSL:
|
case VIO_TYPE_SSL:
|
||||||
case VIO_TYPE_TCPIP:
|
case VIO_TYPE_TCPIP:
|
||||||
connection->handle= (HANDLE)vio->sd;
|
connection->handle= (HANDLE)mysql_socket_getfd(connection->thd->net.vio->mysql_socket);
|
||||||
break;
|
break;
|
||||||
case VIO_TYPE_NAMEDPIPE:
|
case VIO_TYPE_NAMEDPIPE:
|
||||||
connection->handle= (HANDLE)vio->hPipe;
|
connection->handle= (HANDLE)vio->hPipe;
|
||||||
@ -342,7 +342,7 @@ int start_io(connection_t *connection, PTP_CALLBACK_INSTANCE instance)
|
|||||||
if (vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SSL)
|
if (vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SSL)
|
||||||
{
|
{
|
||||||
/* Start async io (sockets). */
|
/* Start async io (sockets). */
|
||||||
if (WSARecv(vio->sd , &buf, 1, &num_bytes, &flags,
|
if (WSARecv(mysql_socket_getfd(vio->mysql_socket) , &buf, 1, &num_bytes, &flags,
|
||||||
overlapped, NULL) == 0)
|
overlapped, NULL) == 0)
|
||||||
{
|
{
|
||||||
retval= last_error= 0;
|
retval= last_error= 0;
|
||||||
|
@ -48,7 +48,7 @@ static size_t wait_overlapped_result(Vio *vio, int timeout)
|
|||||||
timeout_ms= timeout >= 0 ? timeout : INFINITE;
|
timeout_ms= timeout >= 0 ? timeout : INFINITE;
|
||||||
|
|
||||||
/* Wait for the overlapped operation to be completed. */
|
/* Wait for the overlapped operation to be completed. */
|
||||||
ret= WaitForSingleObjectEx(vio->pipe_overlapped.hEvent, timeout_ms, TRUE);
|
wait_status= WaitForSingleObjectEx(vio->pipe_overlapped.hEvent, timeout_ms, TRUE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
WaitForSingleObjects will normally return WAIT_OBJECT_O (success,
|
WaitForSingleObjects will normally return WAIT_OBJECT_O (success,
|
||||||
@ -78,7 +78,7 @@ size_t vio_read_pipe(Vio *vio, uchar *buf, size_t count)
|
|||||||
DWORD transferred;
|
DWORD transferred;
|
||||||
size_t ret= (size_t) -1;
|
size_t ret= (size_t) -1;
|
||||||
DBUG_ENTER("vio_read_pipe");
|
DBUG_ENTER("vio_read_pipe");
|
||||||
DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf,
|
DBUG_PRINT("enter", ("sd: %p buf: %p size: %d", vio->hPipe, buf,
|
||||||
(int) count));
|
(int) count));
|
||||||
|
|
||||||
disable_iocp_notification(&vio->overlapped);
|
disable_iocp_notification(&vio->overlapped);
|
||||||
@ -111,7 +111,7 @@ size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count)
|
|||||||
DWORD transferred;
|
DWORD transferred;
|
||||||
size_t ret= (size_t) -1;
|
size_t ret= (size_t) -1;
|
||||||
DBUG_ENTER("vio_write_pipe");
|
DBUG_ENTER("vio_write_pipe");
|
||||||
DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf,
|
DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->hPipe, buf,
|
||||||
(int) count));
|
(int) count));
|
||||||
|
|
||||||
disable_iocp_notification(&vio->pipe_overlapped);
|
disable_iocp_notification(&vio->pipe_overlapped);
|
||||||
|
Reference in New Issue
Block a user