Commit bf33056e authored by Michael Widenius's avatar Michael Widenius

automatic merge with 5.2

parents f197991f 00752ba4
set @@global.innodb_fast_shutdown=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
RENAME TABLE t TO u;
DROP TABLE u;
......
......@@ -5,11 +5,10 @@
-- source include/not_embedded.inc
-- source include/have_innodb.inc
if (`SELECT @@innodb_fast_shutdown != 0`)
{
skip Need innodb_fast_shutdown=0;
}
#
# This test will not work if we don't do full shutdown of innodb
#
set @@global.innodb_fast_shutdown=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
RENAME TABLE t TO u;
......
set @@global.innodb_fast_shutdown=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
RENAME TABLE t TO u;
DROP TABLE u;
......
......@@ -5,6 +5,10 @@
-- source include/not_embedded.inc
-- source include/have_innodb_plugin.inc
# This test will not work if we don't do full shutdown of innodb
#
set @@global.innodb_fast_shutdown=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
RENAME TABLE t TO u;
DROP TABLE u;
......
......@@ -179,11 +179,22 @@ sub new
{
$limits{'working_blobs'} = 0; # HEAP tables can't handle BLOB's
}
# HEAP is deprecated in favor of MEMORY
if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /engine=memory/i)
{
$limits{'working_blobs'} = 0; # MEMORY tables can't handle BLOB's
}
if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /engine=innodb/i)
{
$self->{'transactions'} = 1; # Transactions enabled
}
if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /engine=pbxt/i)
{
$self->{'transactions'} = 1; # Transactions enabled
}
if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /engine=ndb/i)
{
......
......@@ -5805,9 +5805,23 @@ static bool test_if_number(register const char *str,
void sql_perror(const char *message)
{
#ifdef HAVE_STRERROR
#if defined(_WIN32)
char* buf;
DWORD dw= GetLastError();
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&buf, 0, NULL ) > 0)
{
sql_print_error("%s: %s",message, buf);
LocalFree((HLOCAL)buf);
}
else
{
sql_print_error("%s", message);
}
#elif defined(HAVE_STRERROR)
sql_print_error("%s: %s",message, strerror(errno));
#else
#else
perror(message);
#endif
}
......
......@@ -4047,6 +4047,32 @@ static void end_ssl()
#endif /* EMBEDDED_LIBRARY */
#ifdef _WIN32
/**
Registers a file to be collected when Windows Error Reporting creates a crash
report.
@note only works on Vista and later, since WerRegisterFile() is not available
on earlier Windows.
*/
#include <werapi.h>
static void add_file_to_crash_report(char *file)
{
/* Load WerRegisterFile function dynamically.*/
HRESULT (WINAPI *pWerRegisterFile)(PCWSTR, WER_REGISTER_FILE_TYPE, DWORD)
=(HRESULT (WINAPI *) (PCWSTR, WER_REGISTER_FILE_TYPE, DWORD))
GetProcAddress(GetModuleHandle("kernel32"),"WerRegisterFile");
if (pWerRegisterFile)
{
wchar_t wfile[MAX_PATH+1]= {0};
if (mbstowcs(wfile, file, MAX_PATH) != (size_t)-1)
{
pWerRegisterFile(wfile, WerRegFileTypeOther, WER_FILE_ANONYMOUS_DATA);
}
}
}
#endif
static int init_server_components()
{
......@@ -4099,6 +4125,11 @@ static int init_server_components()
if (!res)
setbuf(stderr, NULL);
#ifdef _WIN32
/* Add error log to windows crash reporting. */
add_file_to_crash_report(log_error_file);
#endif
}
}
......@@ -9011,7 +9042,7 @@ mysqld_get_one_option(int optid,
}
case OPT_EVENT_SCHEDULER:
#ifndef HAVE_EVENT_SCHEDULER
sql_perror("Event scheduler is not supported in embedded build.");
sql_print_error("Event scheduler is not supported in embedded build.");
#else
if (Events::set_opt_event_scheduler(argument))
return 1;
......
......@@ -558,8 +558,10 @@ xtPublic int xt_p_set_low_priority(pthread_t thr)
*/
/* -20 = highest, 20 = lowest */
#ifdef SET_GLOBAL_PRIORITY
if (setpriority(PRIO_PROCESS, getpid(), 20) == -1)
return errno;
#endif
return 0;
}
return pth_set_priority(thr, pth_min_priority);
......
......@@ -304,10 +304,12 @@ ENDFUNCTION()
FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
FILE(RELATIVE_PATH rel ${topdir} ${dir})
IF(rel AND IS_DIRECTORY "${f}")
MAKE_WIX_IDENTIFIER("${rel}" id)
GET_FILENAME_COMPONENT(name ${dir} NAME)
FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
IF(rel)
IF (IS_DIRECTORY "${f}")
MAKE_WIX_IDENTIFIER("${rel}" id)
GET_FILENAME_COMPONENT(name ${dir} NAME)
FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
ENDIF()
ENDIF()
FILE(GLOB all_files ${dir}/*)
FOREACH(f ${all_files})
......@@ -315,8 +317,10 @@ FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
ENDIF()
ENDFOREACH()
IF(rel AND IS_DIRECTORY "${f}")
FILE(APPEND ${file} "${prefix}</Directory>\n")
IF(rel)
IF(IS_DIRECTORY "${f}")
FILE(APPEND ${file} "${prefix}</Directory>\n")
ENDIF()
ENDIF()
ENDFUNCTION()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment