summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innodb_plugin/include/ut0dbg.h34
-rw-r--r--storage/xtradb/include/ut0dbg.h34
-rw-r--r--win/packaging/ca/CustomAction.cpp13
3 files changed, 33 insertions, 48 deletions
diff --git a/storage/innodb_plugin/include/ut0dbg.h b/storage/innodb_plugin/include/ut0dbg.h
index 78b525c38ab..26950671c70 100644
--- a/storage/innodb_plugin/include/ut0dbg.h
+++ b/storage/innodb_plugin/include/ut0dbg.h
@@ -54,27 +54,14 @@ ut_dbg_assertion_failed(
const char* file, /*!< in: source file containing the assertion */
ulint line); /*!< in: line number of the assertion */
-#ifdef __NETWARE__
-/** Flag for ignoring further assertion failures. This is set to TRUE
-when on NetWare there happens an InnoDB assertion failure or other
-fatal error condition that requires an immediate shutdown. */
-extern ibool panic_shutdown;
-/* Abort the execution. */
-void ut_dbg_panic(void);
-# define UT_DBG_PANIC ut_dbg_panic()
-/* Stop threads in ut_a(). */
-# define UT_DBG_STOP do {} while (0) /* We do not do this on NetWare */
-#else /* __NETWARE__ */
-# if defined(__WIN__) || defined(__INTEL_COMPILER)
-# undef UT_DBG_USE_ABORT
-# elif defined(__GNUC__) && (__GNUC__ > 2)
-# define UT_DBG_USE_ABORT
-# endif
-# ifndef UT_DBG_USE_ABORT
+#define UT_DBG_USE_ABORT
+
+
+#ifndef UT_DBG_USE_ABORT
/** A null pointer that will be dereferenced to trigger a memory trap */
extern ulint* ut_dbg_null_ptr;
-# endif
+#endif
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
@@ -91,9 +78,14 @@ ut_dbg_stop_thread(
ulint line);
# endif
-# ifdef UT_DBG_USE_ABORT
+
+#ifdef UT_DBG_USE_ABORT
/** Abort the execution. */
-# define UT_DBG_PANIC abort()
+#ifdef _WIN32
+# define UT_DBG_PANIC __debugbreak()
+#else
+# define UT_DBG_PANIC abort()
+#endif
/** Stop threads (null operation) */
# define UT_DBG_STOP do {} while (0)
# else /* UT_DBG_USE_ABORT */
@@ -106,7 +98,7 @@ ut_dbg_stop_thread(
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
# endif /* UT_DBG_USE_ABORT */
-#endif /* __NETWARE__ */
+
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */
diff --git a/storage/xtradb/include/ut0dbg.h b/storage/xtradb/include/ut0dbg.h
index 78b525c38ab..26950671c70 100644
--- a/storage/xtradb/include/ut0dbg.h
+++ b/storage/xtradb/include/ut0dbg.h
@@ -54,27 +54,14 @@ ut_dbg_assertion_failed(
const char* file, /*!< in: source file containing the assertion */
ulint line); /*!< in: line number of the assertion */
-#ifdef __NETWARE__
-/** Flag for ignoring further assertion failures. This is set to TRUE
-when on NetWare there happens an InnoDB assertion failure or other
-fatal error condition that requires an immediate shutdown. */
-extern ibool panic_shutdown;
-/* Abort the execution. */
-void ut_dbg_panic(void);
-# define UT_DBG_PANIC ut_dbg_panic()
-/* Stop threads in ut_a(). */
-# define UT_DBG_STOP do {} while (0) /* We do not do this on NetWare */
-#else /* __NETWARE__ */
-# if defined(__WIN__) || defined(__INTEL_COMPILER)
-# undef UT_DBG_USE_ABORT
-# elif defined(__GNUC__) && (__GNUC__ > 2)
-# define UT_DBG_USE_ABORT
-# endif
-# ifndef UT_DBG_USE_ABORT
+#define UT_DBG_USE_ABORT
+
+
+#ifndef UT_DBG_USE_ABORT
/** A null pointer that will be dereferenced to trigger a memory trap */
extern ulint* ut_dbg_null_ptr;
-# endif
+#endif
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
@@ -91,9 +78,14 @@ ut_dbg_stop_thread(
ulint line);
# endif
-# ifdef UT_DBG_USE_ABORT
+
+#ifdef UT_DBG_USE_ABORT
/** Abort the execution. */
-# define UT_DBG_PANIC abort()
+#ifdef _WIN32
+# define UT_DBG_PANIC __debugbreak()
+#else
+# define UT_DBG_PANIC abort()
+#endif
/** Stop threads (null operation) */
# define UT_DBG_STOP do {} while (0)
# else /* UT_DBG_USE_ABORT */
@@ -106,7 +98,7 @@ ut_dbg_stop_thread(
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
# endif /* UT_DBG_USE_ABORT */
-#endif /* __NETWARE__ */
+
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index e943d1a58b8..dbce86804c8 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -80,7 +80,7 @@ LExit:
It is assumed that called will add double quotation marks before and after
the string.
*/
-static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
+static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
{
const wchar_t special_chars[]=L" \t\n\v\"";
bool needs_escaping= false;
@@ -97,7 +97,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
if(!needs_escaping)
{
- wcscpy(out, in);
+ wcscpy_s(out, buflen, in);
return;
}
@@ -119,7 +119,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
Escape all backslashes, but let the terminating double quotation mark
that caller adds be interpreted as a metacharacter.
*/
- for(int j= 0; j < 2*n_backslashes;j++)
+ for(size_t j= 0; j < 2*n_backslashes;j++)
{
out[pos++]=L'\\';
}
@@ -130,7 +130,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
/*
Escape all backslashes and the following double quotation mark.
*/
- for(int j= 0; j < 2*n_backslashes + 1; j++)
+ for(size_t j= 0; j < 2*n_backslashes + 1; j++)
{
out[pos++]=L'\\';
}
@@ -139,7 +139,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
else
{
/* Backslashes aren't special here. */
- for (int j=0; j < n_backslashes; j++)
+ for (size_t j=0; j < n_backslashes; j++)
out[pos++] = L'\\';
out[pos++]= c;
@@ -592,7 +592,8 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
DWORD PasswordLen= MAX_PATH;
MsiGetPropertyW (hInstall, L"PASSWORD", Password, &PasswordLen);
- EscapeCommandLine(Password, EscapedPassword);
+ EscapeCommandLine(Password, EscapedPassword,
+ sizeof(EscapedPassword)/sizeof(EscapedPassword[0]));
MsiSetPropertyW(hInstall,L"ESCAPEDPASSWORD",EscapedPassword);
DWORD SkipNetworkingLen= MAX_PATH;