diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-08-30 11:36:24 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-08-30 11:36:24 +0200 |
commit | ae325ec6ce3998b3dd38fc2ad7763857cd4c140f (patch) | |
tree | 957911b8185c51f0ad2caf43f2124552bca6db9f | |
parent | d99b8004e6b46e2a1b321bf50825254bf841cddb (diff) | |
download | mariadb-git-ae325ec6ce3998b3dd38fc2ad7763857cd4c140f.tar.gz |
Compile 10.0 on Windows
-rw-r--r-- | cmake/create_initial_db.cmake.in | 6 | ||||
-rw-r--r-- | include/my_valgrind.h | 2 | ||||
-rw-r--r-- | include/violite.h | 13 | ||||
-rw-r--r-- | scripts/comp_sql.c | 12 | ||||
-rw-r--r-- | sql/mysql_install_db.cc | 18 | ||||
-rw-r--r-- | sql/mysqld.cc | 12 | ||||
-rw-r--r-- | sql/sql_error.h | 8 | ||||
-rw-r--r-- | sql/threadpool_win.cc | 4 | ||||
-rw-r--r-- | vio/viopipe.c | 6 |
9 files changed, 40 insertions, 41 deletions
diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in index e37f41255e0..252fe712b58 100644 --- a/cmake/create_initial_db.cmake.in +++ b/cmake/create_initial_db.cmake.in @@ -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 ) diff --git a/include/my_valgrind.h b/include/my_valgrind.h index d32b1f78e15..49da89ab78c 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -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) diff --git a/include/violite.h b/include/violite.h index 661d07d5a3b..9d82bda67c3 100644 --- a/include/violite.h +++ b/include/violite.h @@ -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_ */ diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index f1b327b24ac..9e157ad14cc 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -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 ( ; ; ) diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc index bde81d915b2..4dc63d8a28d 100644 --- a/sql/mysql_install_db.cc +++ b/sql/mysql_install_db.cc @@ -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. */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f88b4047c17..aa31966256d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -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; diff --git a/sql/sql_error.h b/sql/sql_error.h index 79633ae5df8..f11ce6dcf0d 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -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. diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc index 6359f81cd2b..7bf4d98d16d 100644 --- a/sql/threadpool_win.cc +++ b/sql/threadpool_win.cc @@ -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; diff --git a/vio/viopipe.c b/vio/viopipe.c index db9881923ee..045ab8edfb8 100644 --- a/vio/viopipe.c +++ b/vio/viopipe.c @@ -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); |