[Commits] Rev 3435: Compile 10.0 on Windows in file:///H:/bzr/10.0-monty/

Vladislav Vaintroub wlad at montyprogram.com
Thu Aug 30 12:39:18 EEST 2012


At file:///H:/bzr/10.0-monty/

------------------------------------------------------------
revno: 3435
revision-id: wlad at montyprogram.com-20120830093624-5tyee5sqp99ajlx4
parent: holyfoot at askmonty.org-20120825155717-6ot5fleyej4ublum
committer: Vladislav Vaintroub <wlad at montyprogram.com>
branch nick: 10.0-monty
timestamp: Thu 2012-08-30 11:36:24 +0200
message:
  Compile 10.0 on Windows
-------------- next part --------------
=== modified file 'cmake/create_initial_db.cmake.in'
--- a/cmake/create_initial_db.cmake.in	2011-06-30 15:46:53 +0000
+++ b/cmake/create_initial_db.cmake.in	2012-08-30 09:36:24 +0000
@@ -39,8 +39,8 @@
     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 @@
   --basedir=.
   --datadir=.
   --default-storage-engine=MyISAM
-  --loose-skip-innodb
-  --loose-skip-ndbcluster
   --max_allowed_packet=8M
   --net_buffer_length=16K
 )

=== modified file 'include/my_valgrind.h'
--- a/include/my_valgrind.h	2012-08-17 13:46:34 +0000
+++ b/include/my_valgrind.h	2012-08-30 09:36:24 +0000
@@ -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)

=== modified file 'include/violite.h'
--- a/include/violite.h	2012-08-17 13:46:34 +0000
+++ b/include/violite.h	2012-08-30 09:36:24 +0000
@@ -263,11 +263,6 @@
   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 @@
   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_ */

=== modified file 'scripts/comp_sql.c'
--- a/scripts/comp_sql.c	2012-08-01 14:27:34 +0000
+++ b/scripts/comp_sql.c	2012-08-30 09:36:24 +0000
@@ -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 @@
   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 @@
       fprintf(out, "\\\"");
       column++;
       break;
+    case '\\':
+      fprintf(out, "\\\\");
+      break;
     default:
       putc(*ptr, out);
       column++;
@@ -135,6 +130,7 @@
   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 ( ; ; )

=== modified file 'sql/mysql_install_db.cc'
--- a/sql/mysql_install_db.cc	2012-06-18 21:29:05 +0000
+++ b/sql/mysql_install_db.cc	2012-08-30 09:36:24 +0000
@@ -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 @@
     "\"\"%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 @@
     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. */

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-08-14 14:23:34 +0000
+++ b/sql/mysqld.cc	2012-08-30 09:36:24 +0000
@@ -5582,11 +5582,8 @@
     fds[socket_count].events= POLLIN;   \
     socket_count++
 #else
+#define setup_fds(X)    FD_SET(mysql_socket_getfd(X),&clientFDs)
   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_ZERO(&clientFDs);
 #endif
 
@@ -5615,8 +5612,7 @@
     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 @@
       }
     }
 #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;

=== modified file 'sql/sql_error.h'
--- a/sql/sql_error.h	2012-08-01 14:27:34 +0000
+++ b/sql/sql_error.h	2012-08-30 09:36:24 +0000
@@ -193,6 +193,10 @@
   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 @@
   */
   MYSQL_ERROR(MEM_ROOT *mem_root);
 
-  /** Destructor. */
-  ~MYSQL_ERROR()
-  {}
+
 
   /**
     Copy optional condition items attributes.

=== modified file 'sql/threadpool_win.cc'
--- a/sql/threadpool_win.cc	2012-05-03 00:47:06 +0000
+++ b/sql/threadpool_win.cc	2012-08-30 09:36:24 +0000
@@ -255,7 +255,7 @@
   {
     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 @@
   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;

=== modified file 'vio/viopipe.c'
--- a/vio/viopipe.c	2012-08-14 14:23:34 +0000
+++ b/vio/viopipe.c	2012-08-30 09:36:24 +0000
@@ -48,7 +48,7 @@
   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 @@
   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 @@
   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);



More information about the commits mailing list