1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2022-10-06 09:22:39 +03:00
117 changed files with 1038 additions and 600 deletions

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2000, 2015, Oracle and/or its affiliates. Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2011, 2017, MariaDB Copyright (c) 2011, 2022, MariaDB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -382,11 +382,7 @@ static int write_to_table(char *filename, MYSQL *mysql)
{ {
if (verbose) if (verbose)
fprintf(stdout, "Deleting the old data from table %s\n", tablename); fprintf(stdout, "Deleting the old data from table %s\n", tablename);
#ifdef HAVE_SNPRINTF
snprintf(sql_statement, FN_REFLEN*16+256, "DELETE FROM %s", tablename); snprintf(sql_statement, FN_REFLEN*16+256, "DELETE FROM %s", tablename);
#else
sprintf(sql_statement, "DELETE FROM %s", tablename);
#endif
if (mysql_query(mysql, sql_statement)) if (mysql_query(mysql, sql_statement))
{ {
db_error_with_table(mysql, tablename); db_error_with_table(mysql, tablename);

View File

@ -221,7 +221,6 @@
#cmakedefine HAVE_SIGWAIT 1 #cmakedefine HAVE_SIGWAIT 1
#cmakedefine HAVE_SIGWAITINFO 1 #cmakedefine HAVE_SIGWAITINFO 1
#cmakedefine HAVE_SLEEP 1 #cmakedefine HAVE_SLEEP 1
#cmakedefine HAVE_SNPRINTF 1
#cmakedefine HAVE_STPCPY 1 #cmakedefine HAVE_STPCPY 1
#cmakedefine HAVE_STRERROR 1 #cmakedefine HAVE_STRERROR 1
#cmakedefine HAVE_STRCOLL 1 #cmakedefine HAVE_STRCOLL 1

View File

@ -406,7 +406,6 @@ CHECK_FUNCTION_EXISTS (sigwait HAVE_SIGWAIT)
CHECK_FUNCTION_EXISTS (sigwaitinfo HAVE_SIGWAITINFO) CHECK_FUNCTION_EXISTS (sigwaitinfo HAVE_SIGWAITINFO)
CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET) CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET)
CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP) CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP)
CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY) CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY)
CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL) CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL)
CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR) CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR)

View File

@ -22,4 +22,3 @@ eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
--replace_result ::1 localhost --replace_result ::1 localhost
SELECT USER(); SELECT USER();
eval DROP USER testuser1@'$IPv6'; eval DROP USER testuser1@'$IPv6';

View File

@ -2,3 +2,5 @@
# We can use this to schedule such test early (to not be left with # We can use this to schedule such test early (to not be left with
# only one or two long tests running, and rests of works idle), or to # only one or two long tests running, and rests of works idle), or to
# run a quick test skipping long-running test cases. # run a quick test skipping long-running test cases.
--source include/no_valgrind_without_big.inc

View File

@ -1,3 +1,5 @@
--source include/no_valgrind_without_big.inc
# ==== Purpose ==== # ==== Purpose ====
# #
# Configure two servers to be replication master and slave. # Configure two servers to be replication master and slave.

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc --source include/have_innodb.inc
# #
# Test of alter table # Test of alter table

View File

@ -1,6 +1,8 @@
# Turn on compression between the client and server # Turn on compression between the client and server
# and run a number of tests # and run a number of tests
# Too slow for valgrind
--source include/no_valgrind_without_big.inc
# Can't test with embedded server # Can't test with embedded server
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_compress.inc -- source include/have_compress.inc

View File

@ -1,3 +1,4 @@
-- source include/no_valgrind_without_big.inc
-- source include/have_big5.inc -- source include/have_big5.inc
# #

View File

@ -1,3 +1,4 @@
-- source include/no_valgrind_without_big.inc
-- source include/have_gb2312.inc -- source include/have_gb2312.inc
# #

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
-- source include/have_gbk.inc -- source include/have_gbk.inc
# #

View File

@ -1,3 +1,4 @@
-- source include/no_valgrind_without_big.inc
-- source include/have_sjis.inc -- source include/have_sjis.inc
# #

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
# #
# Tests with the utf8 character set # Tests with the utf8 character set
# #

View File

@ -1,6 +1,6 @@
--source include/no_valgrind_without_big.inc
--source include/have_geometry.inc --source include/have_geometry.inc
# #
# Spatial objects # Spatial objects
# #

View File

@ -3,6 +3,7 @@
# The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT. # The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT.
# #
--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc --source include/default_optimizer_switch.inc
--source include/have_sequence.inc --source include/have_sequence.inc
--source include/have_innodb.inc --source include/have_innodb.inc

View File

@ -11,6 +11,7 @@
# #
# Slow test, don't run during staging part # Slow test, don't run during staging part
--source include/long_test.inc
--source include/not_staging.inc --source include/not_staging.inc
--source include/have_innodb.inc --source include/have_innodb.inc

View File

@ -9,6 +9,7 @@
# wrapper t/index_merge_innodb.test sources now several # wrapper t/index_merge_innodb.test sources now several
# include/index_merge*.inc files # include/index_merge*.inc files
# #
--source include/no_valgrind_without_big.inc
SET DEFAULT_STORAGE_ENGINE = MyISAM; SET DEFAULT_STORAGE_ENGINE = MyISAM;
# MyISAM supports Merge tables # MyISAM supports Merge tables

View File

@ -2,6 +2,7 @@
# information_schema_db.test whose results depends on which engines are # information_schema_db.test whose results depends on which engines are
# available (since these engines inject tables into INFORMATION_SCHEMA). # available (since these engines inject tables into INFORMATION_SCHEMA).
--source include/no_valgrind_without_big.inc
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_perfschema.inc --source include/have_perfschema.inc

View File

@ -1,4 +1,5 @@
--source include/innodb_prefix_index_cluster_optimization.inc --source include/innodb_prefix_index_cluster_optimization.inc
--source include/no_valgrind_without_big.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';

View File

@ -1,9 +1,11 @@
--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc
--source include/default_charset.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
DROP DATABASE IF EXISTS world; DROP DATABASE IF EXISTS world;
--enable_warnings --enable_warnings
--source include/default_optimizer_switch.inc
--source include/default_charset.inc
set @org_optimizer_switch=@@optimizer_switch; set @org_optimizer_switch=@@optimizer_switch;
set @save_join_cache_level=@@join_cache_level; set @save_join_cache_level=@@join_cache_level;

View File

@ -1,3 +1,5 @@
--source include/no_valgrind_without_big.inc
# #
# Testing of slow log query options # Testing of slow log query options
# #

View File

@ -3,6 +3,7 @@
# No need to run this with embedded server # No need to run this with embedded server
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/check_ipv6.inc --source include/check_ipv6.inc
--source include/no_valgrind_without_big.inc
# need to have the dynamic loading turned on for the client plugin tests # need to have the dynamic loading turned on for the client plugin tests
--source include/have_plugin_auth.inc --source include/have_plugin_auth.inc

View File

@ -2,6 +2,7 @@
-- source include/have_working_dns.inc -- source include/have_working_dns.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_partition.inc -- source include/have_partition.inc
-- source include/no_valgrind_without_big.inc
set sql_mode=""; set sql_mode="";

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_utf8mb4.inc --source include/have_utf8mb4.inc
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)"); call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
# #
# Testing ORDER BY # Testing ORDER BY
# #

View File

@ -2,6 +2,7 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/mysql_upgrade_preparation.inc --source include/mysql_upgrade_preparation.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
SET GLOBAL SQL_MODE=""; SET GLOBAL SQL_MODE="";
SET LOCAL SQL_MODE=""; SET LOCAL SQL_MODE="";

