MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:reggie Date:June 5 2006 6:37pm
Subject:bk commit into 5.0 tree (reggie:1.2170) BUG#18275
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2170 06/06/05 13:37:06 reggie@big_geek. +1 -0
  Bug #18275  	invalid file descriptor causes crash on windows
  

  mysys/my_init.c
    1.46 06/06/05 13:37:00 reggie@big_geek. +23 -1
    Added invalid parameter handler so that routines such as lseek would return -1 instead of ASSERT.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	reggie
# Host:	big_geek.
# Root:	D:/work/mysql/mysql-5.0

--- 1.45/mysys/my_init.c	2006-05-15 11:07:14 -05:00
+++ 1.46/mysys/my_init.c	2006-06-05 13:37:00 -05:00
@@ -245,6 +245,22 @@
   DBUG_VOID_RETURN ;
 }
 
+/*
+  my_paramter_handler
+  Invalid paramter handler we will use instead of the one "baked" into the CRT
+  for MSC v8.  This one just prints out what invalid parameter was encountered.
+  By providing this routine, routines like lseek will return -1 when we expect them 
+  to instead of crash.
+*/
+void my_parameter_handler(const wchar_t * expression, const wchar_t * function, 
+                          const wchar_t * file, unsigned int line, 
+                          uintptr_t pReserved)
+{
+  DBUG_PRINT("my",("Expression: %s  function: %s  file: %s, line: %d",
+		   expression, function, file, line));
+}
+
+
 static void my_win_init(void)
 {
   HKEY	hSoftMysql ;
@@ -262,12 +278,18 @@
 
   setlocale(LC_CTYPE, "");             /* To get right sortorder */
 
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#if defined(_MSC_VER)
+#if _MSC_VER < 1300
   /* 
     Clear the OS system variable TZ and avoid the 100% CPU usage
     Only for old versions of Visual C++
   */
   _putenv( "TZ=" ); 
+#endif 
+#if _MSC_VER >= 1400
+  /* this is required to make crt functions return -1 appropriately */
+  _set_invalid_parameter_handler(my_parameter_handler);
+#endif
 #endif  
   _tzset();
 

Thread
bk commit into 5.0 tree (reggie:1.2170) BUG#18275reggie5 Jun