Commit ae325ec6 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Compile 10.0 on Windows

parent d99b8004
......@@ -39,8 +39,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql)
ENDIF()
ENDFOREACH()
ENDFOREACH()
FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
FILE(APPEND bootstrap.sql ${CONTENTS})
#FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
#FILE(APPEND bootstrap.sql ${CONTENTS})
FILE(REMOVE_RECURSE mysql)
......@@ -58,8 +58,6 @@ SET(BOOTSTRAP_COMMAND
--basedir=.
--datadir=.
--default-storage-engine=MyISAM
--loose-skip-innodb
--loose-skip-ndbcluster
--max_allowed_packet=8M
--net_buffer_length=16K
)
......
......@@ -39,7 +39,7 @@
#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)
#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
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
......
......@@ -263,11 +263,6 @@ struct st_vio
my_bool (*has_data) (Vio*);
int (*io_wait)(Vio*, enum enum_vio_io_event, 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
void *ssl_arg;
#endif
......@@ -282,5 +277,13 @@ struct st_vio
size_t shared_memory_remain;
char *shared_memory_pos;
#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_ */
......@@ -27,8 +27,6 @@
#include <stdlib.h>
#include <stdio.h>
#include "../sql/sql_bootstrap.h"
/*
This is an internal tool used during the build process only,
- do not make a library just for this,
......@@ -80,12 +78,6 @@ static void print_query(FILE *out, const char *query)
fprintf(out, "\"");
while (*ptr)
{
if (column >= 120)
{
/* Wrap to the next line, tabulated. */
fprintf(out, "\"\n \"");
column= 2;
}
switch(*ptr)
{
case '\n':
......@@ -103,6 +95,9 @@ static void print_query(FILE *out, const char *query)
fprintf(out, "\\\"");
column++;
break;
case '\\':
fprintf(out, "\\\\");
break;
default:
putc(*ptr, out);
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, " <%s>\n", infile_name);
fprintf(out, "*/\n");
fprintf(out, "#include <stdlib.h>\n"); /* NULL */
fprintf(out, "const char* %s[]={\n", struct_name);
for ( ; ; )
......
......@@ -37,7 +37,7 @@
"Usage: mysql_install_db.exe [OPTIONS]\n" \
"OPTIONS:"
extern "C" const char mysql_bootstrap_sql[];
extern "C" const char* mysql_bootstrap_sql[];
char default_os_user[]= "NT AUTHORITY\\NetworkService";
static int create_db_instance();
......@@ -247,7 +247,7 @@ static char *init_bootstrap_command_line(char *cmdline, size_t size)
"\"\"%s\" --no-defaults --bootstrap"
" \"--language=%s\\share\\english\""
" --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);
return cmdline;
}
......@@ -565,12 +565,16 @@ static int create_db_instance()
goto end;
}
/* Write the bootstrap script to stdin. */
if (fwrite(mysql_bootstrap_sql, strlen(mysql_bootstrap_sql), 1, in) != 1)
int i;
for (i=0; mysql_bootstrap_sql[i]; i++)
{
verbose("ERROR: Cannot write to mysqld's stdin");
ret= 1;
goto end;
/* Write the bootstrap script to stdin. */
if (fwrite(mysql_bootstrap_sql, strlen(mysql_bootstrap_sql[i]), 1, in) != 1)
{
verbose("ERROR: Cannot write to mysqld's stdin");
ret= 1;
goto end;
}
}
/* Remove default user, if requested. */
......
......@@ -5582,11 +5582,8 @@ void handle_connections_sockets()
fds[socket_count].events= POLLIN; \
socket_count++
#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)
fd_set readFDs,clientFDs;
FD_ZERO(&clientFDs);
#endif
......@@ -5615,8 +5612,7 @@ void handle_connections_sockets()
retval= poll(fds, socket_count, -1);
#else
readFDs=clientFDs;
retval= select((int) max_used_connection,&readFDs,0,0,0);
retval= select((int) 0,&readFDs,0,0,0);
#endif
if (retval < 0)
......@@ -5648,13 +5644,13 @@ void handle_connections_sockets()
}
}
#else // HAVE_POLL
if (FD_ISSET(base_ip_sock,&readFDs))
if (FD_ISSET(mysql_socket_getfd(base_ip_sock),&readFDs))
{
sock= base_ip_sock;
flags= ip_flags;
}
else
if (FD_ISSET(extra_ip_sock,&readFDs))
if (FD_ISSET(mysql_socket_getfd(extra_ip_sock),&readFDs))
{
sock= extra_ip_sock;
flags= extra_ip_flags;
......
......@@ -193,6 +193,10 @@ public:
MYSQL_ERROR::enum_warning_level get_level() const
{ return m_level; }
/** Destructor. */
~MYSQL_ERROR()
{}
private:
/*
The interface of MYSQL_ERROR is mostly private, by design,
......@@ -234,9 +238,7 @@ private:
*/
MYSQL_ERROR(MEM_ROOT *mem_root);
/** Destructor. */
~MYSQL_ERROR()
{}
/**
Copy optional condition items attributes.
......
......@@ -255,7 +255,7 @@ int init_io(connection_t *connection, THD *thd)
{
case VIO_TYPE_SSL:
case VIO_TYPE_TCPIP:
connection->handle= (HANDLE)vio->sd;
connection->handle= (HANDLE)mysql_socket_getfd(connection->thd->net.vio->mysql_socket);
break;
case VIO_TYPE_NAMEDPIPE:
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)
{
/* 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)
{
retval= last_error= 0;
......
......@@ -48,7 +48,7 @@ static size_t wait_overlapped_result(Vio *vio, int timeout)
timeout_ms= timeout >= 0 ? timeout : INFINITE;
/* 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,
......@@ -78,7 +78,7 @@ size_t vio_read_pipe(Vio *vio, uchar *buf, size_t count)
DWORD transferred;
size_t ret= (size_t) -1;
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));
disable_iocp_notification(&vio->overlapped);
......@@ -111,7 +111,7 @@ size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count)
DWORD transferred;
size_t ret= (size_t) -1;
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));
disable_iocp_notification(&vio->pipe_overlapped);
......
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