View File

@ -4,10 +4,11 @@
-- source include/have_pool_of_threads.inc -- source include/have_pool_of_threads.inc
-- source include/default_optimizer_switch.inc -- source include/default_optimizer_switch.inc
SET optimizer_switch='outer_join_with_cache=off';
# Slow test, don't run during staging part # Slow test, don't run during staging part
-- source include/not_staging.inc -- source include/not_staging.inc
-- source include/long_test.inc -- source include/long_test.inc
SET optimizer_switch='outer_join_with_cache=off';
-- source include/common-tests.inc -- source include/common-tests.inc
SET optimizer_switch=default; SET optimizer_switch=default;

View File

@ -1,5 +1,6 @@
-- source include/have_query_cache.inc -- source include/have_query_cache.inc
-- source include/long_test.inc -- source include/long_test.inc
-- source include/no_valgrind_without_big.inc
set @save_query_cache_size=@@query_cache_size; set @save_query_cache_size=@@query_cache_size;
# #

View File

@ -2,6 +2,7 @@
--source include/have_query_cache.inc --source include/have_query_cache.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/long_test.inc --source include/long_test.inc
--source include/no_valgrind_without_big.inc
set global query_cache_type= ON; set global query_cache_type= ON;
set @save_query_cache_size=@@global.query_cache_size; set @save_query_cache_size=@@global.query_cache_size;

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
# #
# Problem with range optimizer # Problem with range optimizer
# #

View File

@ -4,6 +4,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_debug.inc --source include/have_debug.inc
--source include/no_valgrind_without_big.inc
--disable_warnings --disable_warnings
drop table if exists t0, t1, t2; drop table if exists t0, t1, t2;

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc --source include/default_optimizer_switch.inc
--source include/default_charset.inc --source include/default_charset.inc
--source include/have_sequence.inc --source include/have_sequence.inc

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc --source include/have_innodb.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';

View File

@ -1,4 +1,5 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
set default_storage_engine=innodb; set default_storage_engine=innodb;
--source include/rowid_filter_debug_kill.inc --source include/rowid_filter_debug_kill.inc

View File

@ -2,6 +2,8 @@
# Find string "NOTE NOTE NOTE" in order to find some 'unsure' tests # Find string "NOTE NOTE NOTE" in order to find some 'unsure' tests
# #
--source include/no_valgrind_without_big.inc
# #
# Simple select test # Simple select test
# #

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc --source include/have_stat_tables.inc
--source include/have_sequence.inc --source include/have_sequence.inc
--source include/default_charset.inc --source include/default_charset.inc

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_partition.inc --source include/have_partition.inc
--source include/have_sequence.inc --source include/have_sequence.inc

View File

@ -6,6 +6,7 @@
-- source include/have_64bit.inc -- source include/have_64bit.inc
# No point in running with valgrind as it takes 1.5 hours # No point in running with valgrind as it takes 1.5 hours
-- source include/not_valgrind.inc -- source include/not_valgrind.inc
# This test often times out with MemorySanitizer.
-- source include/not_msan.inc -- source include/not_msan.inc
# Save the initial number of concurrent sessions # Save the initial number of concurrent sessions

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
# Turn on ssl between the client and server # Turn on ssl between the client and server
# and run a number of tests # and run a number of tests

View File

@ -4,7 +4,9 @@ set @innodb_stats_persistent_sample_pages_save=
set global innodb_stats_persistent= 1; set global innodb_stats_persistent= 1;
set global innodb_stats_persistent_sample_pages=100; set global innodb_stats_persistent_sample_pages=100;
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_sequence.inc --source include/have_sequence.inc

View File

@ -1,6 +1,7 @@
# Note that this test requires a fresh restart to not have problems with the # Note that this test requires a fresh restart to not have problems with the
# old status values # old status values
--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc --source include/have_stat_tables.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/not_embedded.inc --source include/not_embedded.inc

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc --source include/have_stat_tables.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--disable_warnings --disable_warnings

View File

@ -1,3 +1,4 @@
-- source include/no_valgrind_without_big.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
# Note: the tests uses only non-semijoin subqueries so semi-join switch # Note: the tests uses only non-semijoin subqueries so semi-join switch

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
# #
# Nested Loops semi-join subquery evaluation tests # Nested Loops semi-join subquery evaluation tests
# #

View File

@ -1,6 +1,7 @@
# #
# Run subselect_sj.test with BKA enabled # Run subselect_sj.test with BKA enabled
# #
--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc --source include/default_optimizer_switch.inc
set @save_optimizer_switch_jcl6=@@optimizer_switch; set @save_optimizer_switch_jcl6=@@optimizer_switch;

View File

@ -1,5 +1,6 @@
# This test uses chmod, can't be run with root permissions # This test uses chmod, can't be run with root permissions
-- source include/not_as_root.inc -- source include/not_as_root.inc
-- source include/no_valgrind_without_big.inc
-- source include/default_charset.inc -- source include/default_charset.inc
# #

View File

@ -1,5 +1,6 @@
--source include/have_sequence.inc --source include/have_sequence.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=InnoDB STATS_PERSISTENT=0; create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=InnoDB STATS_PERSISTENT=0;
create view v1 as select * from t1 where c2=2; create view v1 as select * from t1 where c2=2;

View File

@ -1,6 +1,7 @@
# #
# Window Functions Tests # Window Functions Tests
# #
--source include/no_valgrind_without_big.inc
--source include/have_sequence.inc --source include/have_sequence.inc
--disable_warnings --disable_warnings

View File

@ -1,3 +1,5 @@
--source include/no_valgrind_without_big.inc
set max_recursive_iterations=200000; set max_recursive_iterations=200000;
create table test_table (id int, random_data varchar(36), static_int int, static_varchar varchar(10)); create table test_table (id int, random_data varchar(36), static_int int, static_varchar varchar(10));

View File

