Commit a5fd94b1 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported Upstream version 10.0.24

parent aff5af7c
......@@ -175,6 +175,9 @@ static const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES =
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
/** The round off to MB is similar as done in srv_parse_megabytes() */
#define CALC_NUMBER_OF_PAGES(size) ((size) / (1024 * 1024)) * \
((1024 * 1024) / (UNIV_PAGE_SIZE))
#ifdef UNIV_PFS_THREAD
/* Keys to register InnoDB threads with performance schema */
UNIV_INTERN mysql_pfs_key_t io_handler_thread_key;
......@@ -1004,10 +1007,16 @@ open_or_create_data_files(
size_check:
size = os_file_get_size(files[i]);
ut_a(size != (os_offset_t) -1);
/* Round size downward to megabytes */
rounded_size_pages = (ulint)
(size >> UNIV_PAGE_SIZE_SHIFT);
/* Under some error conditions like disk full
narios or file size reaching filesystem
limit the data file could contain an incomplete
extent at the end. When we extend a data file
and if some failure happens, then also the data
file could contain an incomplete extent. So we
need to round the size downward to a megabyte.*/
rounded_size_pages = (ulint) CALC_NUMBER_OF_PAGES(size);
if (i == srv_n_data_files - 1
&& srv_auto_extend_last_data_file) {
......
......@@ -1640,34 +1640,49 @@ sync_print_wait_info(
/*=================*/
FILE* file) /*!< in: file where to print */
{
// Sum counter values once
ib_int64_t mutex_spin_wait_count_val
= static_cast<ib_int64_t>(mutex_spin_wait_count);
ib_int64_t mutex_spin_round_count_val
= static_cast<ib_int64_t>(mutex_spin_round_count);
ib_int64_t mutex_os_wait_count_val
= static_cast<ib_int64_t>(mutex_os_wait_count);
ib_int64_t rw_s_spin_wait_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_s_spin_wait_count);
ib_int64_t rw_s_spin_round_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_s_spin_round_count);
ib_int64_t rw_s_os_wait_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_s_os_wait_count);
ib_int64_t rw_x_spin_wait_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_x_spin_wait_count);
ib_int64_t rw_x_spin_round_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_x_spin_round_count);
ib_int64_t rw_x_os_wait_count_val
= static_cast<ib_int64_t>(rw_lock_stats.rw_x_os_wait_count);
fprintf(file,
"Mutex spin waits " UINT64PF ", rounds " UINT64PF ", "
"OS waits " UINT64PF "\n"
"RW-shared spins " UINT64PF ", rounds " UINT64PF ", "
"OS waits " UINT64PF "\n"
"RW-excl spins " UINT64PF ", rounds " UINT64PF ", "
"OS waits " UINT64PF "\n",
(ib_uint64_t) mutex_spin_wait_count,
(ib_uint64_t) mutex_spin_round_count,
(ib_uint64_t) mutex_os_wait_count,
(ib_uint64_t) rw_lock_stats.rw_s_spin_wait_count,
(ib_uint64_t) rw_lock_stats.rw_s_spin_round_count,
(ib_uint64_t) rw_lock_stats.rw_s_os_wait_count,
(ib_uint64_t) rw_lock_stats.rw_x_spin_wait_count,
(ib_uint64_t) rw_lock_stats.rw_x_spin_round_count,
(ib_uint64_t) rw_lock_stats.rw_x_os_wait_count);
"Mutex spin waits " INT64PF ", rounds " INT64PF ", "
"OS waits " INT64PF "\n"
"RW-shared spins " INT64PF ", rounds " INT64PF ", "
"OS waits " INT64PF "\n"
"RW-excl spins " INT64PF ", rounds " INT64PF ", "
"OS waits " INT64PF "\n",
mutex_spin_wait_count_val, mutex_spin_round_count_val,
mutex_os_wait_count_val,
rw_s_spin_wait_count_val, rw_s_spin_round_count_val,
rw_s_os_wait_count_val,
rw_x_spin_wait_count_val, rw_x_spin_round_count_val,
rw_x_os_wait_count_val);
fprintf(file,
"Spin rounds per wait: %.2f mutex, %.2f RW-shared, "
"%.2f RW-excl\n",
(double) mutex_spin_round_count /
(mutex_spin_wait_count ? mutex_spin_wait_count : 1),
(double) rw_lock_stats.rw_s_spin_round_count /
(rw_lock_stats.rw_s_spin_wait_count
? rw_lock_stats.rw_s_spin_wait_count : 1),
(double) rw_lock_stats.rw_x_spin_round_count /
(rw_lock_stats.rw_x_spin_wait_count
? rw_lock_stats.rw_x_spin_wait_count : 1));
(double) mutex_spin_round_count_val /
(mutex_spin_wait_count_val ? mutex_spin_wait_count_val : 1LL),
(double) rw_s_spin_round_count_val /
(rw_s_spin_wait_count_val ? rw_s_spin_wait_count_val : 1LL),
(double) rw_x_spin_round_count_val /
(rw_x_spin_wait_count_val ? rw_x_spin_wait_count_val : 1LL));
}
/*******************************************************************//**
......
......@@ -13,9 +13,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc
my_getopt
MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
MY_ADD_TESTS(ma_dyncol
LINK_LIBRARIES mysqlclient)
......
/* Copyright (c) 2016, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
//#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <tap.h>
DYNAMIC_STRING str1;
static void check(const char *res)
{
ok(strcmp(str1.str, res) == 0, "strcmp: %s", str1.str);
str1.length= 0;
}
int main(void)
{
plan(23);
IF_WIN(skip_all("Test of POSIX shell escaping rules, not for CMD.EXE\n"), );
ok(init_dynamic_string(&str1, NULL, 0, 32) == 0, "init");
ok(dynstr_append_os_quoted(&str1, "test1", NULL) == 0, "append");
check("'test1'");
ok(dynstr_append_os_quoted(&str1, "con", "cat", NULL) == 0, "append");
check("'concat'");
ok(dynstr_append_os_quoted(&str1, "", NULL) == 0, "append");
check("''");
ok(dynstr_append_os_quoted(&str1, "space inside", NULL) == 0, "append");
check("'space inside'");
ok(dynstr_append_os_quoted(&str1, "single'quote", NULL) == 0, "append");
check("'single'\"'\"'quote'");
ok(dynstr_append_os_quoted(&str1, "many'single'quotes", NULL) == 0, "append");
check("'many'\"'\"'single'\"'\"'quotes'");
ok(dynstr_append_os_quoted(&str1, "'single quoted'", NULL) == 0, "append");
check("''\"'\"'single quoted'\"'\"''");
ok(dynstr_append_os_quoted(&str1, "double\"quote", NULL) == 0, "append");
check("'double\"quote'");
ok(dynstr_append_os_quoted(&str1, "mixed\"single'and\"double'quotes", NULL) == 0, "append");
check("'mixed\"single'\"'\"'and\"double'\"'\"'quotes'");
ok(dynstr_append_os_quoted(&str1, "back\\space", NULL) == 0, "append");
check("'back\\space'");
ok(dynstr_append_os_quoted(&str1, "backspace\\'and\\\"quote", NULL) == 0, "append");
check("'backspace\\'\"'\"'and\\\"quote'");
dynstr_free(&str1);
return exit_status();
}
MY_ADD_TESTS(strings LINK_LIBRARIES strings)
MY_ADD_TESTS(strings LINK_LIBRARIES strings mysys)
......@@ -17,6 +17,10 @@
#include "vio_priv.h"
#ifdef HAVE_OPENSSL
#ifndef HAVE_YASSL
#include <openssl/dh.h>
#include <openssl/bn.h>
#endif
static my_bool ssl_algorithms_added = FALSE;
static my_bool ssl_error_strings_loaded= FALSE;
......
......@@ -18,9 +18,6 @@ SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY}
......
Supports Markdown
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