Compare commits
21 Commits
3f6a5832f3
...
d5580feab7
Author | SHA1 | Date | |
---|---|---|---|
|
d5580feab7 | ||
|
9bf0492b7d | ||
|
8c6cbb3360 | ||
|
fe10645eb7 | ||
|
aaccf99fdb | ||
|
d665810cf0 | ||
|
be48b3ee59 | ||
|
4af231b1d1 | ||
|
59ee33e14e | ||
|
9e1c1d429f | ||
|
6c6941c9ba | ||
|
118cfcf821 | ||
|
f5b5de9cf9 | ||
|
8fb09426b9 | ||
|
bb48d7bc81 | ||
|
56e0be34bc | ||
|
0c18e5a292 | ||
|
a7278a3024 | ||
|
791fcea1d7 | ||
|
da5a4d05b9 | ||
|
c94133a71d |
51
.github/workflows/windows-arm64.yml
vendored
Normal file
51
.github/workflows/windows-arm64.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: Build on Windows ARM64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'bb-*'
|
||||
- '[0-9]+.[0-9]+'
|
||||
- '*wlad*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
runs-on: windows-11-arm
|
||||
|
||||
steps:
|
||||
- name: Configure git
|
||||
run: |
|
||||
# We won't be able to successfully run mtr
|
||||
# unless we configure autocrlf.
|
||||
git config --global core.autocrlf input
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install prerequisites
|
||||
run: |
|
||||
# Install bison to compile
|
||||
choco install winflexbison3
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
# speedup checkout by excluding uninteresting modules
|
||||
git config submodule.storage/columnstore/columnstore.update none
|
||||
git config submodule.storage/maria/libmarias3.update none
|
||||
git config submodule.storage/rocksdb/rocksdb.update none
|
||||
git config submodule.wsrep-lib.update none
|
||||
mkdir bld
|
||||
cd bld
|
||||
cmake .. -DWITH_SSL=bundled
|
||||
cmake --build . --config RelWithDebinfo --verbose -- -m
|
||||
|
||||
- name: Test MTR
|
||||
run: |
|
||||
$env:PATH = "C:\Strawberry\perl\bin;$env:PATH;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64"
|
||||
#Calculate parallel as 4 * number of processors
|
||||
$parallel = 4 * [int]$env:NUMBER_OF_PROCESSORS
|
||||
perl bld\mysql-test\mysql-test-run.pl --force --parallel=$parallel --suite=main --mysqld=--loose-innodb-flush-log-at-trx-commit=2
|
@ -126,15 +126,7 @@ ENDIF()
|
||||
FIND_PACKAGE(Git)
|
||||
|
||||
IF(WIN32 AND (CMAKE_VERSION VERSION_GREATER "3.21"))
|
||||
# Install runtime dependency by default, when using vcpkg
|
||||
IF(NOT DEFINED INSTALL_RUNTIME_DEPENDENCIES_DEFAULT)
|
||||
IF("${VCPKG_INSTALLED_DIR}")
|
||||
SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT OFF)
|
||||
ELSE()
|
||||
SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT ON)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
OPTION(INSTALL_RUNTIME_DEPENDENCIES "Install runtime dependencies" "${INSTALL_RUNTIME_DEPENDENCIES_DEFAULT}")
|
||||
OPTION(INSTALL_RUNTIME_DEPENDENCIES "Install runtime dependencies" ON)
|
||||
ENDIF()
|
||||
|
||||
# Following autotools tradition, add preprocessor definitions
|
||||
@ -379,6 +371,7 @@ IF(WIN32)
|
||||
ELSE()
|
||||
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
|
||||
SET(SHAREDIR ${INSTALL_MYSQLSHAREDIRABS})
|
||||
SET(HOSTNAME "uname -n" CACHE STRING "Command for determining hostname")
|
||||
ENDIF()
|
||||
|
||||
SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}")
|
||||
@ -595,6 +588,7 @@ ENDIF()
|
||||
|
||||
INCLUDE(build_depends)
|
||||
|
||||
INSTALL_RUNTIME_DEPS()
|
||||
INCLUDE(CPack)
|
||||
|
||||
IF(WIN32 AND SIGNCODE)
|
||||
|
2
VERSION
2
VERSION
@ -1,4 +1,4 @@
|
||||
MYSQL_VERSION_MAJOR=11
|
||||
MYSQL_VERSION_MINOR=4
|
||||
MYSQL_VERSION_PATCH=6
|
||||
MYSQL_VERSION_PATCH=8
|
||||
SERVER_MATURITY=stable
|
||||
|
@ -228,26 +228,58 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
|
||||
IF(SIGNCODE)
|
||||
SIGN_TARGET(${target} ${COMP})
|
||||
ENDIF()
|
||||
IF(INSTALL_RUNTIME_DEPENDENCIES)
|
||||
# Populate INSTALLED_TARGETS list (stored as global property)
|
||||
# The list is used in INSTALL_RUNTIME_DEPS
|
||||
GET_PROPERTY(installed_targets GLOBAL PROPERTY INSTALLED_TARGETS)
|
||||
IF(NOT installed_targets)
|
||||
SET(installed_targets)
|
||||
ENDIF()
|
||||
LIST(APPEND installed_targets "${target}")
|
||||
SET_PROPERTY(GLOBAL PROPERTY INSTALLED_TARGETS "${installed_targets}")
|
||||
SET(RUNTIME_DEPS RUNTIME_DEPENDENCY_SET ${target})
|
||||
ENDIF()
|
||||
INSTALL(TARGETS ${target} DESTINATION ${ARG_DESTINATION} ${COMP} ${RUNTIME_DEPS})
|
||||
INSTALL_DEBUG_SYMBOLS(${target} ${COMP} INSTALL_LOCATION ${ARG_DESTINATION})
|
||||
ENDFOREACH()
|
||||
ENDFUNCTION()
|
||||
|
||||
IF(WIN32 AND INSTALL_RUNTIME_DEPENDENCIES)
|
||||
STRING(JOIN "." runtime_deps_set_name ${TARGETS})
|
||||
SET(RUNTIME_DEPS RUNTIME_DEPENDENCY_SET "${runtime_deps_set_name}")
|
||||
|
||||
# On Windows, installs runtime dependency for all targets
|
||||
FUNCTION(INSTALL_RUNTIME_DEPS)
|
||||
IF(NOT WIN32 OR NOT INSTALL_RUNTIME_DEPENDENCIES)
|
||||
RETURN()
|
||||
ENDIF()
|
||||
# Install all runtime dependencies
|
||||
|
||||
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP} ${RUNTIME_DEPS})
|
||||
INSTALL_DEBUG_SYMBOLS(${TARGETS} ${COMP} INSTALL_LOCATION ${ARG_DESTINATION})
|
||||
GET_PROPERTY(installed_targets GLOBAL PROPERTY INSTALLED_TARGETS)
|
||||
# Exclude all dependencies that are shared libraries from the
|
||||
# same build.
|
||||
FOREACH(tgt ${installed_targets})
|
||||
SET(exclude_libs)
|
||||
GET_TARGET_PROPERTY(link_libraries ${tgt} LINK_LIBRARIES)
|
||||
IF(link_libraries)
|
||||
FOREACH(lib ${link_libraries})
|
||||
IF(TARGET ${lib})
|
||||
GET_TARGET_PROPERTY(type ${lib} TYPE)
|
||||
IF(type MATCHES "SHARED")
|
||||
LIST(APPEND exclude_libs "$<TARGET_FILE_BASE_NAME:${lib}>\\.dll")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32 AND INSTALL_RUNTIME_DEPENDENCIES)
|
||||
INSTALL(
|
||||
RUNTIME_DEPENDENCY_SET
|
||||
"${runtime_deps_set_name}"
|
||||
${tgt}
|
||||
COMPONENT RuntimeDeps
|
||||
DESTINATION ${INSTALL_BINDIR}
|
||||
PRE_EXCLUDE_REGEXES
|
||||
"api-ms-" # Windows stuff
|
||||
"ext-ms-"
|
||||
"server\\.dll" # main server DLL, installed separately
|
||||
"icuuc\\.dll" # Old Windows 10 (1809)
|
||||
"icuin\\.dll"
|
||||
${exclude_libs}
|
||||
"clang_rt" # ASAN libraries
|
||||
"vcruntime"
|
||||
POST_EXCLUDE_REGEXES
|
||||
@ -257,7 +289,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
|
||||
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin
|
||||
$<$<CONFIG:Debug>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin>
|
||||
)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDFUNCTION()
|
||||
|
||||
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
|
||||
|
@ -174,10 +174,9 @@ if(MSVC)
|
||||
-Wno-unused-local-typedef
|
||||
-Wno-microsoft-static-assert
|
||||
-Wno-c++17-extensions
|
||||
-msse4.2
|
||||
)
|
||||
if((CMAKE_SIZEOF_VOID_P MATCHES 8) AND MSVC_INTEL)
|
||||
add_compile_options(-mpclmul)
|
||||
add_compile_options(-mpclmul -msse4.2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -178,7 +178,9 @@ extern my_bool my_use_large_pages;
|
||||
|
||||
int my_init_large_pages(void);
|
||||
uchar *my_large_malloc(size_t *size, myf my_flags);
|
||||
#if defined _WIN32 || defined HAVE_MMAP
|
||||
#ifdef _WIN32
|
||||
/* On Windows, use my_virtual_mem_reserve() and my_virtual_mem_commit(). */
|
||||
#else
|
||||
char *my_large_virtual_alloc(size_t *size);
|
||||
#endif
|
||||
void my_large_free(void *ptr, size_t size);
|
||||
|
@ -24,7 +24,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifdef _WIN32
|
||||
char *my_virtual_mem_reserve(size_t *size);
|
||||
# endif
|
||||
char *my_virtual_mem_commit(char *ptr, size_t size);
|
||||
void my_virtual_mem_decommit(char *ptr, size_t size);
|
||||
void my_virtual_mem_release(char *ptr, size_t size);
|
||||
|
@ -1,5 +1,11 @@
|
||||
--source include/windows.inc
|
||||
--source include/check_utf8_cli.inc
|
||||
|
||||
if(!`select $MTR_PARALLEL = 1`)
|
||||
{
|
||||
skip race condition with parallel tests;
|
||||
}
|
||||
|
||||
--exec $MYSQL --default-character-set=auto -e "select @@character_set_client"
|
||||
|
||||
# Test that a user with old, non-UTF8 password can still connect
|
||||
|
@ -1285,6 +1285,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.1821659,
|
||||
@ -1340,6 +1341,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.1821659,
|
||||
@ -2533,6 +2535,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "a_b",
|
||||
"rows_read": 41,
|
||||
"rows_out": 41,
|
||||
"cost": 0.051379171,
|
||||
@ -3012,6 +3015,7 @@ explain select * from t1 left join t2 on t2.a=t1.a {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "eq_ref",
|
||||
"index": "PRIMARY",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.007120904,
|
||||
@ -3980,6 +3984,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "pk_a_b",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.000928812,
|
||||
@ -4676,6 +4681,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "range",
|
||||
"index": "a",
|
||||
"rows_read": 3,
|
||||
"rows_out": 3,
|
||||
"cost": 0.001755494,
|
||||
@ -4702,6 +4708,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "range",
|
||||
"index": "a",
|
||||
"rows_read": 3,
|
||||
"rows_out": 3,
|
||||
"cost": 0.001755494,
|
||||
@ -4744,6 +4751,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.002376836,
|
||||
@ -4795,6 +4803,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 1.166666667,
|
||||
"rows_out": 1.166666667,
|
||||
"cost": 0.002392836,
|
||||
@ -11275,6 +11284,7 @@ JS
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "ref",
|
||||
"index": "b",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.01901531,
|
||||
@ -11521,6 +11531,7 @@ JS
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.01840091,
|
||||
@ -12906,6 +12917,7 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "ref",
|
||||
"index": "idx_a",
|
||||
"rows_read": 1.8367,
|
||||
"rows_out": 1.8367,
|
||||
"cost": 0.002051185,
|
||||
@ -13201,6 +13213,7 @@ explain select * from t1 where a<10 and b between 10 and 50 and c < 10 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "range",
|
||||
"index": "a",
|
||||
"rows_read": 0.189,
|
||||
"rows_out": 0.017766,
|
||||
"cost": 0.006364199,
|
||||
|
@ -227,6 +227,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
|
||||
],
|
||||
"chosen_access_method": {
|
||||
"type": "ref",
|
||||
"index": "key1",
|
||||
"rows_read": 1,
|
||||
"rows_out": 1,
|
||||
"cost": 0.00345856,
|
||||
|
@ -186,6 +186,7 @@ JS
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "ref",
|
||||
"index": "a",
|
||||
"rows_read": 6,
|
||||
"rows_out": 0.6,
|
||||
"cost": 0.005388489,
|
||||
|
@ -298,6 +298,7 @@ JS
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "range",
|
||||
"index": "PRIMARY",
|
||||
"rows_read": 5,
|
||||
"rows_out": 2.490196078,
|
||||
"cost": 0.00948507,
|
||||
|
@ -293,6 +293,7 @@ JS
|
||||
"chosen_access_method":
|
||||
{
|
||||
"type": "range",
|
||||
"index": "PRIMARY",
|
||||
"rows_read": 5,
|
||||
"rows_out": 2.490196078,
|
||||
"cost": 0.010014472,
|
||||
|
@ -12,12 +12,19 @@ select @@innodb_buffer_pool_size;
|
||||
10485760
|
||||
create table t1 (id int primary key, val int not null)
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||
create table t2 (id int primary key, val int not null)
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs;
|
||||
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
|
||||
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144;
|
||||
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
|
||||
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;
|
||||
set global innodb_buffer_pool_size = 7340032;
|
||||
select count(val) from t1;
|
||||
count(val)
|
||||
262144
|
||||
select count(val) from t2;
|
||||
count(val)
|
||||
16384
|
||||
set global innodb_adaptive_hash_index=OFF;
|
||||
set global innodb_buffer_pool_size = 24117248;
|
||||
set global innodb_buffer_pool_size = 26214400;
|
||||
@ -29,7 +36,10 @@ select @@innodb_buffer_pool_size;
|
||||
select count(val) from t1;
|
||||
count(val)
|
||||
262144
|
||||
drop table t1;
|
||||
select count(val) from t2;
|
||||
count(val)
|
||||
16384
|
||||
drop table t1,t2;
|
||||
SET GLOBAL innodb_max_purge_lag_wait = 0;
|
||||
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
|
||||
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
|
||||
|
@ -21,6 +21,7 @@ set global innodb_buffer_pool_size = 9437184;
|
||||
set global innodb_buffer_pool_size = 10485760;
|
||||
|
||||
select @@innodb_buffer_pool_size;
|
||||
let $kbs=`SELECT CAST(@@innodb_page_size / 1024 AS INT)`;
|
||||
|
||||
# fill buffer pool
|
||||
--disable_query_log
|
||||
@ -29,9 +30,13 @@ SET GLOBAL innodb_read_only_compressed=OFF;
|
||||
--enable_query_log
|
||||
create table t1 (id int primary key, val int not null)
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||
evalp create table t2 (id int primary key, val int not null)
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs;
|
||||
|
||||
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
|
||||
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144;
|
||||
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
|
||||
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;
|
||||
|
||||
--disable_query_log
|
||||
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
|
||||
@ -42,6 +47,7 @@ SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
|
||||
set global innodb_buffer_pool_size = 7340032;
|
||||
|
||||
select count(val) from t1;
|
||||
select count(val) from t2;
|
||||
|
||||
set global innodb_adaptive_hash_index=OFF;
|
||||
|
||||
@ -52,8 +58,9 @@ set global innodb_buffer_pool_size = 26214400;
|
||||
select @@innodb_buffer_pool_size;
|
||||
|
||||
select count(val) from t1;
|
||||
select count(val) from t2;
|
||||
|
||||
drop table t1;
|
||||
drop table t1,t2;
|
||||
|
||||
SET GLOBAL innodb_max_purge_lag_wait = 0;
|
||||
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
|
||||
@ -66,8 +73,6 @@ SELECT variable_value = 0
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
|
||||
--source include/wait_condition.inc
|
||||
# this may occasionally be aborted on a heavily loaded builder
|
||||
--error 0,ER_WRONG_USAGE
|
||||
SET GLOBAL innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
|
||||
SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
|
||||
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
|
||||
|
@ -49,8 +49,8 @@ SET @@GLOBAL.rpl_semi_sync_slave_enabled= 1;
|
||||
|
||||
--connection master
|
||||
--echo # Verify Semi-Sync is active
|
||||
--let $status_var= Rpl_semi_sync_master_status
|
||||
--let $status_var_value= ON
|
||||
--let $status_var= Rpl_semi_sync_master_clients
|
||||
--let $status_var_value= 1
|
||||
--source include/wait_for_status_var.inc
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_clients';
|
||||
|
||||
@ -67,7 +67,7 @@ STOP SLAVE;
|
||||
--echo # MDEV-36663: Verifying dump thread connection is killed..
|
||||
# Prior to MDEV-36663 fixes, this would time out and
|
||||
# Rpl_semi_sync_master_clients would remain 1.
|
||||
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.PROCESSLIST WHERE COMMAND = 'Binlog Dump'
|
||||
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.PROCESSLIST WHERE USER = 'replssl'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $n_master_clients= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_clients', Value, 1)
|
||||
|
@ -68,7 +68,14 @@ IF(MSVC_INTEL)
|
||||
ENDIF()
|
||||
ELSEIF(MSVC_ARM64)
|
||||
SET (MYSYS_SOURCES ${MYSYS_SOURCES} crc32/crc32_arm64.c)
|
||||
ADD_DEFINITIONS(-DHAVE_ARMV8_CRC -DHAVE_ARMV8_CRC_CRYPTO_INTRINSICS)
|
||||
ADD_DEFINITIONS(-DHAVE_ARMV8_CRC -DHAVE_ARMV8_CRC_CRYPTO_INTRINSICS -DHAVE_ARMV8_CRYPTO)
|
||||
IF(CLANG_CL)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
crc32/crc32_arm64.c
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "-march=armv8-a+crc+crypto"
|
||||
)
|
||||
ENDIF()
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|i386|i686")
|
||||
SET(MYSYS_SOURCES ${MYSYS_SOURCES} crc32/crc32_x86.c crc32/crc32c_x86.cc)
|
||||
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5")
|
||||
|
@ -4,31 +4,40 @@
|
||||
#include <stddef.h>
|
||||
|
||||
typedef unsigned (*my_crc32_t)(unsigned, const void *, size_t);
|
||||
unsigned crc32_aarch64(unsigned, const void *, size_t);
|
||||
|
||||
#ifdef HAVE_ARMV8_CRC
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
# ifdef HAVE_ARMV8_CRYPTO
|
||||
static unsigned crc32c_aarch64_pmull(unsigned, const void *, size_t);
|
||||
# endif
|
||||
|
||||
# ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# ifdef __clang__
|
||||
# include <arm_acle.h>
|
||||
# include <arm_neon.h>
|
||||
# endif
|
||||
int crc32_aarch64_available(void)
|
||||
{
|
||||
return IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
|
||||
}
|
||||
|
||||
const char *crc32c_aarch64_available(void)
|
||||
unsigned crc32c_aarch64(unsigned, const void *, size_t);
|
||||
|
||||
my_crc32_t crc32c_aarch64_available(void)
|
||||
{
|
||||
if (crc32_aarch64_available() == 0)
|
||||
return NULL;
|
||||
/* TODO : pmull seems supported, but does not compile*/
|
||||
return "Using ARMv8 crc32 instructions";
|
||||
|
||||
if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE))
|
||||
return crc32c_aarch64_pmull;
|
||||
return crc32c_aarch64;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef HAVE_ARMV8_CRYPTO
|
||||
static unsigned crc32c_aarch64_pmull(unsigned, const void *, size_t);
|
||||
# endif
|
||||
|
||||
# ifdef __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
# else /* _WIN32 */
|
||||
# ifdef __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
|
||||
int crc32_aarch64_available(void)
|
||||
{
|
||||
@ -41,16 +50,16 @@ int crc32_aarch64_available(void)
|
||||
|
||||
my_crc32_t crc32c_aarch64_available(void)
|
||||
{
|
||||
# ifdef HAVE_ARMV8_CRYPTO
|
||||
# ifdef HAVE_ARMV8_CRYPTO
|
||||
if (crc32_aarch64_available())
|
||||
return crc32c_aarch64_pmull;
|
||||
# endif
|
||||
# endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
# else /* __APPLE__ */
|
||||
# include <sys/auxv.h>
|
||||
# ifdef __FreeBSD__
|
||||
# else /* __APPLE__ */
|
||||
# include <sys/auxv.h>
|
||||
# ifdef __FreeBSD__
|
||||
static unsigned long getauxval(unsigned int key)
|
||||
{
|
||||
unsigned long val;
|
||||
@ -58,17 +67,17 @@ static unsigned long getauxval(unsigned int key)
|
||||
return 0ul;
|
||||
return val;
|
||||
}
|
||||
# else
|
||||
# include <asm/hwcap.h>
|
||||
# endif
|
||||
# else
|
||||
# include <asm/hwcap.h>
|
||||
# endif
|
||||
|
||||
# ifndef HWCAP_CRC32
|
||||
# define HWCAP_CRC32 (1 << 7)
|
||||
# endif
|
||||
# ifndef HWCAP_CRC32
|
||||
# define HWCAP_CRC32 (1 << 7)
|
||||
# endif
|
||||
|
||||
# ifndef HWCAP_PMULL
|
||||
# define HWCAP_PMULL (1 << 4)
|
||||
# endif
|
||||
# ifndef HWCAP_PMULL
|
||||
# define HWCAP_PMULL (1 << 4)
|
||||
# endif
|
||||
|
||||
/* ARM made crc32 default from ARMv8.1 but optional in ARMv8A
|
||||
* Runtime check API.
|
||||
@ -78,9 +87,9 @@ int crc32_aarch64_available(void)
|
||||
unsigned long auxv= getauxval(AT_HWCAP);
|
||||
return (auxv & HWCAP_CRC32) != 0;
|
||||
}
|
||||
# endif /* __APPLE__ */
|
||||
# endif /* __APPLE__ */
|
||||
|
||||
# ifndef __APPLE__
|
||||
# ifndef __APPLE__
|
||||
static unsigned crc32c_aarch64(unsigned, const void *, size_t);
|
||||
|
||||
my_crc32_t crc32c_aarch64_available(void)
|
||||
@ -88,14 +97,15 @@ my_crc32_t crc32c_aarch64_available(void)
|
||||
unsigned long auxv= getauxval(AT_HWCAP);
|
||||
if (!(auxv & HWCAP_CRC32))
|
||||
return NULL;
|
||||
# ifdef HAVE_ARMV8_CRYPTO
|
||||
# ifdef HAVE_ARMV8_CRYPTO
|
||||
/* Raspberry Pi 4 supports crc32 but doesn't support pmull (MDEV-23030). */
|
||||
if (auxv & HWCAP_PMULL)
|
||||
return crc32c_aarch64_pmull;
|
||||
# endif
|
||||
# endif
|
||||
return crc32c_aarch64;
|
||||
}
|
||||
# endif /* __APPLE__ */
|
||||
# endif /* __APPLE__ */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
const char *crc32c_aarch64_impl(my_crc32_t c)
|
||||
{
|
||||
@ -173,11 +183,19 @@ asm(".arch_extension crypto");
|
||||
CRC32C3X8(buffer, ((ITR) * 7 + 6)) \
|
||||
} while(0)
|
||||
|
||||
#if defined _MSC_VER && !defined __clang__
|
||||
#define PREF4X64L1(buffer, offset, itr)\
|
||||
__prefetch(buffer + (offset) + ((itr) + 0)*64);\
|
||||
__prefetch(buffer + (offset) + ((itr) + 1)*64);\
|
||||
__prefetch(buffer + (offset) + ((itr) + 2)*64);\
|
||||
__prefetch(buffer + (offset) + ((itr) + 3)*64);
|
||||
#else
|
||||
#define PREF4X64L1(buffer, PREF_OFFSET, ITR) \
|
||||
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 0)*64));\
|
||||
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 1)*64));\
|
||||
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 2)*64));\
|
||||
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 3)*64));
|
||||
#endif
|
||||
|
||||
#define PREF1KL1(buffer, PREF_OFFSET) \
|
||||
PREF4X64L1(buffer,(PREF_OFFSET), 0) \
|
||||
@ -185,11 +203,20 @@ asm(".arch_extension crypto");
|
||||
PREF4X64L1(buffer,(PREF_OFFSET), 8) \
|
||||
PREF4X64L1(buffer,(PREF_OFFSET), 12)
|
||||
|
||||
#if defined _MSC_VER && !defined __clang__
|
||||
#define MY_PLDL2KEEP 2 /* PLDL2KEEP is 2 in ARMv8 */
|
||||
#define PREF4X64L2(buffer,offset,itr)\
|
||||
__prefetch2(buffer + offset + ((itr) + 0) * 64, MY_PLDL2KEEP);\
|
||||
__prefetch2(buffer + offset + ((itr) + 1) * 64, MY_PLDL2KEEP);\
|
||||
__prefetch2(buffer + offset + ((itr) + 2) * 64, MY_PLDL2KEEP);\
|
||||
__prefetch2(buffer + offset + ((itr) + 3) * 64, MY_PLDL2KEEP);
|
||||
#else
|
||||
#define PREF4X64L2(buffer, PREF_OFFSET, ITR) \
|
||||
__asm__("PRFM PLDL2KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 0)*64));\
|
||||
__asm__("PRFM PLDL2KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 1)*64));\
|
||||
__asm__("PRFM PLDL2KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 2)*64));\
|
||||
__asm__("PRFM PLDL2KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 3)*64));
|
||||
#endif
|
||||
|
||||
#define PREF1KL2(buffer, PREF_OFFSET) \
|
||||
PREF4X64L2(buffer,(PREF_OFFSET), 0) \
|
||||
@ -232,6 +259,16 @@ static unsigned crc32c_aarch64(unsigned crc, const void *buf, size_t len)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARMV8_CRYPTO
|
||||
|
||||
static inline uint64_t poly_mul(uint64_t a, uint64_t b)
|
||||
{
|
||||
#if defined _MSC_VER && !defined __clang__
|
||||
return vgetq_lane_u64(vreinterpretq_u64_p128(neon_pmull_64(vcreate_p64(a), vcreate_p64(b))),0);
|
||||
#else
|
||||
return (uint64_t) vmull_p64(a, b);
|
||||
#endif
|
||||
}
|
||||
|
||||
static unsigned crc32c_aarch64_pmull(unsigned crc, const void *buf, size_t len)
|
||||
{
|
||||
int64_t length= (int64_t)len;
|
||||
@ -278,8 +315,8 @@ static unsigned crc32c_aarch64_pmull(unsigned crc, const void *buf, size_t len)
|
||||
* crc1 multiply by K2
|
||||
* crc0 multiply by K1
|
||||
*/
|
||||
t1= (uint64_t)vmull_p64(crc1, k2);
|
||||
t0= (uint64_t)vmull_p64(crc0, k1);
|
||||
t1= poly_mul(crc1, k2);
|
||||
t0= poly_mul(crc0, k1);
|
||||
crc= __crc32cd(crc2, *(const uint64_t *)buffer);
|
||||
crc1= __crc32cd(0, t1);
|
||||
crc^= crc1;
|
||||
@ -370,7 +407,7 @@ static unsigned crc32c_aarch64_pmull(unsigned crc, const void *buf, size_t len)
|
||||
/* There are multiple approaches to calculate crc.
|
||||
Approach-1: Process 8 bytes then 4 bytes then 2 bytes and then 1 bytes
|
||||
Approach-2: Process 8 bytes and remaining workload using 1 bytes
|
||||
Apporach-3: Process 64 bytes at once by issuing 8 crc call and remaining
|
||||
Approach-3: Process 64 bytes at once by issuing 8 crc call and remaining
|
||||
using 8/1 combination.
|
||||
|
||||
Based on micro-benchmark testing we found that Approach-2 works best especially
|
||||
|
@ -423,7 +423,7 @@ uchar *my_large_malloc(size_t *size, myf my_flags)
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef _WIN32
|
||||
/**
|
||||
Special large pages allocator, with possibility to commit to allocating
|
||||
more memory later.
|
||||
@ -434,37 +434,10 @@ char *my_large_virtual_alloc(size_t *size)
|
||||
char *ptr;
|
||||
DBUG_ENTER("my_large_virtual_alloc");
|
||||
|
||||
if (my_use_large_pages)
|
||||
{
|
||||
size_t s= *size;
|
||||
s= MY_ALIGN(s, (size_t) my_large_page_size);
|
||||
ptr= VirtualAlloc(NULL, s, MEM_COMMIT | MEM_RESERVE | MEM_LARGE_PAGES,
|
||||
PAGE_READWRITE);
|
||||
if (ptr)
|
||||
{
|
||||
*size= s;
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_RETURN(VirtualAlloc(NULL, *size, MEM_RESERVE, PAGE_READWRITE));
|
||||
}
|
||||
#elif defined HAVE_MMAP
|
||||
/**
|
||||
Special large pages allocator, with possibility to commit to allocating
|
||||
more memory later.
|
||||
Every implementation returns a zero filled buffer here.
|
||||
*/
|
||||
char *my_large_mmap(size_t *size, int prot)
|
||||
{
|
||||
char *ptr;
|
||||
DBUG_ENTER("my_large_virtual_alloc");
|
||||
|
||||
if (my_use_large_pages)
|
||||
{
|
||||
size_t large_page_size;
|
||||
int page_i= 0;
|
||||
prot= PROT_READ | PROT_WRITE;
|
||||
|
||||
while ((large_page_size= my_next_large_page_size(*size, &page_i)) != 0)
|
||||
{
|
||||
@ -488,7 +461,7 @@ char *my_large_mmap(size_t *size, int prot)
|
||||
OS_MAP_ANON;
|
||||
|
||||
size_t aligned_size= MY_ALIGN(*size, (size_t) large_page_size);
|
||||
ptr= mmap(NULL, aligned_size, prot, mapflag, -1, 0);
|
||||
ptr= mmap(NULL, aligned_size, PROT_READ | PROT_WRITE, mapflag, -1, 0);
|
||||
if (ptr == (void*) -1)
|
||||
{
|
||||
ptr= NULL;
|
||||
@ -511,10 +484,7 @@ char *my_large_mmap(size_t *size, int prot)
|
||||
}
|
||||
}
|
||||
|
||||
ptr= mmap(NULL, *size, prot,
|
||||
# ifdef MAP_NORESERVE
|
||||
MAP_NORESERVE |
|
||||
# endif
|
||||
ptr= mmap(NULL, *size, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | OS_MAP_ANON, -1, 0);
|
||||
if (ptr == MAP_FAILED)
|
||||
{
|
||||
@ -524,16 +494,6 @@ char *my_large_mmap(size_t *size, int prot)
|
||||
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
Special large pages allocator, with possibility to commit to allocating
|
||||
more memory later.
|
||||
Every implementation returns a zero filled buffer here.
|
||||
*/
|
||||
char *my_large_virtual_alloc(size_t *size)
|
||||
{
|
||||
return my_large_mmap(size, PROT_READ | PROT_WRITE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -159,7 +159,7 @@ extern "C" void my_tzname(char* sys_timezone, size_t size)
|
||||
{
|
||||
/* TZ environment variable not set - return default timezone name*/
|
||||
UChar default_tzname[MAX_TIMEZONE_LEN];
|
||||
UErrorCode ec;
|
||||
UErrorCode ec= U_ZERO_ERROR;
|
||||
int32_t len=
|
||||
ucal_getDefaultTimeZone(default_tzname, MAX_TIMEZONE_LEN, &ec);
|
||||
if (U_SUCCESS(ec))
|
||||
|
@ -34,13 +34,9 @@
|
||||
|
||||
We try to respect use_large_pages setting, on Windows and Linux
|
||||
*/
|
||||
#ifndef _WIN32
|
||||
char *my_large_mmap(size_t *size, int prot);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
char *my_virtual_mem_reserve(size_t *size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
DWORD flags= my_use_large_pages
|
||||
? MEM_LARGE_PAGES | MEM_RESERVE | MEM_COMMIT
|
||||
: MEM_RESERVE;
|
||||
@ -53,10 +49,8 @@ char *my_virtual_mem_reserve(size_t *size)
|
||||
my_error(EE_OUTOFMEMORY, MYF(ME_BELL + ME_ERROR_LOG), *size);
|
||||
}
|
||||
return ptr;
|
||||
#else
|
||||
return my_large_mmap(size, PROT_NONE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 && !defined DBUG_OFF
|
||||
static my_bool is_memory_committed(char *ptr, size_t size)
|
||||
@ -88,7 +82,7 @@ char *my_virtual_mem_commit(char *ptr, size_t size)
|
||||
}
|
||||
#else
|
||||
if (my_use_large_pages)
|
||||
/* my_large_mmap() already created a read/write mapping. */;
|
||||
/* my_large_virtual_alloc() already created a read/write mapping. */;
|
||||
else
|
||||
{
|
||||
# ifdef _AIX
|
||||
|
@ -177,7 +177,6 @@ ELSE()
|
||||
SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null")
|
||||
ENDIF()
|
||||
|
||||
SET(HOSTNAME "uname -n")
|
||||
SET(MYSQLD_USER "mysql")
|
||||
SET(MYSQLD_GROUP "mysql")
|
||||
ENDIF(UNIX)
|
||||
|
@ -843,12 +843,22 @@ String *Item_func_hybrid_field_type::val_str_from_int_op(String *str)
|
||||
return str;
|
||||
}
|
||||
|
||||
#ifdef _M_ARM64
|
||||
/* MSVC on ARM incorrectly optimizes the code in val_real_from_int_op() */
|
||||
#pragma optimize("", off)
|
||||
#endif
|
||||
|
||||
double Item_func_hybrid_field_type::val_real_from_int_op()
|
||||
{
|
||||
longlong result= int_op();
|
||||
return unsigned_flag ? (double) ((ulonglong) result) : (double) result;
|
||||
}
|
||||
|
||||
#ifdef _M_ARM64
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
|
||||
|
||||
my_decimal *
|
||||
Item_func_hybrid_field_type::val_decimal_from_int_op(my_decimal *dec)
|
||||
{
|
||||
|
@ -343,7 +343,7 @@ static void get_service_config()
|
||||
if (!service)
|
||||
die("OpenService failed with %u", GetLastError());
|
||||
|
||||
BYTE config_buffer[8 * 1024];
|
||||
alignas(QUERY_SERVICE_CONFIGW) BYTE config_buffer[8 * 1024];
|
||||
LPQUERY_SERVICE_CONFIGW config = (LPQUERY_SERVICE_CONFIGW)config_buffer;
|
||||
DWORD size = sizeof(config_buffer);
|
||||
DWORD needed;
|
||||
|
@ -71,21 +71,7 @@ class Histogram_json_hb final : public Histogram_base
|
||||
/* Collection-time only: collected histogram in the JSON form. */
|
||||
std::string json_text;
|
||||
|
||||
struct Bucket
|
||||
{
|
||||
// The left endpoint in KeyTupleFormat. The endpoint is inclusive, this
|
||||
// value is in this bucket.
|
||||
std::string start_value;
|
||||
|
||||
// Cumulative fraction: The fraction of table rows that fall into this
|
||||
// and preceding buckets.
|
||||
double cum_fract;
|
||||
|
||||
// Number of distinct values in the bucket.
|
||||
longlong ndv;
|
||||
};
|
||||
|
||||
std::vector<Bucket> buckets;
|
||||
std::vector<Histogram_bucket> buckets;
|
||||
|
||||
std::string last_bucket_end_endp;
|
||||
|
||||
@ -129,6 +115,11 @@ public:
|
||||
double range_selectivity(Field *field, key_range *min_endp,
|
||||
key_range *max_endp, double avg_sel) override;
|
||||
|
||||
std::vector<Histogram_bucket> get_histogram() override
|
||||
{
|
||||
return buckets;
|
||||
}
|
||||
|
||||
void set_json_text(ulonglong sz, const char *json_text_arg,
|
||||
size_t json_text_len)
|
||||
{
|
||||
|
@ -712,12 +712,25 @@ void print_best_access_for_table(THD *thd, POSITION *pos)
|
||||
DBUG_ASSERT(thd->trace_started());
|
||||
|
||||
Json_writer_object obj(thd, "chosen_access_method");
|
||||
obj.
|
||||
add("type", pos->type == JT_ALL ? "scan" : join_type_str[pos->type]).
|
||||
add("rows_read", pos->records_read).
|
||||
add("rows_out", pos->records_out).
|
||||
add("cost", pos->read_time).
|
||||
add("uses_join_buffering", pos->use_join_buffer);
|
||||
|
||||
obj.add("type", pos->type == JT_ALL ? "scan" : join_type_str[pos->type]);
|
||||
|
||||
if (pos->type == JT_EQ_REF || pos->type == JT_REF || pos->type == JT_FT)
|
||||
{
|
||||
obj.add("index", pos->key->table->key_info[pos->key->key].name);
|
||||
}
|
||||
|
||||
if (pos->type == JT_RANGE)
|
||||
{
|
||||
obj.add("index",
|
||||
pos->table->table->key_info[pos->table->quick->index].name);
|
||||
}
|
||||
|
||||
obj.add("rows_read", pos->records_read)
|
||||
.add("rows_out", pos->records_out)
|
||||
.add("cost", pos->read_time)
|
||||
.add("uses_join_buffering", pos->use_join_buffer);
|
||||
|
||||
if (pos->range_rowid_filter_info)
|
||||
{
|
||||
uint key_no= pos->range_rowid_filter_info->get_key_no();
|
||||
|
@ -152,6 +152,19 @@ bool is_stat_table(const LEX_CSTRING *db, LEX_CSTRING *table);
|
||||
bool is_eits_usable(Field* field);
|
||||
|
||||
class Histogram_builder;
|
||||
struct Histogram_bucket
|
||||
{
|
||||
// The left endpoint in KeyTupleFormat. The endpoint is inclusive, this
|
||||
// value is in this bucket.
|
||||
std::string start_value;
|
||||
|
||||
// Cumulative fraction: The fraction of table rows that fall into this
|
||||
// and preceding buckets.
|
||||
double cum_fract;
|
||||
|
||||
// Number of distinct values in the bucket.
|
||||
longlong ndv;
|
||||
};
|
||||
|
||||
/*
|
||||
Common base for all histograms
|
||||
@ -199,6 +212,8 @@ public:
|
||||
double avg_sel)=0;
|
||||
virtual double range_selectivity(Field *field, key_range *min_endp,
|
||||
key_range *max_endp, double avg_sel)=0;
|
||||
virtual std::vector<Histogram_bucket> get_histogram()=0;
|
||||
|
||||
/*
|
||||
Legacy: return the size of the histogram on disk.
|
||||
|
||||
@ -355,6 +370,11 @@ public:
|
||||
*/
|
||||
double point_selectivity(Field *field, key_range *endpoint,
|
||||
double avg_sel) override;
|
||||
|
||||
std::vector<Histogram_bucket> get_histogram() override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -276,7 +276,7 @@ ATTRIBUTE_COLD void btr_search_enable(bool resize)
|
||||
}
|
||||
|
||||
btr_search_x_lock_all();
|
||||
ulint hash_size = buf_pool.curr_size() / sizeof(void *) / 64;
|
||||
ulint hash_size = buf_pool.curr_pool_size() / sizeof(void *) / 64;
|
||||
|
||||
if (btr_search_sys.parts[0].heap) {
|
||||
ut_ad(btr_search_enabled);
|
||||
|
@ -637,7 +637,7 @@ func_exit:
|
||||
buf_buddy_add_to_free(reinterpret_cast<buf_buddy_free_t*>(buf), i);
|
||||
}
|
||||
|
||||
/** Reallocate a ROW_FORMAT=COMPRESSED page frame during buf_pool_t::resize().
|
||||
/** Reallocate a ROW_FORMAT=COMPRESSED page frame during buf_pool_t::shrink().
|
||||
@param bpage page descriptor covering a ROW_FORMAT=COMPRESSED page
|
||||
@param block uncompressed block for storage
|
||||
@return block
|
||||
@ -672,10 +672,9 @@ buf_block_t *buf_buddy_shrink(buf_page_t *bpage, buf_block_t *block) noexcept
|
||||
bpage->zip.data= static_cast<page_zip_t*>(dst);
|
||||
buf_pool.buddy_stat[i].relocated++;
|
||||
|
||||
for (;;)
|
||||
while (i < BUF_BUDDY_SIZES)
|
||||
{
|
||||
MEM_UNDEFINED(src, BUF_BUDDY_LOW << i);
|
||||
ut_ad(i < BUF_BUDDY_SIZES);
|
||||
/* Try to combine adjacent blocks. */
|
||||
buf_buddy_free_t *buddy= reinterpret_cast<buf_buddy_free_t*>
|
||||
(buf_buddy_get(static_cast<byte*>(src), BUF_BUDDY_LOW << i));
|
||||
@ -684,20 +683,16 @@ buf_block_t *buf_buddy_shrink(buf_page_t *bpage, buf_block_t *block) noexcept
|
||||
{
|
||||
ut_ad(!buf_pool.contains_zip(src, BUF_BUDDY_LOW_SHIFT + i));
|
||||
buf_buddy_add_to_free(static_cast<buf_buddy_free_t*>(src), i);
|
||||
break;
|
||||
return block;
|
||||
}
|
||||
|
||||
/* The buddy is free: recombine */
|
||||
buf_buddy_remove_from_free(buddy, i);
|
||||
i++;
|
||||
src= ut_align_down(src, BUF_BUDDY_LOW << i);
|
||||
if (i == BUF_BUDDY_SIZES)
|
||||
{
|
||||
buf_buddy_block_free(src);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
buf_buddy_block_free(src);
|
||||
return block;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,11 @@ bool buf_pool_t::create() noexcept
|
||||
retry:
|
||||
{
|
||||
NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE;
|
||||
#ifdef _WIN32
|
||||
memory_unaligned= my_virtual_mem_reserve(&size);
|
||||
#else
|
||||
memory_unaligned= my_large_virtual_alloc(&size);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!memory_unaligned)
|
||||
@ -1368,6 +1372,7 @@ bool buf_pool_t::create() noexcept
|
||||
#ifdef UNIV_PFS_MEMORY
|
||||
PSI_MEMORY_CALL(memory_alloc)(mem_key_buf_buf_pool, actual_size, &owner);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
if (!my_virtual_mem_commit(memory, actual_size))
|
||||
{
|
||||
my_virtual_mem_release(memory_unaligned, size_unaligned);
|
||||
@ -1375,6 +1380,9 @@ bool buf_pool_t::create() noexcept
|
||||
memory_unaligned= nullptr;
|
||||
goto oom;
|
||||
}
|
||||
#else
|
||||
update_malloc_size(actual_size, 0);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBNUMA
|
||||
if (srv_numa_interleave)
|
||||
@ -1786,6 +1794,9 @@ ATTRIBUTE_COLD buf_pool_t::shrink_status buf_pool_t::shrink(size_t size)
|
||||
goto next;
|
||||
}
|
||||
|
||||
if (UT_LIST_GET_LEN(free) + UT_LIST_GET_LEN(LRU) < usable_size() / 20)
|
||||
return SHRINK_ABORT;
|
||||
|
||||
mysql_mutex_lock(&flush_list_mutex);
|
||||
|
||||
if (LRU_warned && !UT_LIST_GET_FIRST(free))
|
||||
|
@ -276,7 +276,10 @@ static void buf_LRU_check_size_of_non_data_objects() noexcept
|
||||
|
||||
auto s= UT_LIST_GET_LEN(buf_pool.free) + UT_LIST_GET_LEN(buf_pool.LRU);
|
||||
|
||||
if (s < curr_size / 20)
|
||||
if (s >= curr_size / 20);
|
||||
else if (buf_pool.is_shrinking())
|
||||
buf_pool.LRU_warn();
|
||||
else
|
||||
{
|
||||
sql_print_error("[FATAL] InnoDB: Over 95 percent of the buffer pool is"
|
||||
" occupied by lock heaps"
|
||||
|
@ -933,7 +933,7 @@ void dict_sys_t::create() noexcept
|
||||
UT_LIST_INIT(table_LRU, &dict_table_t::table_LRU);
|
||||
UT_LIST_INIT(table_non_LRU, &dict_table_t::table_LRU);
|
||||
|
||||
const ulint hash_size = buf_pool.curr_size()
|
||||
const ulint hash_size = buf_pool.curr_pool_size()
|
||||
/ (DICT_POOL_PER_TABLE_HASH * UNIV_WORD_SIZE);
|
||||
|
||||
table_hash.create(hash_size);
|
||||
@ -4364,7 +4364,7 @@ void dict_sys_t::resize() noexcept
|
||||
table_id_hash.free();
|
||||
temp_id_hash.free();
|
||||
|
||||
const ulint hash_size = buf_pool.curr_size()
|
||||
const ulint hash_size = buf_pool.curr_pool_size()
|
||||
/ (DICT_POOL_PER_TABLE_HASH * UNIV_WORD_SIZE);
|
||||
table_hash.create(hash_size);
|
||||
table_id_hash.create(hash_size);
|
||||
|
@ -4040,7 +4040,6 @@ skip_buffering_tweak:
|
||||
srv_use_native_aio= FALSE;
|
||||
#endif
|
||||
|
||||
srv_lock_table_size= 5 * buf_pool.curr_size();
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ inline void buf_buddy_free(void* buf, ulint size) noexcept
|
||||
}
|
||||
|
||||
ATTRIBUTE_COLD MY_ATTRIBUTE((nonnull, warn_unused_result))
|
||||
/** Reallocate a ROW_FORMAT=COMPRESSED page frame during buf_pool_t::resize().
|
||||
/** Reallocate a ROW_FORMAT=COMPRESSED page frame during buf_pool_t::shrink().
|
||||
@param bpage page descriptor covering a ROW_FORMAT=COMPRESSED page
|
||||
@param block uncompressed block for storage
|
||||
@return block
|
||||
|
@ -918,17 +918,16 @@ ATTRIBUTE_COLD void log_t::append_prepare_wait(bool late, bool ex) noexcept
|
||||
{
|
||||
got_ex:
|
||||
const uint64_t l= write_lsn_offset.load(std::memory_order_relaxed);
|
||||
const lsn_t lsn{base_lsn.load(std::memory_order_relaxed)};
|
||||
ut_d(lsn_t ll= lsn + (l & (WRITE_BACKOFF - 1)));
|
||||
ut_ad(is_mmap()
|
||||
? ll - get_flushed_lsn(std::memory_order_relaxed) < capacity()
|
||||
: ll - write_lsn - ((write_size - 1) & (write_lsn - first_lsn)) <
|
||||
buf_size);
|
||||
const lsn_t lsn= base_lsn.load(std::memory_order_relaxed) +
|
||||
(l & (WRITE_BACKOFF - 1));
|
||||
waits++;
|
||||
#ifdef HAVE_PMEM
|
||||
const bool is_pmem{is_mmap()};
|
||||
if (is_pmem)
|
||||
persist(lsn + (l & (WRITE_BACKOFF - 1)));
|
||||
{
|
||||
ut_ad(lsn - get_flushed_lsn(std::memory_order_relaxed) < capacity());
|
||||
persist(lsn);
|
||||
}
|
||||
#endif
|
||||
latch.wr_unlock();
|
||||
/* write_buf() or persist() will clear the WRITE_BACKOFF flag,
|
||||
@ -936,7 +935,7 @@ ATTRIBUTE_COLD void log_t::append_prepare_wait(bool late, bool ex) noexcept
|
||||
#ifdef HAVE_PMEM
|
||||
if (!is_pmem)
|
||||
#endif
|
||||
log_write_up_to(lsn + (l & (WRITE_BACKOFF - 1)), false);
|
||||
log_write_up_to(lsn, false);
|
||||
if (ex)
|
||||
{
|
||||
latch.wr_lock(SRW_LOCK_CALL);
|
||||
|
@ -1396,7 +1396,7 @@ dberr_t srv_start(bool create_new_db)
|
||||
|
||||
log_sys.create();
|
||||
recv_sys.create();
|
||||
lock_sys.create(srv_lock_table_size);
|
||||
lock_sys.create(srv_lock_table_size = 5 * buf_pool.curr_size());
|
||||
|
||||
srv_startup_is_before_trx_rollback_phase = true;
|
||||
|
||||
|
@ -48,6 +48,8 @@ ut_find_prime(
|
||||
ulint pow2;
|
||||
ulint i;
|
||||
|
||||
ut_ad(n);
|
||||
|
||||
n += 100;
|
||||
|
||||
pow2 = 1;
|
||||
|
@ -31,7 +31,6 @@ ELSE()
|
||||
SET(MYSQLD_USER "mysql")
|
||||
SET(MYSQLD_GROUP "mysql")
|
||||
SET(ini_file_extension "cnf")
|
||||
SET(HOSTNAME "uname -n")
|
||||
|
||||
# Define directly here, as cmake/install_layout.cmake has no LOGDIR to be inherited
|
||||
SET(su_user "su mysql mysql")
|
||||
|
Loading…
x
Reference in New Issue
Block a user