@ -4,11 +4,31 @@
# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status' # It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
# and fill them on every membership or node status change. # and fill them on every membership or node status change.
# #
# Edit parameters below to specify the address and login to server. # Edit parameters below to specify the address and login to server:
#
USER=root USER=root
PSWD=
#
# If these parameters are not set, then the values
# passed by the server are taken:
#
HOST=127.0.0.1 HOST=127.0.0.1
PORT=$NODE_MYPORT_1 PORT=$NODE_MYPORT_1
#
# Edit parameters below to specify SSL parameters:
#
ssl_key=
ssl_cert=
ssl_ca=
ssl_capath=
ssl_cipher=
ssl_crl=
ssl_crlpath=
ssl_verify_server_cert=0
#
# Client executable path:
#
CLIENT="$EXE_MYSQL"
SCHEMA="mtr_wsrep_notify" SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
@ -40,7 +60,7 @@ configuration_change()
local idx=0 local idx=0
for NODE in $(echo $MEMBERS | sed s/,/\ /g) for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
do do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values # Don't forget to properly quote string values
@ -59,17 +79,44 @@ status_update()
echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;" echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string()
{
if [ -n "${BASH_VERSION:-}" ]; then
local pattern="[![:space:]${2:-}]"
local x="${1#*$pattern}"
local z=${#1}
x=${#x}
if [ $x -ne $z ]; then
local y="${1%$pattern*}"
y=${#y}
x=$(( z-x-1 ))
y=$(( y-x+1 ))
printf '%s' "${1:$x:$y}"
else
printf ''
fi
else
local pattern="[[:space:]${2:-}]"
echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
fi
}
COM=status_update # not a configuration change by default COM=status_update # not a configuration change by default
while [ $# -gt 0 ] STATUS=""
do CLUSTER_UUID=""
PRIMARY="0"
INDEX=""
MEMBERS=""
while [ $# -gt 0 ]; do
case $1 in case $1 in
--status) --status)
STATUS=$2 STATUS=$(trim_string "$2")
shift shift
;; ;;
--uuid) --uuid)
CLUSTER_UUID=$2 CLUSTER_UUID=$(trim_string "$2")
shift shift
;; ;;
--primary) --primary)
@ -78,22 +125,75 @@ do
shift shift
;; ;;
--index) --index)
INDEX=$2 INDEX=$(trim_string "$2")
shift shift
;; ;;
--members) --members)
MEMBERS=$2 MEMBERS=$(trim_string "$2")
shift shift
;; ;;
esac esac
shift shift
done done
case $STATUS in USER=$(trim_string "$USER")
"joined" | "donor" | "synced") PSWD=$(trim_string "$PSWD")
$COM | mysql -B -u$USER -h$HOST -P$PORT
;; HOST=$(trim_string "$HOST")
*) PORT=$(trim_string "$PORT")
exit 0
case "$HOST" in
\[*)
HOST="${HOST##\[}"
HOST=$(trim_string "${HOST%%\]}")
;; ;;
esac esac
if [ -z "$HOST" ]; then
HOST="${NOTIFY_HOST:-}"
fi
if [ -z "$PORT" ]; then
PORT="${NOTIFY_PORT:-}"
fi
ssl_key=$(trim_string "$ssl_key");
ssl_cert=$(trim_string "$ssl_cert");
ssl_ca=$(trim_string "$ssl_ca");
ssl_capath=$(trim_string "$ssl_capath");
ssl_cipher=$(trim_string "$ssl_cipher");
ssl_crl=$(trim_string "$ssl_crl");
ssl_crlpath=$(trim_string "$ssl_crlpath");
ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
then
SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
[ -n "$ssl_cert" ] && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
[ -n "$ssl_ca" ] && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
[ -n "$ssl_capath" ] && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
[ -n "$ssl_cipher" ] && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then
SSL_PARAM+=' --ssl-verify-server-cert'
fi
fi
fi
case $STATUS in
"joined" | "donor" | "synced")
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM
;;
*)
# The node might be shutting down
;;
esac
exit 0

View File

@ -0,0 +1,195 @@
#!/bin/sh -eu
# This is a simple example of wsrep notification script (wsrep_notify_cmd).
# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
# and fill them on every membership or node status change.
#
# Edit parameters below to specify the address and login to server:
#
USER=root
PSWD=
#
# If these parameters are not set, then the values
# passed by the server are taken:
#
HOST=127.0.0.1
PORT=$NODE_MYPORT_1
#
# Edit parameters below to specify SSL parameters:
#
ssl_cert="$MYSQL_TEST_DIR/std_data/client-cert.pem"
ssl_key="$MYSQL_TEST_DIR/std_data/client-key.pem"
ssl_ca="$MYSQL_TEST_DIR/std_data/cacert.pem"
ssl_capath=
ssl_cipher=
ssl_crl=
ssl_crlpath=
ssl_verify_server_cert=0
#
# Client executable path:
#
CLIENT="$EXE_MYSQL"
SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status"
BEGIN="
SET wsrep_on=0;
CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT,
uuid CHAR(40), /* node UUID */
name VARCHAR(32), /* node name */
addr VARCHAR(256) /* node address */
) ENGINE=MEMORY;
CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
size INT, /* component size */
idx INT, /* this node index */
status CHAR(16), /* this node status */
uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY;
BEGIN;
"
END="COMMIT;"
configuration_change()
{
echo "$BEGIN;"
local idx=0
for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g
echo ");"
idx=$(( $idx + 1 ))
done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END"
}
status_update()
{
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
}
trim_string()
{
if [ -n "${BASH_VERSION:-}" ]; then
local pattern="[![:space:]${2:-}]"
local x="${1#*$pattern}"
local z=${#1}
x=${#x}
if [ $x -ne $z ]; then
local y="${1%$pattern*}"
y=${#y}
x=$(( z-x-1 ))
y=$(( y-x+1 ))
printf '%s' "${1:$x:$y}"
else
printf ''
fi
else
local pattern="[[:space:]${2:-}]"
echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
fi
}
COM=status_update # not a configuration change by default
STATUS=""
CLUSTER_UUID=""
PRIMARY="0"
INDEX=""
MEMBERS=""
while [ $# -gt 0 ]; do
case $1 in
--status)
STATUS=$(trim_string "$2")
shift
;;
--uuid)
CLUSTER_UUID=$(trim_string "$2")
shift
;;
--primary)
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0"
COM=configuration_change
shift
;;
--index)
INDEX=$(trim_string "$2")
shift
;;
--members)
MEMBERS=$(trim_string "$2")
shift
;;
esac
shift
done
USER=$(trim_string "$USER")
PSWD=$(trim_string "$PSWD")
HOST=$(trim_string "$HOST")
PORT=$(trim_string "$PORT")
case "$HOST" in
\[*)
HOST="${HOST##\[}"
HOST=$(trim_string "${HOST%%\]}")
;;
esac
if [ -z "$HOST" ]; then
HOST="${NOTIFY_HOST:-}"
fi
if [ -z "$PORT" ]; then
PORT="${NOTIFY_PORT:-}"
fi
ssl_key=$(trim_string "$ssl_key");
ssl_cert=$(trim_string "$ssl_cert");
ssl_ca=$(trim_string "$ssl_ca");
ssl_capath=$(trim_string "$ssl_capath");
ssl_cipher=$(trim_string "$ssl_cipher");
ssl_crl=$(trim_string "$ssl_crl");
ssl_crlpath=$(trim_string "$ssl_crlpath");
ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
then
SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
[ -n "$ssl_cert" ] && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
[ -n "$ssl_ca" ] && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
[ -n "$ssl_capath" ] && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
[ -n "$ssl_cipher" ] && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then
SSL_PARAM+=' --ssl-verify-server-cert'
fi
fi
fi
# Undefined means node is shutting down
if [ "$STATUS" != 'Undefined' ]; then
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM
fi
exit 0

View File

@ -1,5 +1,6 @@
--source have_federatedx.inc --source have_federatedx.inc
--source include/federated.inc --source include/federated.inc
--source include/no_valgrind_without_big.inc
connection default; connection default;

View File

@ -29,6 +29,7 @@ galera_var_dirty_reads : MDEV-25615 Galera test failure on galera_var_dirty_read
galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state
galera_var_node_address : MDEV-20485 Galera test failure galera_var_node_address : MDEV-20485 Galera test failure
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_notify_ssl_ipv6 : hangs after the merge of MDEV-27682
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
partition : MDEV-19958 Galera test failure on galera.partition partition : MDEV-19958 Galera test failure on galera.partition

View File

@ -0,0 +1,11 @@
connection node_1;
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
EXPECT_2
2
SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
EXPECT_2
2
SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
EXPECT_2
2
DROP SCHEMA mtr_wsrep_notify;

View File

@ -0,0 +1 @@
--wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify_ssl.sh --wsrep-sync-wait=0

View File

@ -0,0 +1,20 @@
!include ../galera_2nodes.cnf
[mysqld]
ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
bind-address=::
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_address=::1
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'

View File

@ -0,0 +1,20 @@
#
# Test wsrep_notify_cmd. We use a version of the support-files/wsrep_notify.sh script that writes
# notifications into a table.
#
--source include/galera_cluster.inc
--source include/have_ssl_communication.inc
--source include/check_ipv6.inc
--source include/force_restart.inc
--connection node_1
--let $wait_condition = SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
--source include/wait_condition.inc
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
# CLEANUP
DROP SCHEMA mtr_wsrep_notify;

