summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com>2006-06-28 14:23:33 +0500
committerunknown <gluh@mysql.com>2006-06-28 14:23:33 +0500
commitb5f89708eb9b8ecc8fb74a37875b7880fd535fdc (patch)
treecea5fe7e7170a2ca68f254c0bcc61161d0d3b233 /mysys
parenta4c95a18b83a593a5dbc528179721062c7c8b4cd (diff)
parente832964174c43c6edb5603ab372223c964145a98 (diff)
downloadmariadb-git-b5f89708eb9b8ecc8fb74a37875b7880fd535fdc.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/gluh/MySQL/Merge/5.0-kt sql/set_var.cc: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_init.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 9b8d4db172f..8346fab95da 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -245,6 +245,22 @@ void setEnvString(char *ret, const char *name, const char *value)
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 @@ static void my_win_init(void)
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();