View File

@ -150,10 +150,7 @@ lock table t write;
connection prevent_purge; connection prevent_purge;
commit; commit;
connection default; connection default;
InnoDB 0 transactions not purged
disconnect lock_table; disconnect lock_table;
start transaction with consistent snapshot;
commit;
InnoDB 0 transactions not purged InnoDB 0 transactions not purged
set global debug_dbug=@old_dbug; set global debug_dbug=@old_dbug;
drop table t; drop table t;

View File

@ -191,10 +191,7 @@ lock table t write;
connection prevent_purge; connection prevent_purge;
commit; commit;
connection default; connection default;
--source ../../innodb/include/wait_all_purged.inc
disconnect lock_table; disconnect lock_table;
start transaction with consistent snapshot;
commit;
--source ../../innodb/include/wait_all_purged.inc --source ../../innodb/include/wait_all_purged.inc
set global debug_dbug=@old_dbug; set global debug_dbug=@old_dbug;
drop table t; drop table t;

View File

@ -154,4 +154,19 @@ WHERE LOWER(variable_name) LIKE 'INNODB_BUFFER_POOL_PAGES_FLUSHED';
# FLUSH TABLES t1 FOR EXPORT; # FLUSH TABLES t1 FOR EXPORT;
# UNLOCK TABLES; # UNLOCK TABLES;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-29666 InnoDB fails to purge secondary index records
# when indexed virtual columns exist
#
CREATE TABLE t1 (a INT, b INT, a1 INT AS(a) VIRTUAL,
INDEX(a1),INDEX(b)) ENGINE=InnoDB;
INSERT INTO t1 SET a=1, b=1;
UPDATE t1 SET a=2, b=3;
InnoDB 0 transactions not purged
FLUSH TABLE t1 FOR EXPORT;
page 4: N_RECS=0x0001
page 5: N_RECS=0x0001
UNLOCK TABLES;
DROP TABLE t1;
# End of 10.3 tests
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -5,6 +5,8 @@
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/have_sequence.inc --source include/have_sequence.inc
# This test often times out with MemorySanitizer.
--source include/not_msan.inc
CREATE TABLE t1(f1 char(200), f2 char(200), f3 char(200), CREATE TABLE t1(f1 char(200), f2 char(200), f3 char(200),
f4 char(200), f5 char(200), f6 char(200), f4 char(200), f5 char(200), f6 char(200),

View File

@ -1,5 +1,6 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/innodb_page_size.inc --source include/innodb_page_size.inc
--source include/no_valgrind_without_big.inc
--echo # --echo #
--echo # Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING --echo # Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING

View File

@ -1,6 +1,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
# Restarting is not supported when testing the embedded server. # Restarting is not supported when testing the embedded server.
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/no_valgrind_without_big.inc
--echo # --echo #
--echo # MDEV-6076 Persistent AUTO_INCREMENT for InnoDB --echo # MDEV-6076 Persistent AUTO_INCREMENT for InnoDB

View File

@ -1,4 +1,5 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
# innodb_change_buffering_debug option is debug only # innodb_change_buffering_debug option is debug only
--source include/have_debug.inc --source include/have_debug.inc
# Embedded server tests do not support restarting # Embedded server tests do not support restarting

View File

@ -2,6 +2,8 @@
--source include/default_charset.inc --source include/default_charset.inc
# need to restart server # need to restart server
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/no_valgrind_without_big.inc
CREATE SCHEMA `repro`; CREATE SCHEMA `repro`;
CREATE TABLE `repro`.`crew` ( CREATE TABLE `repro`.`crew` (

View File

@ -1,5 +1,6 @@
# MDEV-6424: Mariadb server crashes with assertion failure in file ha_innodb.cc # MDEV-6424: Mariadb server crashes with assertion failure in file ha_innodb.cc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
# DEBUG_SYNC must be compiled in. # DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc --source include/have_debug_sync.inc

View File

@ -1,4 +1,5 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
# #
# Test that mysqld does not crash when running ANALYZE TABLE with # Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_transient_sample_pages. # different values of the parameter innodb_stats_transient_sample_pages.

View File

@ -1,5 +1,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_innodb_punchhole.inc --source include/have_innodb_punchhole.inc
--source include/no_valgrind_without_big.inc
--disable_query_log --disable_query_log
--disable_warnings --disable_warnings

View File

@ -1,4 +1,5 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
# Test for Bug #30423, InnoDBs treatment of NULL in index stats causes # Test for Bug #30423, InnoDBs treatment of NULL in index stats causes
# bad "rows examined" estimates. # bad "rows examined" estimates.
# Implemented InnoDB system variable "innodb_stats_method" with # Implemented InnoDB system variable "innodb_stats_method" with

View File

@ -1,4 +1,5 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/no_valgrind_without_big.inc
create table bug53290 (x bigint) engine=innodb; create table bug53290 (x bigint) engine=innodb;

View File

@ -1,5 +1,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_innodb_16k.inc --source include/have_innodb_16k.inc
--source include/no_valgrind_without_big.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Upgrade after a crash is not supported"); call mtr.add_suppression("InnoDB: Upgrade after a crash is not supported");

View File

@ -3,6 +3,7 @@
--echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES --echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Could not create undo tablespace.*undo002"); call mtr.add_suppression("InnoDB: Could not create undo tablespace.*undo002");

View File

@ -2,7 +2,7 @@
# Test the detection of duplicate tablespaces. # Test the detection of duplicate tablespaces.
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/not_valgrind.inc --source include/no_valgrind_without_big.inc
# Embedded server does not support crashing # Embedded server does not support crashing
--source include/not_embedded.inc --source include/not_embedded.inc

View File

@ -4,6 +4,7 @@
--source include/not_embedded.inc --source include/not_embedded.inc
#Windows has trouble creating files/directories with long names #Windows has trouble creating files/directories with long names
--source include/not_windows.inc --source include/not_windows.inc
--source include/no_valgrind_without_big.inc
--echo # --echo #
--echo # Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND" --echo # Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"

View File

@ -139,4 +139,36 @@ WHERE LOWER(variable_name) LIKE 'INNODB_BUFFER_POOL_PAGES_FLUSHED';
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-29666 InnoDB fails to purge secondary index records
--echo # when indexed virtual columns exist
--echo #
CREATE TABLE t1 (a INT, b INT, a1 INT AS(a) VIRTUAL,
INDEX(a1),INDEX(b)) ENGINE=InnoDB;
INSERT INTO t1 SET a=1, b=1;
UPDATE t1 SET a=2, b=3;
let DATADIR=`select @@datadir`;
let PAGE_SIZE=`select @@innodb_page_size`;
source include/wait_all_purged.inc;
FLUSH TABLE t1 FOR EXPORT;
perl;
my $ps = $ENV{PAGE_SIZE};
my $file = "$ENV{DATADIR}/test/t1.ibd";
open(FILE, "<", $file) or die "Unable to open $file\n";
die "Unable to read $file\n" unless
sysread(FILE, $_, 6*$ps) == 6*$ps;
close(FILE);
print "page 4: N_RECS=0x", unpack("H*", substr($_, 4 * $ps + 54, 2)), "\n";
print "page 5: N_RECS=0x", unpack("H*", substr($_, 5 * $ps + 54, 2)), "\n";
EOF
UNLOCK TABLES;
DROP TABLE t1;
--echo # End of 10.3 tests
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -1,6 +1,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/no_valgrind_without_big.inc
# need to restart server # need to restart server
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/no_valgrind_without_big.inc --source include/no_valgrind_without_big.inc

View File

@ -1,5 +1,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/no_valgrind_without_big.inc
--source include/have_sequence.inc --source include/have_sequence.inc
# Flush any open myisam tables from previous tests # Flush any open myisam tables from previous tests

View File

@ -1,7 +1,12 @@
--source include/innodb_page_size.inc --source include/innodb_page_size.inc
# Embedded server tests do not support restarting # Embedded server tests do not support restarting
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/no_valgrind_without_big.inc # Slow shutdown may take more than 120 seconds under Valgrind,
# causing the server to be (silently) killed.
# Due to that, crash recovery could "heal" the damage that our
# Perl code is inflicting, and the SELECT statements could succeed
# instead of failing with ER_NO_SUCH_TABLE_IN_ENGINE.
--source include/not_valgrind.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found"); call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");

View File

@ -3,6 +3,7 @@
--source include/have_undo_tablespaces.inc --source include/have_undo_tablespaces.inc
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_sequence.inc --source include/have_sequence.inc
--source include/no_valgrind_without_big.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool"); call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");

View File

@ -3,6 +3,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
--source include/default_charset.inc --source include/default_charset.inc
let collation=UTF8_UNICODE_CI; let collation=UTF8_UNICODE_CI;
--source include/have_collation.inc --source include/have_collation.inc

View File

@ -1,5 +1,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_simple_parser.inc --source include/have_simple_parser.inc
--source include/no_valgrind_without_big.inc
# Restart is not supported in embedded # Restart is not supported in embedded
--source include/not_embedded.inc --source include/not_embedded.inc

View File

@ -1,4 +1,5 @@
--source include/have_debug.inc --source include/have_debug.inc
--source include/no_valgrind_without_big.inc
--echo ######## --echo ########
--echo # Test for generating "innodb_corrupted_pages" file during full and --echo # Test for generating "innodb_corrupted_pages" file during full and

View File

@ -4,6 +4,7 @@
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
SET @saved_dbug = @@SESSION.debug_dbug; SET @saved_dbug = @@SESSION.debug_dbug;
# crash requires ICP support in InnoDB # crash requires ICP support in InnoDB

View File

@ -5,6 +5,7 @@ if (`SELECT $PS_PROTOCOL != 0`)
--let $rpl_topology=1->2 --let $rpl_topology=1->2
--source include/rpl_init.inc --source include/rpl_init.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
--echo *** Test normal shutdown/restart of slave server configured as a GTID slave. *** --echo *** Test normal shutdown/restart of slave server configured as a GTID slave. ***

View File

@ -1,6 +1,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--let $rpl_topology=1->2 --let $rpl_topology=1->2
--source include/rpl_init.inc --source include/rpl_init.inc
--source include/no_valgrind_without_big.inc
--connection server_2 --connection server_2
call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase"); call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");

View File

@ -1,3 +1,5 @@
--source include/no_valgrind_without_big.inc
# #
# Purpose: # Purpose:
# This test validates that data is consistent between a primary and replica # This test validates that data is consistent between a primary and replica

View File

@ -1,3 +1,4 @@
--source include/no_valgrind_without_big.inc
######## t/ddl_innodb.test ###### ######## t/ddl_innodb.test ######
# #
# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX # Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX

View File

@ -5,6 +5,7 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
# include/restart_mysqld.inc does not work in embedded mode # include/restart_mysqld.inc does not work in embedded mode
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/no_valgrind_without_big.inc
# Check the default value # Check the default value
SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown; SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;

View File

@ -1,6 +1,8 @@
--source include/have_innodb.inc --source include/have_innodb.inc
# Embedded server tests do not support restarting. # Embedded server tests do not support restarting.
--source include/not_embedded.inc --source include/not_embedded.inc
# InnoDB: Cannot read first page of './ibdata1' I/O error
--source include/not_valgrind.inc
call mtr.add_suppression("InnoDB: Failed to set .*DIRECT"); call mtr.add_suppression("InnoDB: Failed to set .*DIRECT");
--replace_result unbuffered fsync --replace_result unbuffered fsync

View File

@ -415,13 +415,9 @@ void field_real::add()
} }
else else
{ {
#ifdef HAVE_SNPRINTF
buff[sizeof(buff)-1]=0; // Safety buff[sizeof(buff)-1]=0; // Safety
snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num); snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
length = (uint) strlen(buff); length = (uint) strlen(buff);
#else
length= snprintf(buff, sizeof(buff), "%-.*f", (int) decs, num);
#endif
// We never need to check further than this // We never need to check further than this
end = buff + length - 1 - decs + max_notzero_dec_len; end = buff + length - 1 - decs + max_notzero_dec_len;

View File

@ -753,7 +753,7 @@ btr_page_get_father_node_ptr_func(
user_rec, 0, user_rec, 0,
heap, level), heap, level),
PAGE_CUR_LE, latch_mode, PAGE_CUR_LE, latch_mode,
cursor, 0, mtr) != DB_SUCCESS) { cursor, mtr) != DB_SUCCESS) {
return nullptr; return nullptr;
} }
@ -2379,7 +2379,7 @@ btr_insert_on_non_leaf_level(
dberr_t err = btr_cur_search_to_nth_level(index, level, tuple, mode, dberr_t err = btr_cur_search_to_nth_level(index, level, tuple, mode,
BTR_CONT_MODIFY_TREE, BTR_CONT_MODIFY_TREE,
&cursor, 0, mtr); &cursor, mtr);
ut_ad(cursor.flag == BTR_CUR_BINARY); ut_ad(cursor.flag == BTR_CUR_BINARY);
if (UNIV_LIKELY(err == DB_SUCCESS)) { if (UNIV_LIKELY(err == DB_SUCCESS)) {

View File

@ -1210,36 +1210,31 @@ If mode is PAGE_CUR_GE, then up_match will a have a sensible value.
If mode is PAGE_CUR_LE , cursor is left at the place where an insert of the If mode is PAGE_CUR_LE , cursor is left at the place where an insert of the
search tuple should be performed in the B-tree. InnoDB does an insert search tuple should be performed in the B-tree. InnoDB does an insert
immediately after the cursor. Thus, the cursor may end up on a user record, immediately after the cursor. Thus, the cursor may end up on a user record,
or on a page infimum record. */ or on a page infimum record.
@param index index
@param level the tree level of search
@param tuple data tuple; NOTE: n_fields_cmp in tuple must be set so that
it cannot get compared to the node ptr page number field!
@param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
unique prefix of a record, mode should be PAGE_CUR_LE, not
PAGE_CUR_GE, as the latter may end up on the previous page of
the record! Inserts should always be made using PAGE_CUR_LE
to search the position!
@param latch_mode BTR_SEARCH_LEAF, ..., ORed with at most one of BTR_INSERT,
BTR_DELETE_MARK, or BTR_DELETE;
cursor->left_block is used to store a pointer to the left
neighbor page
@param cursor tree cursor; the cursor page is s- or x-latched, but see also
above!
@param mtr mini-transaction
@param autoinc PAGE_ROOT_AUTO_INC to be written (0 if none)
@return DB_SUCCESS on success or error code otherwise */
TRANSACTIONAL_TARGET TRANSACTIONAL_TARGET
dberr_t dberr_t btr_cur_search_to_nth_level(dict_index_t *index, ulint level,
btr_cur_search_to_nth_level_func( const dtuple_t *tuple,
dict_index_t* index, /*!< in: index */ page_cur_mode_t mode, ulint latch_mode,
ulint level, /*!< in: the tree level of search */ btr_cur_t *cursor, mtr_t *mtr,
const dtuple_t* tuple, /*!< in: data tuple; NOTE: n_fields_cmp in ib_uint64_t autoinc)
tuple must be set so that it cannot get
compared to the node ptr page number field! */
page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
Inserts should always be made using
PAGE_CUR_LE to search the position! */
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with
at most one of BTR_INSERT, BTR_DELETE_MARK,
BTR_DELETE;
cursor->left_block is used to store a pointer
to the left neighbor page, in the cases
BTR_SEARCH_PREV and BTR_MODIFY_PREV;
NOTE that if ahi_latch, we might not have a
cursor page latch, we assume that ahi_latch
protects the record! */
btr_cur_t* cursor, /*!< in/out: tree cursor; the cursor page is
s- or x-latched, but see also above! */
#ifdef BTR_CUR_HASH_ADAPT
srw_spin_lock* ahi_latch,
/*!< in: currently held AHI rdlock, or NULL */
#endif /* BTR_CUR_HASH_ADAPT */
mtr_t* mtr, /*!< in: mtr */
ib_uint64_t autoinc)/*!< in: PAGE_ROOT_AUTO_INC to be written
(0 if none) */
{ {
page_t* page = NULL; /* remove warning */ page_t* page = NULL; /* remove warning */
buf_block_t* block; buf_block_t* block;
@ -1381,14 +1376,12 @@ btr_cur_search_to_nth_level_func(
# ifdef UNIV_SEARCH_PERF_STAT # ifdef UNIV_SEARCH_PERF_STAT
info->n_searches++; info->n_searches++;
# endif # endif
/* We do a dirty read of btr_search_enabled below,
and btr_search_guess_on_hash() will have to check it again. */
if (!btr_search_enabled) { if (!btr_search_enabled) {
} else if (autoinc == 0 } else if (autoinc == 0
&& latch_mode <= BTR_MODIFY_LEAF && latch_mode <= BTR_MODIFY_LEAF
&& !modify_external && !modify_external
/* If !ahi_latch, we do a dirty read of
btr_search_enabled below, and btr_search_guess_on_hash()
will have to check it again. */
&& btr_search_enabled
# ifdef PAGE_CUR_LE_OR_EXTENDS # ifdef PAGE_CUR_LE_OR_EXTENDS
&& mode != PAGE_CUR_LE_OR_EXTENDS && mode != PAGE_CUR_LE_OR_EXTENDS
# endif /* PAGE_CUR_LE_OR_EXTENDS */ # endif /* PAGE_CUR_LE_OR_EXTENDS */
@ -1396,8 +1389,7 @@ btr_cur_search_to_nth_level_func(
&& !(tuple->info_bits & REC_INFO_MIN_REC_FLAG) && !(tuple->info_bits & REC_INFO_MIN_REC_FLAG)
&& !index->is_spatial() && !index->table->is_temporary() && !index->is_spatial() && !index->table->is_temporary()
&& btr_search_guess_on_hash(index, info, tuple, mode, && btr_search_guess_on_hash(index, info, tuple, mode,
latch_mode, cursor, latch_mode, cursor, mtr)) {
ahi_latch, mtr)) {
/* Search using the hash index succeeded */ /* Search using the hash index succeeded */
@ -1419,13 +1411,6 @@ btr_cur_search_to_nth_level_func(
/* If the hash search did not succeed, do binary search down the /* If the hash search did not succeed, do binary search down the
tree */ tree */
#ifdef BTR_CUR_HASH_ADAPT
if (ahi_latch) {
/* Release possible search latch to obey latching order */
ahi_latch->rd_unlock();
}
#endif /* BTR_CUR_HASH_ADAPT */
/* Store the position of the tree latch we push to mtr so that we /* Store the position of the tree latch we push to mtr so that we
know how to release it when we have latched leaf node(s) */ know how to release it when we have latched leaf node(s) */
@ -2460,12 +2445,6 @@ func_exit:
cursor->rtr_info->mbr_adj = true; cursor->rtr_info->mbr_adj = true;
} }
#ifdef BTR_CUR_HASH_ADAPT
if (ahi_latch) {
ahi_latch->rd_lock(SRW_LOCK_CALL);
}
#endif /* BTR_CUR_HASH_ADAPT */
DBUG_RETURN(err); DBUG_RETURN(err);
} }

View File

@ -420,13 +420,8 @@ btr_pcur_t::restore_position(ulint restore_latch_mode, mtr_t *mtr)
mode = PAGE_CUR_UNSUPP; mode = PAGE_CUR_UNSUPP;
} }
if (btr_pcur_open_with_no_init_func( if (btr_pcur_open_with_no_init(index, tuple, mode, restore_latch_mode,
index, tuple, mode, restore_latch_mode, this, mtr) != DB_SUCCESS) {
this,
#ifdef BTR_CUR_HASH_ADAPT
nullptr,
#endif /* BTR_CUR_HASH_ADAPT */
mtr) != DB_SUCCESS) {
mem_heap_free(heap); mem_heap_free(heap);
return restore_status::CORRUPTED; return restore_status::CORRUPTED;
} }

View File

@ -1036,15 +1036,9 @@ both have sensible values.
@param[in,out] info index search info @param[in,out] info index search info
@param[in] tuple logical record @param[in] tuple logical record
@param[in] mode PAGE_CUR_L, .... @param[in] mode PAGE_CUR_L, ....
@param[in] latch_mode BTR_SEARCH_LEAF, ...; @param[in] latch_mode BTR_SEARCH_LEAF, ...
NOTE that only if has_search_latch is 0, we will
have a latch set on the cursor page, otherwise
we assume the caller uses his search latch
to protect the record!
@param[out] cursor tree cursor @param[out] cursor tree cursor
@param[in] ahi_latch the adaptive hash index latch being held, @param[in] mtr mini-transaction
or NULL
@param[in] mtr mini transaction
@return whether the search succeeded */ @return whether the search succeeded */
TRANSACTIONAL_TARGET TRANSACTIONAL_TARGET
bool bool
@ -1055,7 +1049,6 @@ btr_search_guess_on_hash(
ulint mode, ulint mode,
ulint latch_mode, ulint latch_mode,
btr_cur_t* cursor, btr_cur_t* cursor,
srw_spin_lock* ahi_latch,
mtr_t* mtr) mtr_t* mtr)
{ {
ulint fold; ulint fold;
@ -1068,8 +1061,6 @@ btr_search_guess_on_hash(
} }
ut_ad(!index->is_ibuf()); ut_ad(!index->is_ibuf());
ut_ad(!ahi_latch
|| ahi_latch == &btr_search_sys.get_part(*index)->latch);
ut_ad(latch_mode == BTR_SEARCH_LEAF || latch_mode == BTR_MODIFY_LEAF); ut_ad(latch_mode == BTR_SEARCH_LEAF || latch_mode == BTR_MODIFY_LEAF);
compile_time_assert(ulint{BTR_SEARCH_LEAF} == ulint{RW_S_LATCH}); compile_time_assert(ulint{BTR_SEARCH_LEAF} == ulint{RW_S_LATCH});
compile_time_assert(ulint{BTR_MODIFY_LEAF} == ulint{RW_X_LATCH}); compile_time_assert(ulint{BTR_MODIFY_LEAF} == ulint{RW_X_LATCH});
@ -1104,24 +1095,18 @@ btr_search_guess_on_hash(
auto part = btr_search_sys.get_part(*index); auto part = btr_search_sys.get_part(*index);
const rec_t* rec; const rec_t* rec;
if (!ahi_latch) {
part->latch.rd_lock(SRW_LOCK_CALL); part->latch.rd_lock(SRW_LOCK_CALL);
if (!btr_search_enabled) { if (!btr_search_enabled) {
goto fail; goto fail;
} }
} else {
ut_ad(btr_search_enabled);
}
rec = static_cast<const rec_t*>( rec = static_cast<const rec_t*>(
ha_search_and_get_data(&part->table, fold)); ha_search_and_get_data(&part->table, fold));
if (!rec) { if (!rec) {
if (!ahi_latch) {
fail: fail:
part->latch.rd_unlock(); part->latch.rd_unlock();
}
btr_search_failure(info, cursor); btr_search_failure(info, cursor);
return false; return false;
@ -1129,7 +1114,6 @@ fail:
buf_block_t* block = buf_pool.block_from_ahi(rec); buf_block_t* block = buf_pool.block_from_ahi(rec);
if (!ahi_latch) {
buf_pool_t::hash_chain& chain = buf_pool.page_hash.cell_get( buf_pool_t::hash_chain& chain = buf_pool.page_hash.cell_get(
block->page.id().fold()); block->page.id().fold());
bool fail, got_latch; bool fail, got_latch;
@ -1151,8 +1135,7 @@ fail:
ut_error; ut_error;
} }
fail = index != block->index fail = index != block->index && index_id == block->index->id;
&& index_id == block->index->id;
got_latch = (latch_mode == BTR_SEARCH_LEAF) got_latch = (latch_mode == BTR_SEARCH_LEAF)
? block->page.lock.s_lock_try() ? block->page.lock.s_lock_try()
: block->page.lock.x_lock_try(); : block->page.lock.x_lock_try();
@ -1167,12 +1150,11 @@ fail:
block->page.set_accessed(); block->page.set_accessed();
buf_page_make_young_if_needed(&block->page); buf_page_make_young_if_needed(&block->page);
ut_ad(!block->page.is_read_fixed()); ut_ad(!block->page.is_read_fixed());
ut_ad(latch_mode == BTR_SEARCH_LEAF ut_ad(latch_mode == BTR_SEARCH_LEAF || !block->page.is_io_fixed());
|| !block->page.is_io_fixed()); static_assert(ulint{MTR_MEMO_PAGE_S_FIX} == ulint{BTR_SEARCH_LEAF},
static_assert(ulint{MTR_MEMO_PAGE_S_FIX} == "");
ulint{BTR_SEARCH_LEAF}, ""); static_assert(ulint{MTR_MEMO_PAGE_X_FIX} == ulint{BTR_MODIFY_LEAF},
static_assert(ulint{MTR_MEMO_PAGE_X_FIX} == "");
ulint{BTR_MODIFY_LEAF}, "");
mtr->memo_push(block, mtr_memo_type_t(latch_mode)); mtr->memo_push(block, mtr_memo_type_t(latch_mode));
++buf_pool.stat.n_page_gets; ++buf_pool.stat.n_page_gets;
@ -1184,19 +1166,12 @@ fail:
} }
DBUG_ASSERT(!block->page.is_freed()); DBUG_ASSERT(!block->page.is_freed());
} else if (UNIV_UNLIKELY(index != block->index
&& index_id == block->index->id)) {
ut_a(block->index->freed());
goto fail_and_release_page;
}
if (!block->page.in_file()) { if (!block->page.in_file()) {
ut_ad(block->page.state() == buf_page_t::REMOVE_HASH); ut_ad(block->page.state() == buf_page_t::REMOVE_HASH);
fail_and_release_page: fail_and_release_page:
if (!ahi_latch) {
btr_leaf_page_release(block, latch_mode, mtr); btr_leaf_page_release(block, latch_mode, mtr);
}
btr_search_failure(info, cursor); btr_search_failure(info, cursor);
return false; return false;
@ -1214,7 +1189,7 @@ fail_and_release_page:
record to determine if our guess for the cursor position is record to determine if our guess for the cursor position is
right. */ right. */
if (index_id != btr_page_get_index_id(block->page.frame) if (index_id != btr_page_get_index_id(block->page.frame)
|| !btr_search_check_guess(cursor, !!ahi_latch, tuple, mode)) { || !btr_search_check_guess(cursor, false, tuple, mode)) {
goto fail_and_release_page; goto fail_and_release_page;
} }
@ -1263,14 +1238,6 @@ fail_and_release_page:
#ifdef UNIV_SEARCH_PERF_STAT #ifdef UNIV_SEARCH_PERF_STAT
btr_search_n_succ++; btr_search_n_succ++;
#endif #endif
/* Increment the page get statistics though we did not really
fix the page: for user info only */
++buf_pool.stat.n_page_gets;
if (!ahi_latch) {
buf_page_make_young_if_needed(&block->page);
}
return true; return true;
} }

View File

@ -4153,7 +4153,7 @@ void dict_set_corrupted(dict_index_t *index, const char *ctx)
dict_index_copy_types(tuple, sys_index, 2); dict_index_copy_types(tuple, sys_index, 2);
if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE, if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE,
BTR_MODIFY_LEAF, &cursor, 0, &mtr) BTR_MODIFY_LEAF, &cursor, &mtr)
!= DB_SUCCESS) { != DB_SUCCESS) {
goto fail; goto fail;
} }
@ -4228,7 +4228,7 @@ dict_index_set_merge_threshold(
dict_index_copy_types(tuple, sys_index, 2); dict_index_copy_types(tuple, sys_index, 2);
if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE, if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE,
BTR_MODIFY_LEAF, &cursor, 0, &mtr) BTR_MODIFY_LEAF, &cursor, &mtr)
!= DB_SUCCESS) { != DB_SUCCESS) {
goto func_exit; goto func_exit;
} }

View File

@ -3354,7 +3354,7 @@ fts_add_doc_by_id(
/* If we have a match, add the data to doc structure */ /* If we have a match, add the data to doc structure */
if (btr_pcur_open_with_no_init(fts_id_index, tuple, PAGE_CUR_LE, if (btr_pcur_open_with_no_init(fts_id_index, tuple, PAGE_CUR_LE,
BTR_SEARCH_LEAF, &pcur, 0, &mtr) BTR_SEARCH_LEAF, &pcur, &mtr)
== DB_SUCCESS == DB_SUCCESS
&& btr_pcur_get_low_match(&pcur) == 1) { && btr_pcur_get_low_match(&pcur) == 1) {
const rec_t* rec; const rec_t* rec;
@ -3392,7 +3392,7 @@ fts_add_doc_by_id(
if (btr_pcur_open_with_no_init(clust_index, clust_ref, if (btr_pcur_open_with_no_init(clust_index, clust_ref,
PAGE_CUR_LE, PAGE_CUR_LE,
BTR_SEARCH_LEAF, BTR_SEARCH_LEAF,
&clust_pcur, 0, &mtr) &clust_pcur, &mtr)
!= DB_SUCCESS) { != DB_SUCCESS) {
goto func_exit; goto func_exit;
} }

View File

@ -556,7 +556,7 @@ rtr_pcur_open(
if (btr_cur_search_to_nth_level(index, 0, tuple, PAGE_CUR_RTREE_LOCATE, if (btr_cur_search_to_nth_level(index, 0, tuple, PAGE_CUR_RTREE_LOCATE,
latch_mode, latch_mode,
btr_cursor, 0, mtr) != DB_SUCCESS) { btr_cursor, mtr) != DB_SUCCESS) {
return true; return true;
} }
@ -682,7 +682,7 @@ static const rec_t* rtr_get_father_node(
if (btr_cur_search_to_nth_level(index, level, tuple, if (btr_cur_search_to_nth_level(index, level, tuple,
PAGE_CUR_RTREE_LOCATE, PAGE_CUR_RTREE_LOCATE,
BTR_CONT_MODIFY_TREE, btr_cur, 0, mtr) BTR_CONT_MODIFY_TREE, btr_cur, mtr)
!= DB_SUCCESS) { != DB_SUCCESS) {
} else if (sea_cur && sea_cur->tree_height == level) { } else if (sea_cur && sea_cur->tree_height == level) {
rec = btr_cur_get_rec(btr_cur); rec = btr_cur_get_rec(btr_cur);

View File

@ -142,53 +142,35 @@ btr_cur_optimistic_latch_leaves(
mtr_t* mtr); mtr_t* mtr);
MY_ATTRIBUTE((warn_unused_result)) MY_ATTRIBUTE((warn_unused_result))
/********************************************************************//** /** Searches an index tree and positions a tree cursor on a given level.
Searches an index tree and positions a tree cursor on a given level.
NOTE: n_fields_cmp in tuple must be set so that it cannot be compared NOTE: n_fields_cmp in tuple must be set so that it cannot be compared
to node pointer page number fields on the upper levels of the tree! to node pointer page number fields on the upper levels of the tree!
Note that if mode is PAGE_CUR_LE, which is used in inserts, then Note that if mode is PAGE_CUR_LE, which is used in inserts, then
cursor->up_match and cursor->low_match both will have sensible values. cursor->up_match and cursor->low_match both will have sensible values.
If mode is PAGE_CUR_GE, then up_match will a have a sensible value. */ If mode is PAGE_CUR_GE, then up_match will a have a sensible value.
dberr_t @param index index
btr_cur_search_to_nth_level_func( @param level the tree level of search
dict_index_t* index, /*!< in: index */ @param tuple data tuple; NOTE: n_fields_cmp in tuple must be set so that
ulint level, /*!< in: the tree level of search */ it cannot get compared to the node ptr page number field!
const dtuple_t* tuple, /*!< in: data tuple; NOTE: n_fields_cmp in @param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
tuple must be set so that it cannot get unique prefix of a record, mode should be PAGE_CUR_LE, not
compared to the node ptr page number field! */ PAGE_CUR_GE, as the latter may end up on the previous page of
page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...; the record! Inserts should always be made using PAGE_CUR_LE
NOTE that if the search is made using a unique to search the position!
prefix of a record, mode should be PAGE_CUR_LE, @param latch_mode BTR_SEARCH_LEAF, ..., ORed with at most one of BTR_INSERT,
not PAGE_CUR_GE, as the latter may end up on BTR_DELETE_MARK, or BTR_DELETE;
the previous page of the record! Inserts cursor->left_block is used to store a pointer to the left
should always be made using PAGE_CUR_LE to neighbor page
search the position! */ @param cursor tree cursor; the cursor page is s- or x-latched, but see also
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with above!
at most one of BTR_INSERT, BTR_DELETE_MARK, @param mtr mini-transaction
BTR_DELETE; @param autoinc PAGE_ROOT_AUTO_INC to be written (0 if none)
cursor->left_block is used to store a pointer @return DB_SUCCESS on success or error code otherwise */
to the left neighbor page, in the cases dberr_t btr_cur_search_to_nth_level(dict_index_t *index, ulint level,
BTR_SEARCH_PREV and BTR_MODIFY_PREV; const dtuple_t *tuple,
NOTE that if ahi_latch, we might not have a page_cur_mode_t mode, ulint latch_mode,
cursor page latch, we assume that ahi_latch btr_cur_t *cursor, mtr_t *mtr,
protects the record! */
btr_cur_t* cursor, /*!< in/out: tree cursor; the cursor page is
s- or x-latched, but see also above! */
#ifdef BTR_CUR_HASH_ADAPT
srw_spin_lock* ahi_latch,
/*!< in: currently held AHI rdlock, or NULL */
#endif /* BTR_CUR_HASH_ADAPT */
mtr_t* mtr, /*!< in/out: mini-transaction */
ib_uint64_t autoinc= 0); ib_uint64_t autoinc= 0);
/*!< in: PAGE_ROOT_AUTO_INC to be written
(0 if none) */
#ifdef BTR_CUR_HASH_ADAPT
# define btr_cur_search_to_nth_level(i,l,t,m,lm,c,a,mtr) \
btr_cur_search_to_nth_level_func(i,l,t,m,lm,c,a,mtr)
#else /* BTR_CUR_HASH_ADAPT */
# define btr_cur_search_to_nth_level(i,l,t,m,lm,c,a,mtr) \
btr_cur_search_to_nth_level_func(i,l,t,m,lm,c,mtr)
#endif /* BTR_CUR_HASH_ADAPT */
/*****************************************************************//** /*****************************************************************//**
Opens a cursor at either end of an index. Opens a cursor at either end of an index.

View File

@ -113,39 +113,22 @@ btr_pcur_open_low(
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
#define btr_pcur_open(i,t,md,l,c,m) \ #define btr_pcur_open(i,t,md,l,c,m) \
btr_pcur_open_low(i,0,t,md,l,c,0,m) btr_pcur_open_low(i,0,t,md,l,c,0,m)
/**************************************************************//** /** Opens an persistent cursor to an index tree without initializing the
Opens an persistent cursor to an index tree without initializing the cursor.
cursor. */ @param index index
UNIV_INLINE @param tuple tuple on which search done
dberr_t @param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
btr_pcur_open_with_no_init_func( unique prefix of a record, mode should be PAGE_CUR_LE, not
/*============================*/ PAGE_CUR_GE, as the latter may end up on the previous page of
dict_index_t* index, /*!< in: index */ the record!
const dtuple_t* tuple, /*!< in: tuple on which search done */ @param latch_mode BTR_SEARCH_LEAF, ...
page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...; @param cursor memory buffer for persistent cursor
NOTE that if the search is made using a unique @param mtr mini-transaction
prefix of a record, mode should be @return DB_SUCCESS on success or error code otherwise. */
PAGE_CUR_LE, not PAGE_CUR_GE, as the latter inline
may end up on the previous page of the dberr_t btr_pcur_open_with_no_init(dict_index_t *index, const dtuple_t *tuple,
record! */ page_cur_mode_t mode, ulint latch_mode,
ulint latch_mode,/*!< in: BTR_SEARCH_LEAF, ...; btr_pcur_t *cursor, mtr_t *mtr);
NOTE that if ahi_latch then we might not
acquire a cursor page latch, but assume
that the ahi_latch protects the record! */
btr_pcur_t* cursor, /*!< in: memory buffer for persistent cursor */
#ifdef BTR_CUR_HASH_ADAPT
srw_spin_lock* ahi_latch,
/*!< in: currently held AHI rdlock, or NULL */
#endif /* BTR_CUR_HASH_ADAPT */
mtr_t* mtr) /*!< in: mtr */
MY_ATTRIBUTE((warn_unused_result));
#ifdef BTR_CUR_HASH_ADAPT
# define btr_pcur_open_with_no_init(ix,t,md,l,cur,ahi,m) \
btr_pcur_open_with_no_init_func(ix,t,md,l,cur,ahi,m)
#else /* BTR_CUR_HASH_ADAPT */
# define btr_pcur_open_with_no_init(ix,t,md,l,cur,ahi,m) \
btr_pcur_open_with_no_init_func(ix,t,md,l,cur,m)
#endif /* BTR_CUR_HASH_ADAPT */
/*****************************************************************//** /*****************************************************************//**
Opens a persistent cursor at either end of an index. */ Opens a persistent cursor at either end of an index. */

Some files were not shown because too many files have changed in this diff Show More