mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 08:44:33 +01:00
Merge branch '10.6' into 10.7
This commit is contained in:
commit
57f14eab20
964 changed files with 16396 additions and 10037 deletions
.gitignore.travis.yml
BUILD
FINISH.shSETUP.shcompile-amd64-gcovcompile-pentium64-asan-maxcompile-pentium64-gcovcompile-pentium64-ubsan
README.mdappveyor.ymlclient
async_example.cclient_priv.hmysql.ccmysql_plugin.cmysql_upgrade.cmysqladmin.ccmysqlbinlog.ccmysqlcheck.cmysqldump.cmysqlimport.cmysqlshow.cmysqlslap.cmysqltest.ccreadline.cc
cmake
config.h.cmakedbug
debian
autobake-deb.shmariadb-plugin-connect.installmariadb-server-10.7.README.Debianmariadb-server-10.7.mysql.defaultmariadb-server-10.7.postinstmariadb-test-data.installmariadb-test.installmariadb-test.linksrulessalsa-ci.yml
tests
extra
include
handler_ername.hmy_atomic_wrapper.hmy_base.hmy_byteorder.hmy_dbug.hmy_global.hmy_net.hmy_pthread.hmy_rdtsc.hmy_stacktrace.hmy_sys.hmysql.h
libmariadbmysql
plugin.hplugin_audit.h.ppplugin_auth.h.ppplugin_data_type.h.ppplugin_encryption.h.ppplugin_ftparser.h.ppplugin_function.h.ppplugin_password_validation.h.ppservice_my_crypt.h
mysql_com.hthr_alarm.hviolite.hlibmysqld
mysql-test
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -90,6 +90,9 @@ mysql-test/lib/My/SafeProcess/my_safe_process
|
|||
mysql-test/lib/My/SafeProcess/wsrep_check_version
|
||||
mysql-test/mtr
|
||||
mysql-test/mysql-test-run
|
||||
mysql-test/mariadb-test-run
|
||||
mysql-test/mysql-stress-test.pl
|
||||
mysql-test/mysql-test-run.pl
|
||||
mysql-test/var*
|
||||
mysql-test-gcov.err
|
||||
mysql-test-gcov.msg
|
||||
|
@ -505,6 +508,7 @@ _UpgradeReport_Files/
|
|||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
*.stackdump
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
|
@ -538,6 +542,9 @@ compile_commands.json
|
|||
# Clion && other JetBrains ides
|
||||
.idea
|
||||
|
||||
.cache/clangd
|
||||
|
||||
|
||||
client/mariadb
|
||||
client/mariadb-admin
|
||||
client/mariadb-binlog
|
||||
|
|
|
@ -224,7 +224,6 @@ script:
|
|||
- cd mysql-test
|
||||
- travis_wait 30 ./mtr --force --max-test-fail=20 --parallel=4 --testcase-timeout=${TEST_CASE_TIMEOUT}
|
||||
--suite=${MYSQL_TEST_SUITES}
|
||||
--skip-test-list=unstable-tests
|
||||
--skip-test=binlog.binlog_unsafe
|
||||
|
||||
after_script:
|
||||
|
|
|
@ -40,16 +40,22 @@ then
|
|||
git clean -fdX
|
||||
cd ./libmariadb
|
||||
git submodule update
|
||||
git clean -fdX
|
||||
cd ../storage/rocksdb/rocksdb
|
||||
git clean -fdX
|
||||
git submodule update
|
||||
git clean -fdX
|
||||
cd ../../maria/libmarias3
|
||||
git submodule update
|
||||
git clean -fdX
|
||||
cd ../../..
|
||||
cd storage/columnstore/columnstore
|
||||
git submodule update
|
||||
git clean -fdX
|
||||
cd ../../..
|
||||
cd wsrep-lib
|
||||
git submodule update
|
||||
git clean -fdX
|
||||
cd .."
|
||||
fi
|
||||
commands="$commands
|
||||
|
|
|
@ -274,13 +274,7 @@ fi
|
|||
# As cmake doesn't like CC and CXX with a space, use symlinks from
|
||||
# /usr/lib64/ccache if they exits.
|
||||
|
||||
if test "$USING_GCOV" != "1"
|
||||
then
|
||||
# Not using gcov; Safe to use ccache
|
||||
CCACHE_GCOV_VERSION_ENABLED=1
|
||||
fi
|
||||
|
||||
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1" && test "$CC" = "gcc"
|
||||
if ccache -V > /dev/null 2>&1 && test "$CCACHE_DISABLE" != "1" && test "$CC" = "gcc"
|
||||
then
|
||||
if test -x /usr/lib64/ccache/gcc
|
||||
then
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
# Need to disable ccache, or we loose the gcov-needed compiler output files.
|
||||
CCACHE_DISABLE=1
|
||||
export CCACHE_DISABLE
|
||||
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
export LDFLAGS="$gcov_link_flags"
|
||||
|
||||
extra_flags="$amd64_cflags $debug_cflags $max_cflags $gcov_compile_flags"
|
||||
|
|
|
@ -17,7 +17,12 @@
|
|||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address -USAFEMALLOC -UFORCE_INIT_OF_VARS -Wno-uninitialized -Wno-maybe-uninitialized"
|
||||
#
|
||||
# Enable AddressSanitzer, a fast memory error detector.
|
||||
# Detects "Out of bounds" and "use-after-free" memory errors
|
||||
#
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address -USAFEMALLOC -UFORCE_INIT_OF_VARS -Wno-uninitialized -Wno-maybe-uninitialized -DMYSQL_SERVER_SUFFIX=-asan-max"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_asan_plugins"
|
||||
export LDFLAGS="-ldl"
|
||||
|
||||
|
|
|
@ -16,13 +16,15 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
|
||||
|
||||
set -x -v
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
# Need to disable ccache, or we loose the gcov-needed compiler output files.
|
||||
CCACHE_DISABLE=1
|
||||
export CCACHE_DISABLE
|
||||
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
export LDFLAGS="$gcov_link_flags"
|
||||
|
||||
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
#
|
||||
# Enable UBSAN, UndefinedBehaviorSanitizer. Detects undefined behavior like:
|
||||
# - Using misaligned or null pointer
|
||||
# - Signed integer overflow
|
||||
# - Conversion to, from, or between floating-point types which would overflow
|
||||
# the destination
|
||||
#
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
|
||||
extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider"
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
Code status:
|
||||
------------
|
||||
|
||||
* [![Travis CI status](https://secure.travis-ci.org/MariaDB/server.png?branch=10.5)](https://travis-ci.org/MariaDB/server) travis-ci.org (10.5 branch)
|
||||
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com
|
||||
|
||||
## MariaDB: The open source relational database
|
||||
|
@ -78,5 +77,3 @@ https://mariadb.org/about/security-policy/
|
|||
|
||||
The code for MariaDB, including all revision history, can be found at:
|
||||
https://github.com/MariaDB/server
|
||||
|
||||
***************************************************************************
|
||||
|
|
|
@ -16,6 +16,6 @@ platform: x64
|
|||
test_script:
|
||||
- set PATH=C:\Strawberry\perl\bin;%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
|
||||
- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
|
||||
- perl mysql-test-run.pl --force --max-test-fail=10 --parallel=4 --testcase-timeout=10 --skip-test-list=unstable-tests --suite=main
|
||||
- perl mysql-test-run.pl --force --max-test-fail=10 --parallel=4 --testcase-timeout=10 --suite=main
|
||||
|
||||
image: Visual Studio 2019
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
#include <poll.h>
|
||||
#else
|
||||
#include <WinSock2.h>
|
||||
|
@ -33,7 +33,7 @@ static const char *my_groups[]= { "client", NULL };
|
|||
static int
|
||||
wait_for_mysql(MYSQL *mysql, int status)
|
||||
{
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
fd_set rs, ws, es;
|
||||
int res;
|
||||
struct timeval tv, *timeout;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <mysql_version.h>
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# ifdef __WIN__
|
||||
# ifdef _WIN32
|
||||
# define WEXITSTATUS(stat_val) (stat_val)
|
||||
# else
|
||||
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
||||
|
|
|
@ -88,7 +88,7 @@ extern "C" {
|
|||
#endif /* defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) */
|
||||
|
||||
#undef bcmp // Fix problem with new readline
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <readline.h>
|
||||
|
@ -1587,7 +1587,7 @@ static struct my_option my_long_options[] =
|
|||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -1893,7 +1893,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
|
|||
set_if_bigger(opt_silent,1); // more silent
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
||||
opt_protocol_type= "pipe";
|
||||
|
||||
|
@ -2026,7 +2026,7 @@ static int get_options(int argc, char **argv)
|
|||
|
||||
static int read_and_execute(bool interactive)
|
||||
{
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
String tmpbuf;
|
||||
String buffer;
|
||||
#endif
|
||||
|
@ -2106,7 +2106,7 @@ static int read_and_execute(bool interactive)
|
|||
if (opt_outfile && glob_buffer.is_empty())
|
||||
fflush(OUTFILE);
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
tee_fputs(prompt, stdout);
|
||||
if (!tmpbuf.is_alloced())
|
||||
tmpbuf.alloc(65535);
|
||||
|
@ -2139,7 +2139,7 @@ static int read_and_execute(bool interactive)
|
|||
if (line)
|
||||
free(line);
|
||||
line= readline(prompt);
|
||||
#endif /* defined(__WIN__) */
|
||||
#endif /* defined(_WIN32) */
|
||||
|
||||
/*
|
||||
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
|
||||
|
@ -2194,7 +2194,7 @@ static int read_and_execute(bool interactive)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
buffer.free();
|
||||
tmpbuf.free();
|
||||
#else
|
||||
|
|
|
@ -233,7 +233,7 @@ static int run_command(char* cmd, const char *mode)
|
|||
}
|
||||
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
/**
|
||||
Check to see if there are spaces in a path.
|
||||
|
||||
|
@ -329,7 +329,7 @@ static int get_default_values()
|
|||
if ((error= make_tempfile(defaults_file, "txt")))
|
||||
goto exit;
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{
|
||||
char *format_str= 0;
|
||||
|
||||
|
@ -860,7 +860,7 @@ static int process_options(int argc, char *argv[], char *operation)
|
|||
memset(buff, 0, sizeof(buff));
|
||||
|
||||
strncpy(buff, opt_basedir, sizeof(buff) - 1);
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
strncat(buff, "/", sizeof(buff) - strlen(buff) - 1);
|
||||
#else
|
||||
strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
|
||||
|
@ -1175,7 +1175,7 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
|
|||
char bootstrap_cmd[FN_REFLEN];
|
||||
int error= 0;
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
char *format_str= 0;
|
||||
const char *verbose_str= NULL;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# ifdef __WIN__
|
||||
# ifdef _WIN32
|
||||
# define WEXITSTATUS(stat_val) (stat_val)
|
||||
# else
|
||||
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
||||
|
@ -121,7 +121,7 @@ static struct my_option my_long_options[]=
|
|||
"Password to use when connecting to server. If password is not given,"
|
||||
" it's solicited on the tty.", &opt_password,&opt_password,
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -451,7 +451,7 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
|||
|
||||
va_end(args);
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
dynstr_append(&ds_cmdline, "\"");
|
||||
#endif
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ int main(int argc, char **argv)
|
|||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv= argv; /* Must be freed by 'free_defaults' */
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
|
||||
#endif
|
||||
{
|
||||
|
|
|
@ -175,7 +175,7 @@ static struct my_option my_long_options[] =
|
|||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -278,7 +278,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
|
|||
option_silent++;
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
||||
|
||||
/* Prioritize pipe if explicit via command line */
|
||||
|
@ -1153,7 +1153,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) ==
|
||||
ADMIN_OLD_PASSWORD);
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
size_t pw_len= strlen(typed_password);
|
||||
if (pw_len > 1 && typed_password[0] == '\'' &&
|
||||
typed_password[pw_len-1] == '\'')
|
||||
|
|
|
@ -2918,7 +2918,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
stdin in binary mode. Errors on setting this mode result in
|
||||
halting the function and printing an error message to stderr.
|
||||
*/
|
||||
#if defined (__WIN__) || defined(_WIN64)
|
||||
#if defined (_WIN32)
|
||||
if (_setmode(fileno(stdin), O_BINARY) == -1)
|
||||
{
|
||||
error("Could not set binary mode on stdin.");
|
||||
|
|
|
@ -165,7 +165,7 @@ static struct my_option my_long_options[] =
|
|||
"When using ANALYZE TABLE use the PERSISTENT FOR ALL option.",
|
||||
&opt_persistent_all, &opt_persistent_all, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -355,7 +355,7 @@ get_one_option(const struct my_option *opt,
|
|||
opt_upgrade= 1;
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
||||
|
||||
/* Prioritize pipe if explicit via command line */
|
||||
|
|
|
@ -504,7 +504,7 @@ static struct my_option my_long_options[] =
|
|||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -896,7 +896,7 @@ get_one_option(const struct my_option *opt,
|
|||
exit(1);
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol= MYSQL_PROTOCOL_PIPE;
|
||||
|
||||
/* Prioritize pipe if explicit via command line */
|
||||
|
|
|
@ -146,7 +146,7 @@ static struct my_option my_long_options[] =
|
|||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -252,7 +252,7 @@ get_one_option(const struct my_option *opt, const char *argument,
|
|||
else
|
||||
tty_password= 1;
|
||||
break;
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
case 'W':
|
||||
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
||||
opt_local_file=1;
|
||||
|
|
|
@ -247,7 +247,7 @@ static struct my_option my_long_options[] =
|
|||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -336,7 +336,7 @@ get_one_option(const struct my_option *opt, const char *argument,
|
|||
tty_password=1;
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
||||
|
||||
/* Prioritize pipe if explicit via command line */
|
||||
|
|
|
@ -86,16 +86,15 @@ TODO:
|
|||
#include <my_dir.h>
|
||||
#include <signal.h>
|
||||
#include <sslopt-vars.h>
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
#define srandom srand
|
||||
#define random rand
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -282,7 +281,7 @@ static long int timedif(struct timeval a, struct timeval b)
|
|||
return s + us;
|
||||
}
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
static int gettimeofday(struct timeval *tp, void *tzp)
|
||||
{
|
||||
unsigned int ticks;
|
||||
|
@ -665,7 +664,7 @@ static struct my_option my_long_options[] =
|
|||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's "
|
||||
"asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
|
@ -772,7 +771,7 @@ get_one_option(const struct my_option *opt, const char *argument,
|
|||
tty_password= 1;
|
||||
break;
|
||||
case 'W':
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
opt_protocol= MYSQL_PROTOCOL_PIPE;
|
||||
|
||||
/* Prioritize pipe if explicit via command line */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2020, MariaDB
|
||||
Copyright (c) 2009, 2021, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -90,6 +90,8 @@ static my_bool non_blocking_api_enabled= 0;
|
|||
|
||||
#define QUERY_PRINT_ORIGINAL_FLAG 4
|
||||
|
||||
#define CLOSED_CONNECTION "-closed_connection-"
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
static int setenv(const char *name, const char *value, int overwrite);
|
||||
#endif
|
||||
|
@ -5583,11 +5585,13 @@ void do_close_connection(struct st_command *command)
|
|||
my_free(con->name);
|
||||
|
||||
/*
|
||||
When the connection is closed set name to "-closed_connection-"
|
||||
When the connection is closed set name to CLOSED_CONNECTION
|
||||
to make it possible to reuse the connection name.
|
||||
*/
|
||||
if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, "-closed_connection-", MYF(MY_WME))))
|
||||
if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, CLOSED_CONNECTION,
|
||||
MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
con->name_len= sizeof(CLOSED_CONNECTION)-1;
|
||||
|
||||
if (con == cur_con)
|
||||
{
|
||||
|
@ -5990,7 +5994,7 @@ void do_connect(struct st_command *command)
|
|||
con_slot= next_con;
|
||||
else
|
||||
{
|
||||
if (!(con_slot= find_connection_by_name("-closed_connection-")))
|
||||
if (!(con_slot= find_connection_by_name(CLOSED_CONNECTION)))
|
||||
die("Connection limit exhausted, you can have max %d connections",
|
||||
opt_max_connections);
|
||||
my_free(con_slot->name);
|
||||
|
@ -8293,7 +8297,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
|||
Get the warnings from mysql_stmt_prepare and keep them in a
|
||||
separate string
|
||||
*/
|
||||
if (!disable_warnings)
|
||||
if (!disable_warnings && prepare_warnings_enabled)
|
||||
append_warnings(&ds_prepare_warnings, mysql);
|
||||
|
||||
/*
|
||||
|
@ -8324,117 +8328,125 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
|||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
When running in cursor_protocol get the warnings from execute here
|
||||
and keep them in a separate string for later.
|
||||
*/
|
||||
if (cursor_protocol_enabled && !disable_warnings)
|
||||
append_warnings(&ds_execute_warnings, mysql);
|
||||
|
||||
/*
|
||||
We instruct that we want to update the "max_length" field in
|
||||
mysql_stmt_store_result(), this is our only way to know how much
|
||||
buffer to allocate for result data
|
||||
*/
|
||||
{
|
||||
my_bool one= 1;
|
||||
if (mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &one))
|
||||
die("mysql_stmt_attr_set(STMT_ATTR_UPDATE_MAX_LENGTH) failed': %d %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
}
|
||||
|
||||
/*
|
||||
If we got here the statement succeeded and was expected to do so,
|
||||
get data. Note that this can still give errors found during execution!
|
||||
Store the result of the query if if will return any fields
|
||||
*/
|
||||
if (mysql_stmt_field_count(stmt) && mysql_stmt_store_result(stmt))
|
||||
{
|
||||
handle_error(command, mysql_stmt_errno(stmt),
|
||||
mysql_stmt_error(stmt), mysql_stmt_sqlstate(stmt), ds);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* If we got here the statement was both executed and read successfully */
|
||||
handle_no_error(command);
|
||||
if (!disable_result_log)
|
||||
int err;
|
||||
do
|
||||
{
|
||||
/*
|
||||
Not all statements creates a result set. If there is one we can
|
||||
now create another normal result set that contains the meta
|
||||
data. This set can be handled almost like any other non prepared
|
||||
statement result set.
|
||||
When running in cursor_protocol get the warnings from execute here
|
||||
and keep them in a separate string for later.
|
||||
*/
|
||||
if (cursor_protocol_enabled && !disable_warnings)
|
||||
append_warnings(&ds_execute_warnings, mysql);
|
||||
|
||||
/*
|
||||
We instruct that we want to update the "max_length" field in
|
||||
mysql_stmt_store_result(), this is our only way to know how much
|
||||
buffer to allocate for result data
|
||||
*/
|
||||
if ((res= mysql_stmt_result_metadata(stmt)) != NULL)
|
||||
{
|
||||
/* Take the column count from meta info */
|
||||
MYSQL_FIELD *fields= mysql_fetch_fields(res);
|
||||
uint num_fields= mysql_num_fields(res);
|
||||
|
||||
if (display_metadata)
|
||||
append_metadata(ds, fields, num_fields);
|
||||
|
||||
if (!display_result_vertically)
|
||||
append_table_headings(ds, fields, num_fields);
|
||||
|
||||
append_stmt_result(ds, stmt, fields, num_fields);
|
||||
|
||||
mysql_free_result(res); /* Free normal result set with meta data */
|
||||
|
||||
/*
|
||||
Normally, if there is a result set, we do not show warnings from the
|
||||
prepare phase. This is because some warnings are generated both during
|
||||
prepare and execute; this would generate different warning output
|
||||
between normal and ps-protocol test runs.
|
||||
|
||||
The --enable_prepare_warnings command can be used to change this so
|
||||
that warnings from both the prepare and execute phase are shown.
|
||||
*/
|
||||
if (!disable_warnings && !prepare_warnings_enabled)
|
||||
dynstr_set(&ds_prepare_warnings, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
This is a query without resultset
|
||||
*/
|
||||
my_bool one= 1;
|
||||
if (mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &one))
|
||||
die("mysql_stmt_attr_set(STMT_ATTR_UPDATE_MAX_LENGTH) failed': %d %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
}
|
||||
|
||||
/*
|
||||
Fetch info before fetching warnings, since it will be reset
|
||||
otherwise.
|
||||
If we got here the statement succeeded and was expected to do so,
|
||||
get data. Note that this can still give errors found during execution!
|
||||
Store the result of the query if if will return any fields
|
||||
*/
|
||||
if (!disable_info)
|
||||
append_info(ds, mysql_stmt_affected_rows(stmt), mysql_info(mysql));
|
||||
|
||||
if (display_session_track_info)
|
||||
append_session_track_info(ds, mysql);
|
||||
|
||||
|
||||
if (!disable_warnings)
|
||||
if (mysql_stmt_field_count(stmt) && mysql_stmt_store_result(stmt))
|
||||
{
|
||||
/* Get the warnings from execute */
|
||||
handle_error(command, mysql_stmt_errno(stmt),
|
||||
mysql_stmt_error(stmt), mysql_stmt_sqlstate(stmt), ds);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Append warnings to ds - if there are any */
|
||||
if (append_warnings(&ds_execute_warnings, mysql) ||
|
||||
ds_execute_warnings.length ||
|
||||
ds_prepare_warnings.length ||
|
||||
ds_warnings->length)
|
||||
if (!disable_result_log)
|
||||
{
|
||||
/*
|
||||
Not all statements creates a result set. If there is one we can
|
||||
now create another normal result set that contains the meta
|
||||
data. This set can be handled almost like any other non prepared
|
||||
statement result set.
|
||||
*/
|
||||
if ((res= mysql_stmt_result_metadata(stmt)) != NULL)
|
||||
{
|
||||
dynstr_append_mem(ds, "Warnings:\n", 10);
|
||||
if (ds_warnings->length)
|
||||
dynstr_append_mem(ds, ds_warnings->str,
|
||||
ds_warnings->length);
|
||||
if (ds_prepare_warnings.length)
|
||||
dynstr_append_mem(ds, ds_prepare_warnings.str,
|
||||
ds_prepare_warnings.length);
|
||||
if (ds_execute_warnings.length)
|
||||
dynstr_append_mem(ds, ds_execute_warnings.str,
|
||||
ds_execute_warnings.length);
|
||||
/* Take the column count from meta info */
|
||||
MYSQL_FIELD *fields= mysql_fetch_fields(res);
|
||||
uint num_fields= mysql_num_fields(res);
|
||||
|
||||
if (display_metadata)
|
||||
append_metadata(ds, fields, num_fields);
|
||||
|
||||
if (!display_result_vertically)
|
||||
append_table_headings(ds, fields, num_fields);
|
||||
|
||||
append_stmt_result(ds, stmt, fields, num_fields);
|
||||
|
||||
mysql_free_result(res); /* Free normal result set with meta data */
|
||||
|
||||
/*
|
||||
Normally, if there is a result set, we do not show warnings from the
|
||||
prepare phase. This is because some warnings are generated both during
|
||||
prepare and execute; this would generate different warning output
|
||||
between normal and ps-protocol test runs.
|
||||
|
||||
The --enable_prepare_warnings command can be used to change this so
|
||||
that warnings from both the prepare and execute phase are shown.
|
||||
*/
|
||||
if (!disable_warnings && !prepare_warnings_enabled)
|
||||
dynstr_set(&ds_prepare_warnings, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
This is a query without resultset
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
Fetch info before fetching warnings, since it will be reset
|
||||
otherwise.
|
||||
*/
|
||||
if (!disable_info)
|
||||
append_info(ds, mysql_stmt_affected_rows(stmt), mysql_info(mysql));
|
||||
|
||||
if (display_session_track_info)
|
||||
append_session_track_info(ds, mysql);
|
||||
|
||||
|
||||
if (!disable_warnings)
|
||||
{
|
||||
/* Get the warnings from execute */
|
||||
|
||||
/* Append warnings to ds - if there are any */
|
||||
if (append_warnings(&ds_execute_warnings, mysql) ||
|
||||
ds_execute_warnings.length ||
|
||||
ds_prepare_warnings.length ||
|
||||
ds_warnings->length)
|
||||
{
|
||||
dynstr_append_mem(ds, "Warnings:\n", 10);
|
||||
if (ds_warnings->length)
|
||||
dynstr_append_mem(ds, ds_warnings->str,
|
||||
ds_warnings->length);
|
||||
if (ds_prepare_warnings.length)
|
||||
dynstr_append_mem(ds, ds_prepare_warnings.str,
|
||||
ds_prepare_warnings.length);
|
||||
if (ds_execute_warnings.length)
|
||||
dynstr_append_mem(ds, ds_execute_warnings.str,
|
||||
ds_execute_warnings.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while ( !(err= mysql_stmt_next_result(stmt)));
|
||||
|
||||
if (err > 0)
|
||||
/* We got an error from mysql_next_result, maybe expected */
|
||||
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
|
||||
mysql_sqlstate(mysql), ds);
|
||||
else
|
||||
handle_no_error(command);
|
||||
end:
|
||||
if (!disable_warnings)
|
||||
{
|
||||
|
@ -8611,7 +8623,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
log_file.flush();
|
||||
dynstr_set(&ds_res, 0);
|
||||
|
||||
if (view_protocol_enabled &&
|
||||
if (view_protocol_enabled && mysql &&
|
||||
complete_query &&
|
||||
match_re(&view_re, query))
|
||||
{
|
||||
|
@ -8657,7 +8669,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
dynstr_free(&query_str);
|
||||
}
|
||||
|
||||
if (sp_protocol_enabled &&
|
||||
if (sp_protocol_enabled && mysql &&
|
||||
complete_query &&
|
||||
match_re(&sp_re, query))
|
||||
{
|
||||
|
@ -8720,7 +8732,13 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
*/
|
||||
if (ps_protocol_enabled &&
|
||||
complete_query &&
|
||||
match_re(&ps_re, query))
|
||||
/*
|
||||
Check that a statement is not one of PREPARE FROM, EXECUTE,
|
||||
DEALLOCATE PREPARE (possibly prefixed with the 'SET STATEMENT ... FOR'
|
||||
clause. These statement shouldn't be run using prepared statement C API.
|
||||
All other statements can be run using prepared statement C API.
|
||||
*/
|
||||
!match_re(&ps_re, query))
|
||||
run_query_stmt(cn, command, query, query_len, ds, &ds_warnings);
|
||||
else
|
||||
run_query_normal(cn, command, flags, query, query_len,
|
||||
|
@ -8794,10 +8812,30 @@ void init_re_comp(regex_t *re, const char* str)
|
|||
void init_re(void)
|
||||
{
|
||||
/*
|
||||
Filter for queries that can be run using the
|
||||
MySQL Prepared Statements C API
|
||||
*/
|
||||
* Prior to the task MDEV-16708 a value of the string ps_re_str contained
|
||||
* a regular expression to match statements that SHOULD BE run in PS mode.
|
||||
* The task MDEV-16708 modifies interpretation of this regular expression
|
||||
* and now it is used for matching statements that SHOULDN'T be run in
|
||||
* PS mode. These statement are PREPARE FROM, EXECUTE, DEALLOCATE PREPARE
|
||||
* possibly prefixed with the clause SET STATEMENT ... FOR
|
||||
*/
|
||||
const char *ps_re_str =
|
||||
"^("
|
||||
"[[:space:]]*PREPARE[[:space:]]|"
|
||||
"[[:space:]]*EXECUTE[[:space:]]|"
|
||||
"[[:space:]]*DEALLOCATE[[:space:]]+PREPARE[[:space:]]|"
|
||||
"[[:space:]]*DROP[[:space:]]+PREPARE[[:space:]]|"
|
||||
"(SET[[:space:]]+STATEMENT[[:space:]]+.+[[:space:]]+FOR[[:space:]]+)?"
|
||||
"EXECUTE[[:space:]]+|"
|
||||
"(SET[[:space:]]+STATEMENT[[:space:]]+.+[[:space:]]+FOR[[:space:]]+)?"
|
||||
"PREPARE[[:space:]]+"
|
||||
")";
|
||||
|
||||
/*
|
||||
Filter for queries that can be run using the
|
||||
Stored procedures
|
||||
*/
|
||||
const char *sp_re_str =
|
||||
"^("
|
||||
"[[:space:]]*ALTER[[:space:]]+SEQUENCE[[:space:]]|"
|
||||
"[[:space:]]*ALTER[[:space:]]+TABLE[[:space:]]|"
|
||||
|
@ -8850,12 +8888,6 @@ void init_re(void)
|
|||
"[[:space:]]*UPDATE[[:space:]]"
|
||||
")";
|
||||
|
||||
/*
|
||||
Filter for queries that can be run using the
|
||||
Stored procedures
|
||||
*/
|
||||
const char *sp_re_str =ps_re_str;
|
||||
|
||||
/*
|
||||
Filter for queries that can be run as views
|
||||
*/
|
||||
|
@ -9020,7 +9052,7 @@ static void dump_backtrace(void)
|
|||
struct st_connection *conn= cur_con;
|
||||
|
||||
fprintf(stderr, "read_command_buf (%p): ", read_command_buf);
|
||||
my_safe_print_str(read_command_buf, sizeof(read_command_buf));
|
||||
fprintf(stderr, "%.*s\n", (int)read_command_buflen, read_command_buf);
|
||||
fputc('\n', stderr);
|
||||
|
||||
if (conn)
|
||||
|
|
|
@ -34,7 +34,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
|||
{
|
||||
LINE_BUFFER *line_buff;
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
MY_STAT input_file_stat;
|
||||
if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
|
||||
MY_S_ISDIR(input_file_stat.st_mode) ||
|
||||
|
|
|
@ -128,7 +128,11 @@ SET(ignored
|
|||
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
|
||||
)
|
||||
|
||||
SET(CPACK_RPM_server_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
|
||||
SET(CPACK_RPM_server_USER_FILELIST
|
||||
${ignored}
|
||||
"%config(noreplace) ${INSTALL_SYSCONF2DIR}/*"
|
||||
"%config(noreplace) ${INSTALL_SYSCONFDIR}/logrotate.d/mysql"
|
||||
)
|
||||
SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONFDIR}/my.cnf")
|
||||
SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
|
||||
SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
|
||||
|
|
|
@ -75,7 +75,9 @@ FOREACH(file ${ABI_HEADERS})
|
|||
FILE(REMOVE ${tmpfile})
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
|
||||
IF(NOT ${result} EQUAL 0)
|
||||
IF(result MATCHES "No such file or directory")
|
||||
MESSAGE("Command 'diff' not found. ABI check for ${file} skipped.")
|
||||
ELSEIF(NOT result EQUAL 0)
|
||||
IF(ABI_UPDATE)
|
||||
EXECUTE_PROCESS(COMMAND mv -v ${abi_check_out} ${file}.pp)
|
||||
ELSE(ABI_UPDATE)
|
||||
|
@ -85,4 +87,3 @@ FOREACH(file ${ABI_HEADERS})
|
|||
ENDIF()
|
||||
FILE(REMOVE ${abi_check_out})
|
||||
ENDFOREACH()
|
||||
|
||||
|
|
22
cmake/os/OpenBSD.cmake
Normal file
22
cmake/os/OpenBSD.cmake
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Copyright (C) 2012 Monty Program Ab, 2021 Brad Smith
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
|
||||
|
||||
# This file includes OpenBSD specific options and quirks, related to system checks
|
||||
|
||||
# Find libexecinfo (library that contains backtrace_symbols etc)
|
||||
FIND_LIBRARY(EXECINFO NAMES execinfo)
|
||||
IF(EXECINFO)
|
||||
SET(LIBEXECINFO ${EXECINFO})
|
||||
ENDIF()
|
|
@ -24,6 +24,14 @@ INCLUDE (CheckCSourceRuns)
|
|||
INCLUDE (CheckSymbolExists)
|
||||
INCLUDE (CheckTypeSize)
|
||||
|
||||
IF(MSVC)
|
||||
IF(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL ARM64)
|
||||
SET(MSVC_ARM64 1)
|
||||
SET(MSVC_INTEL 0)
|
||||
ELSE()
|
||||
SET(MSVC_INTEL 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# avoid running system checks by using pre-cached check results
|
||||
# system checks are expensive on VS since every tiny program is to be compiled in
|
||||
|
@ -50,7 +58,7 @@ IF(MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|||
SET(CLANG_CL TRUE)
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00)
|
||||
# We do not want the windows.h macros min/max
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
|
|
|
@ -38,7 +38,10 @@ IF(NOT VERSION)
|
|||
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
|
||||
SET(DEFAULT_PLATFORM "win")
|
||||
IF(64BIT)
|
||||
SET(DEFAULT_MACHINE "x64")
|
||||
STRING(TOLOWER "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" DEFAULT_MACHINE)
|
||||
IF(NOT DEFAULT_MACHINE)
|
||||
SET(DEFAULT_MACHINE "x64")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(DEFAULT_MACHINE "32")
|
||||
ENDIF()
|
||||
|
|
|
@ -28,7 +28,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
|||
RESULT_VARIABLE update_result)
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Updating submodules")
|
||||
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive
|
||||
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive --depth=1
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE update_result)
|
||||
ENDIF()
|
||||
|
|
|
@ -429,7 +429,7 @@
|
|||
#define PSAPI_VERSION 1 /* for GetProcessMemoryInfo() */
|
||||
|
||||
/* We don't want the min/max macros */
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
#define NOMINMAX 1
|
||||
#endif
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ extern void __gcov_flush();
|
|||
#define fnmatch(A,B,C) strcmp(A,B)
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
|
@ -1872,7 +1872,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
|
|||
(void) fprintf(cs->stack->out_file->file, "%5d: ", cs->lineno);
|
||||
if (cs->stack->flags & TIMESTAMP_ON)
|
||||
{
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
/* FIXME This doesn't give microseconds as in Unix case, and the resolution is
|
||||
in system ticks, 10 ms intervals. See my_getsystime.c for high res */
|
||||
SYSTEMTIME loc_t;
|
||||
|
@ -2203,7 +2203,7 @@ void _db_flush_()
|
|||
}
|
||||
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
void _db_suicide_()
|
||||
{
|
||||
int retval;
|
||||
|
@ -2222,7 +2222,7 @@ void _db_suicide_()
|
|||
fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
|
||||
assert(FALSE); /* With full signal mask, we should never return here. */
|
||||
}
|
||||
#endif /* ! __WIN__ */
|
||||
#endif /* ! _WIN32 */
|
||||
|
||||
|
||||
void _db_lock_file_()
|
||||
|
|
34
debian/autobake-deb.sh
vendored
34
debian/autobake-deb.sh
vendored
|
@ -6,12 +6,12 @@
|
|||
# Always keep the actual packaging as up-to-date as possible following the latest
|
||||
# Debian policy and targeting Debian Sid. Then case-by-case run in autobake-deb.sh
|
||||
# tests for backwards compatibility and strip away parts on older builders or
|
||||
# specfic build environments.
|
||||
# specific build environments.
|
||||
|
||||
# Exit immediately on any error
|
||||
set -e
|
||||
|
||||
# This file is invocated from Buildbot and Travis-CI to build deb packages.
|
||||
# This file is invoked from Buildbot and Travis-CI to build deb packages.
|
||||
# As both of those CI systems have many parallel jobs that include different
|
||||
# parts of the test suite, we don't need to run the mysql-test-run at all when
|
||||
# building the deb packages here.
|
||||
|
@ -24,7 +24,7 @@ then
|
|||
echo >> debian/control
|
||||
cat storage/columnstore/columnstore/debian/control >> debian/control
|
||||
|
||||
# ColumnStore is explcitly disabled in the native build, so allow it now
|
||||
# ColumnStore is explicitly disabled in the native build, so allow it now
|
||||
# when build it when triggered by autobake-deb.sh
|
||||
sed '/-DPLUGIN_COLUMNSTORE=NO/d' -i debian/rules
|
||||
fi
|
||||
|
@ -42,7 +42,7 @@ then
|
|||
sed "/Package: mariadb-plugin-columnstore/,/^$/d" -i debian/control
|
||||
fi
|
||||
|
||||
# Don't build or try to put files in a package for selected plugins and compontents on Travis-CI
|
||||
# Don't build or try to put files in a package for selected plugins and components on Travis-CI
|
||||
# in order to keep build small (in both duration and disk space)
|
||||
if [[ $TRAVIS ]]
|
||||
then
|
||||
|
@ -62,27 +62,6 @@ then
|
|||
sed "/Package: libmariadbd-dev/,/^$/d" -i debian/control
|
||||
fi
|
||||
|
||||
## Skip TokuDB if arch is not amd64
|
||||
if [[ ! $(dpkg-architecture -q DEB_BUILD_ARCH) =~ amd64 ]]
|
||||
then
|
||||
sed '/Package: mariadb-plugin-tokudb/,/^$/d' -i debian/control
|
||||
fi
|
||||
|
||||
|
||||
if [[ $(arch) =~ i[346]86 ]]
|
||||
then
|
||||
sed "/Package: mariadb-plugin-rocksdb/,/^$/d" -i debian/control
|
||||
fi
|
||||
|
||||
# From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
|
||||
# transitional metapackage and the functionality was merged into debhelper.
|
||||
# In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
|
||||
# Keep using it only on Debian Jessie and Ubuntu Xenial.
|
||||
if apt-cache madison dh-systemd | grep 'dh-systemd' >/dev/null 2>&1
|
||||
then
|
||||
sed 's/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
|
||||
fi
|
||||
|
||||
# If rocksdb-tools is not available (before Debian Buster and Ubuntu Disco)
|
||||
# remove the dependency from the RocksDB plugin so it can install properly
|
||||
# and instead ship the one built from MariaDB sources
|
||||
|
@ -93,7 +72,8 @@ then
|
|||
echo "usr/bin/sst_dump" >> debian/mariadb-plugin-rocksdb.install
|
||||
fi
|
||||
|
||||
# From Debian Buster/Ubuntu Bionic, libcurl4 replaces libcurl3
|
||||
# If libcurl4 is not available (before Debian Buster and Ubuntu Bionic)
|
||||
# use older libcurl3 instead
|
||||
if ! apt-cache madison libcurl4 | grep 'libcurl4' >/dev/null 2>&1
|
||||
then
|
||||
sed 's/libcurl4/libcurl3/g' -i debian/control
|
||||
|
@ -127,7 +107,7 @@ CODENAME="$(lsb_release -sc)"
|
|||
EPOCH="1:"
|
||||
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}"
|
||||
|
||||
dch -b -D "${CODENAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}."
|
||||
dch -b -D "${CODENAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
|
||||
|
||||
echo "Creating package version ${VERSION} ... "
|
||||
|
||||
|
|
4
debian/mariadb-plugin-connect.install
vendored
4
debian/mariadb-plugin-connect.install
vendored
|
@ -1,6 +1,2 @@
|
|||
etc/mysql/mariadb.conf.d/connect.cnf
|
||||
usr/lib/mysql/plugin/ha_connect.so
|
||||
usr/share/mysql/Mongo2.jar
|
||||
usr/share/mysql/Mongo3.jar
|
||||
usr/share/mysql/JavaWrappers.jar
|
||||
usr/share/mysql/JdbcInterface.jar
|
||||
|
|
16
debian/mariadb-server-10.7.README.Debian
vendored
16
debian/mariadb-server-10.7.README.Debian
vendored
|
@ -31,13 +31,13 @@ name has been kept as a symbolic link to the new name for backwards compatibilit
|
|||
* NATIVE SYSTEMD SERVICE INTRODUCED IN MARIADB 10.1
|
||||
===================================================
|
||||
|
||||
From MariaDB 10.1 onwards the upstream mariadb.service and mariadb@.service are
|
||||
From MariaDB 10.1 onward the upstream mariadb.service and mariadb@.service are
|
||||
used to provide the full systemd experience. Some features available in
|
||||
traditional /etc/init.d/mysql have been changed. For details see
|
||||
https://mariadb.com/kb/en/mariadb/systemd/
|
||||
|
||||
|
||||
* MIXING PACKAGES FROM MARIAD.ORG AND OFFICIAL DEBIAN REPOSITORIES
|
||||
* MIXING PACKAGES FROM MARIADB.ORG AND OFFICIAL DEBIAN REPOSITORIES
|
||||
==================================================================
|
||||
|
||||
Please note that the MariaDB packaging in official Debian repositories are of
|
||||
|
@ -57,7 +57,7 @@ revision string.
|
|||
|
||||
On new installs no root password is set and no debian-sys-maint user is
|
||||
created anymore. Instead the MariaDB root account is set to be authenticated
|
||||
using the unix socket, e.g. any mysqld invocation by root or via sudo will
|
||||
using the Unix socket, e.g. any mysqld invocation by root or via sudo will
|
||||
let the user see the mysqld prompt.
|
||||
|
||||
You may never ever delete the mysql user "root". Although it has no password
|
||||
|
@ -65,7 +65,7 @@ is set, the unix_auth plugin ensure that it can only be run locally as the root
|
|||
user.
|
||||
|
||||
The credentials in /etc/mysql/debian.cnf specify the user which is used by the
|
||||
init scripts to stop the server and perform logrotation. This used to be the
|
||||
init scripts to stop the server and perform log rotation. This used to be the
|
||||
debian-sys-maint user which is no longer used as root can run directly.
|
||||
|
||||
If you have start/stop problems make sure that the /etc/mysql/debian.cnf file
|
||||
|
@ -79,7 +79,7 @@ file as is has been obsoleted.
|
|||
MariaDB in Debian is secure by default, because:
|
||||
|
||||
- It only listens to the localhost socket and cannot be accessed remotely unless
|
||||
the sysadmin changes the configurationin /etc/mysql to allow so.
|
||||
the sysadmin changes the configuration in /etc/mysql to allow so.
|
||||
- There is no debian-sys-maint with password in /etc/mysql/debian.cnf anymore.
|
||||
- There is no root account with password anymore. The system admin needs to
|
||||
create one themselves if they need it. With no password, all issues related
|
||||
|
@ -141,9 +141,9 @@ https://mariadb.com/kb
|
|||
It is recommended you create additional admin users for your database
|
||||
administration needs in addition to the default root user.
|
||||
|
||||
If your local unix account is the one you want to have local super user
|
||||
If your local Unix account is the one you want to have local super user
|
||||
access on your database with you can create the following account that will
|
||||
only work for the local unix user connecting to the database locally.
|
||||
only work for the local Unix user connecting to the database locally.
|
||||
|
||||
sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO '$USER'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION"
|
||||
|
||||
|
@ -176,7 +176,7 @@ https://mariadb.com/kb/en/configuring-mariadb-with-mycnf/.
|
|||
==============================
|
||||
|
||||
If the MySQL server is acting as a replication slave, you should not
|
||||
set --tmpdir to point to a directory on a memory-based filesystem or to
|
||||
set --tmpdir to point to a directory on a memory-based file system or to
|
||||
a directory that is cleared when the server host restarts. A replication
|
||||
slave needs some of its temporary files to survive a machine restart so
|
||||
that it can replicate temporary tables or LOAD DATA INFILE operations. If
|
||||
|
|
4
debian/mariadb-server-10.7.mysql.default
vendored
4
debian/mariadb-server-10.7.mysql.default
vendored
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
# NOTE: This file is read only by the traditional SysV init script.
|
||||
# Debian 9 and Ubuntu 17.04 onwards do not normally read this file as they use
|
||||
# Debian 9 and Ubuntu 17.04 onward do not normally read this file as they use
|
||||
# systemd by default.
|
||||
#
|
||||
# For similar behaviour, systemd users should override ExecStart by dropping
|
||||
# For similar behavior, systemd users should override ExecStart by dropping
|
||||
# files into /etc/systemd/system/mariadb.service.d/
|
||||
#
|
||||
# See also:
|
||||
|
|
2
debian/mariadb-server-10.7.postinst
vendored
2
debian/mariadb-server-10.7.postinst
vendored
|
@ -36,7 +36,7 @@ case "$1" in
|
|||
# latest 'mariadb' file. This has also the added benefit that anything that
|
||||
# invokes traditional sysv init with either 'mysql' or 'mariadb' will end up
|
||||
# controlling this newly installed MariaDB, and thus we maintain better
|
||||
# backwards compatiblity.
|
||||
# backwards compatibility.
|
||||
#
|
||||
# Note that the 'Provides' line is also updated to avoid 'insserv' exiting
|
||||
# on failure (when it is run by update-rc.d) because of duplicate service
|
||||
|
|
1
debian/mariadb-test-data.install
vendored
1
debian/mariadb-test-data.install
vendored
|
@ -4,4 +4,3 @@ usr/share/mysql/mysql-test/main
|
|||
usr/share/mysql/mysql-test/plugin
|
||||
usr/share/mysql/mysql-test/std_data
|
||||
usr/share/mysql/mysql-test/suite
|
||||
usr/share/mysql/mysql-test/unstable-tests
|
||||
|
|
4
debian/mariadb-test.install
vendored
4
debian/mariadb-test.install
vendored
|
@ -25,7 +25,6 @@ usr/share/man/man1/mariadb-client-test-embedded.1
|
|||
usr/share/man/man1/mariadb-client-test.1
|
||||
usr/share/man/man1/mariadb-test-embedded.1
|
||||
usr/share/man/man1/mariadb-test.1
|
||||
usr/share/man/man1/mysql-stress-test.pl.1
|
||||
usr/share/man/man1/mysql-test-run.pl.1
|
||||
usr/share/man/man1/mysql_client_test.1
|
||||
usr/share/man/man1/mysql_client_test_embedded.1
|
||||
|
@ -36,8 +35,9 @@ usr/share/mysql/mysql-test/README-gcov
|
|||
usr/share/mysql/mysql-test/README.stress
|
||||
usr/share/mysql/mysql-test/dgcov.pl
|
||||
usr/share/mysql/mysql-test/lib
|
||||
usr/share/mysql/mysql-test/mysql-stress-test.pl
|
||||
usr/share/mysql/mysql-test/mariadb-stress-test.pl
|
||||
usr/share/mysql/mysql-test/mysql-test-run.pl
|
||||
usr/share/mysql/mysql-test/mariadb-test-run.pl
|
||||
usr/share/mysql/mysql-test/purify.supp
|
||||
usr/share/mysql/mysql-test/suite.pm
|
||||
usr/share/mysql/mysql-test/valgrind.supp
|
||||
|
|
6
debian/mariadb-test.links
vendored
6
debian/mariadb-test.links
vendored
|
@ -2,5 +2,7 @@ usr/bin/mariadb-client-test usr/bin/mysql_client_test
|
|||
usr/bin/mariadb-client-test-embedded usr/bin/mysql_client_test_embedded
|
||||
usr/bin/mariadb-test usr/bin/mysqltest
|
||||
usr/bin/mariadb-test-embedded usr/bin/mysqltest_embedded
|
||||
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mtr
|
||||
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
|
||||
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl
|
||||
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
|
||||
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mtr
|
||||
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mariadb-test-run
|
||||
|
|
11
debian/rules
vendored
11
debian/rules
vendored
|
@ -74,11 +74,7 @@ override_dh_auto_clean:
|
|||
@echo "RULES.$@"
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -rf $(BUILDDIR) builddir-native
|
||||
|
||||
[ ! -f debian/mysql-test-unstable-tests.orig ] || \
|
||||
mv debian/mysql-test-unstable-tests.orig mysql-test/unstable-tests
|
||||
|
||||
rm -rf $(BUILDDIR) builddir-native mysql-test/unstable-tests
|
||||
debconf-updatepo # Update po-files when clean runs before each build
|
||||
|
||||
override_dh_auto_configure:
|
||||
|
@ -121,8 +117,7 @@ override_dh_auto_build:
|
|||
override_dh_auto_test:
|
||||
@echo "RULES.$@"
|
||||
dh_testdir
|
||||
# Skip unstable tests if such are defined for arch
|
||||
cp mysql-test/unstable-tests debian/mysql-test-unstable-tests.orig
|
||||
touch mysql-test/unstable-tests
|
||||
[ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests
|
||||
# Run testsuite
|
||||
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
||||
|
@ -155,7 +150,7 @@ endif
|
|||
# If mariadb-test package is removed, also remove most of it's files
|
||||
grep --quiet "Package: mariadb-test" debian/control || rm -rf $(TMP)/usr/share/mysql/mysql-test
|
||||
|
||||
# Delete private files from libraries so they don't get shipped in the -dev pacakges
|
||||
# Delete private files from libraries so they don't get shipped in the -dev packages
|
||||
rm -r $(TMP)/usr/include/mariadb/server/private
|
||||
|
||||
# Don't ship sql-bench at all, just delete it completely even though it builds
|
||||
|
|
9
debian/salsa-ci.yml
vendored
9
debian/salsa-ci.yml
vendored
|
@ -62,9 +62,6 @@ build i386:
|
|||
image: $SALSA_CI_IMAGES_BASE_I386
|
||||
variables:
|
||||
ARCH: 'i386'
|
||||
except:
|
||||
variables:
|
||||
- $SALSA_CI_DISABLE_BUILD_PACKAGE_I386 =~ /^(1|yes|true)$/
|
||||
|
||||
build native deb:
|
||||
extends: .build-package
|
||||
|
@ -566,8 +563,6 @@ mysql-8.0 Sid to mariadb-10.6 upgrade:
|
|||
except:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
|
||||
# Installation often fails (not a MariaDB reason), so do not require this test to pass
|
||||
allow_failure: true
|
||||
|
||||
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
|
||||
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
|
||||
|
@ -622,12 +617,12 @@ mariadb.org-10.5 to mariadb-10.6 upgrade:
|
|||
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
|
||||
- echo 'deb http://mirror.one.com/mariadb/repo/10.5/debian sid main' > /etc/apt/sources.list.d/mariadb.list
|
||||
- apt-get update
|
||||
# The 10.5.9 relase is missing mariadb-plugin-columnstore, define all other packages but it to avoid hitting the error:
|
||||
# The 10.5.9 release is missing mariadb-plugin-columnstore, define all other packages but it to avoid hitting the error:
|
||||
# The following packages have unmet dependencies:
|
||||
# mariadb-plugin-columnstore : Depends: mariadb-server-10.5 (= 1:10.5.8+maria~sid) but 1:10.5.9+maria~sid is to be installed
|
||||
- apt-get install -y libmariadb3 'libmariadb-*' 'libmariadbd*' 'mariadb-c*' 'mariadb-b*' 'mariadb-s*' 'mariadb-t*' 'mariadb-plugin-con*' 'mariadb-plugin-cr*' 'mariadb-plugin-g*' 'mariadb-plugin-m*' 'mariadb-plugin-o*' 'mariadb-plugin-s*'
|
||||
# Once 10.5.10 is out, revert back to:
|
||||
# Package libmariadbclient-dev from mariadb.org conficts with libmariadb-dev in Sid, so cannot use wildcard that would include it
|
||||
# Package libmariadbclient-dev from mariadb.org conflicts with libmariadb-dev in Sid, so cannot use wildcard that would include it
|
||||
#- apt-get install -y 'mariadb*' libmariadb3 'libmariadb-*' 'libmariadbd*'
|
||||
- *test-verify-initial
|
||||
# Install MariaDB built in this commit
|
||||
|
|
2
debian/tests/control
vendored
2
debian/tests/control
vendored
|
@ -1,7 +1,7 @@
|
|||
Tests: smoke
|
||||
# RocksDB is not built for all archs. Rather than duplicating the condition
|
||||
# for its existence (see the list in debian/control), install it if available
|
||||
# and check in the test if it's funcational when it should be.
|
||||
# and check in the test if it's functional when it should be.
|
||||
# The plugin package also already depends on the other one.
|
||||
Depends: mariadb-plugin-rocksdb | mariadb-server-10.7
|
||||
Restrictions: allow-stderr needs-root isolation-container
|
||||
|
|
2
debian/tests/smoke
vendored
2
debian/tests/smoke
vendored
|
@ -31,7 +31,7 @@ if ! which systemctl
|
|||
then
|
||||
if ! /etc/init.d/mariadb status
|
||||
then
|
||||
echo "Did not find systemctl and deamon was not running, starting it.."
|
||||
echo "Did not find systemctl and daemon was not running, starting it.."
|
||||
/etc/init.d/mariadb start
|
||||
fi
|
||||
else
|
||||
|
|
3
debian/tests/upstream
vendored
3
debian/tests/upstream
vendored
|
@ -22,8 +22,7 @@ echo "using tmpdir: $WORKDIR/tmp"
|
|||
|
||||
echo "Setting up skip-tests-list"
|
||||
|
||||
# Use unstable-tests list as base to skip all tests considered unstable
|
||||
cp /usr/share/mysql/mysql-test/unstable-tests $SKIP_TEST_LST
|
||||
touch $SKIP_TEST_LST
|
||||
|
||||
# Also use arch specific skiplists if such files exist
|
||||
for filename in /usr/share/mysql/mysql-test/unstable-tests.*
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <my_getopt.h>
|
||||
|
@ -103,13 +103,10 @@ struct flock lk;
|
|||
struct innodb_page_type {
|
||||
int n_undo_state_active;
|
||||
int n_undo_state_cached;
|
||||
int n_undo_state_to_free;
|
||||
int n_undo_state_to_purge;
|
||||
int n_undo_state_prepared;
|
||||
int n_undo_state_other;
|
||||
int n_undo_insert;
|
||||
int n_undo_update;
|
||||
int n_undo_other;
|
||||
int n_undo;
|
||||
int n_fil_page_index;
|
||||
int n_fil_page_undo_log;
|
||||
int n_fil_page_inode;
|
||||
|
@ -876,21 +873,7 @@ parse_page(
|
|||
fprintf(file, "#::%llu\t\t|\t\tUndo log page\t\t\t|",
|
||||
cur_page_num);
|
||||
}
|
||||
if (undo_page_type == TRX_UNDO_INSERT) {
|
||||
page_type.n_undo_insert++;
|
||||
if (page_type_dump) {
|
||||
fprintf(file, "\t%s",
|
||||
"Insert Undo log page");
|
||||
}
|
||||
|
||||
} else if (undo_page_type == TRX_UNDO_UPDATE) {
|
||||
page_type.n_undo_update++;
|
||||
if (page_type_dump) {
|
||||
fprintf(file, "\t%s",
|
||||
"Update undo log page");
|
||||
}
|
||||
}
|
||||
|
||||
page_type.n_undo++;
|
||||
undo_page_type = mach_read_from_2(page + TRX_UNDO_SEG_HDR +
|
||||
TRX_UNDO_STATE);
|
||||
switch (undo_page_type) {
|
||||
|
@ -910,14 +893,6 @@ parse_page(
|
|||
}
|
||||
break;
|
||||
|
||||
case TRX_UNDO_TO_FREE:
|
||||
page_type.n_undo_state_to_free++;
|
||||
if (page_type_dump) {
|
||||
fprintf(file, ", %s", "Insert undo "
|
||||
"segment that can be freed");
|
||||
}
|
||||
break;
|
||||
|
||||
case TRX_UNDO_TO_PURGE:
|
||||
page_type.n_undo_state_to_purge++;
|
||||
if (page_type_dump) {
|
||||
|
@ -1141,15 +1116,11 @@ print_summary(
|
|||
|
||||
fprintf(fil_out, "\n===============================================\n");
|
||||
fprintf(fil_out, "Additional information:\n");
|
||||
fprintf(fil_out, "Undo page type: %d insert, %d update, %d other\n",
|
||||
page_type.n_undo_insert,
|
||||
page_type.n_undo_update,
|
||||
page_type.n_undo_other);
|
||||
fprintf(fil_out, "Undo page state: %d active, %d cached, %d to_free, %d"
|
||||
fprintf(fil_out, "Undo page type: %d\n", page_type.n_undo);
|
||||
fprintf(fil_out, "Undo page state: %d active, %d cached, %d"
|
||||
" to_purge, %d prepared, %d other\n",
|
||||
page_type.n_undo_state_active,
|
||||
page_type.n_undo_state_cached,
|
||||
page_type.n_undo_state_to_free,
|
||||
page_type.n_undo_state_to_purge,
|
||||
page_type.n_undo_state_prepared,
|
||||
page_type.n_undo_state_other);
|
||||
|
|
|
@ -921,9 +921,11 @@ bool lock_tables(MYSQL *connection)
|
|||
}
|
||||
|
||||
xb_mysql_query(connection, "BACKUP STAGE START", true);
|
||||
DBUG_MARIABACKUP_EVENT("after_backup_stage_start", {});
|
||||
// xb_mysql_query(connection, "BACKUP STAGE FLUSH", true);
|
||||
// xb_mysql_query(connection, "BACKUP STAGE BLOCK_DDL", true);
|
||||
xb_mysql_query(connection, "BACKUP STAGE BLOCK_COMMIT", true);
|
||||
DBUG_MARIABACKUP_EVENT("after_backup_stage_block_commit", {});
|
||||
/* Set the maximum supported session value for
|
||||
lock_wait_timeout to prevent unnecessary timeouts when the
|
||||
global value is changed from the default */
|
||||
|
|
|
@ -75,7 +75,7 @@ stdout_open(ds_ctxt_t *ctxt __attribute__((unused)),
|
|||
stdout_file = (ds_stdout_file_t *) (file + 1);
|
||||
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
setmode(fileno(stdout), _O_BINARY);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ xb_stream_read_new(void)
|
|||
|
||||
stream = (xb_rstream_t *) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(xb_rstream_t), MYF(MY_FAE));
|
||||
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
setmode(fileno(stdin), _O_BINARY);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ xb_stream_write_open(xb_wstream_t *stream, const char *path,
|
|||
file->chunk_ptr = file->chunk;
|
||||
file->chunk_free = XB_STREAM_MIN_CHUNK_SIZE;
|
||||
if (onwrite) {
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
setmode(fileno(stdout), _O_BINARY);
|
||||
#endif
|
||||
file->userdata = userdata;
|
||||
|
|
|
@ -1398,7 +1398,7 @@ struct my_option xb_server_options[] =
|
|||
(G_PTR*) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tmpdir", 't',
|
||||
"Path for temporary files. Several paths may be specified, separated by a "
|
||||
#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
|
||||
#if defined(_WIN32)
|
||||
"semicolon (;)"
|
||||
#else
|
||||
"colon (:)"
|
||||
|
@ -2414,7 +2414,8 @@ find_filter_in_hashtable(
|
|||
)
|
||||
{
|
||||
xb_filter_entry_t* found = NULL;
|
||||
HASH_SEARCH(name_hash, table, ut_fold_string(name),
|
||||
const ulint fold = my_crc32c(0, name, strlen(name));
|
||||
HASH_SEARCH(name_hash, table, fold,
|
||||
xb_filter_entry_t*,
|
||||
found, (void) 0,
|
||||
!strcmp(found->name, name));
|
||||
|
@ -2545,11 +2546,24 @@ check_if_skip_table(
|
|||
|
||||
dbname = NULL;
|
||||
tbname = name;
|
||||
while ((ptr = strchr(tbname, '/')) != NULL) {
|
||||
for (;;) {
|
||||
ptr= strchr(tbname, '/');
|
||||
#ifdef _WIN32
|
||||
if (!ptr) {
|
||||
ptr= strchr(tbname,'\\');
|
||||
}
|
||||
#endif
|
||||
if (!ptr) {
|
||||
break;
|
||||
}
|
||||
dbname = tbname;
|
||||
tbname = ptr + 1;
|
||||
}
|
||||
|
||||
if (strncmp(tbname, tmp_file_prefix, tmp_file_prefix_length) == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (regex_exclude_list.empty() &&
|
||||
regex_include_list.empty() &&
|
||||
!tables_include_hash.array &&
|
||||
|
@ -3037,7 +3051,7 @@ To use this facility, you need to
|
|||
for the variable)
|
||||
3. start mariabackup with --dbug=+d,debug_mariabackup_events
|
||||
*/
|
||||
static void dbug_mariabackup_event(const char *event,
|
||||
void dbug_mariabackup_event(const char *event,
|
||||
const fil_space_t::name_type key)
|
||||
{
|
||||
char *sql = dbug_mariabackup_get_val(event, key);
|
||||
|
@ -3046,10 +3060,6 @@ static void dbug_mariabackup_event(const char *event,
|
|||
xb_mysql_query(mysql_connection, sql, false, true);
|
||||
}
|
||||
}
|
||||
# define DBUG_MARIABACKUP_EVENT(A, B) \
|
||||
DBUG_EXECUTE_IF("mariabackup_events", dbug_mariabackup_event(A,B);)
|
||||
#else
|
||||
# define DBUG_MARIABACKUP_EVENT(A, B) /* empty */
|
||||
#endif // DBUG_OFF
|
||||
|
||||
/** Datafiles copying thread.*/
|
||||
|
@ -3874,22 +3884,16 @@ new hash table */
|
|||
static
|
||||
xb_filter_entry_t*
|
||||
xb_add_filter(
|
||||
/*========================*/
|
||||
const char* name, /*!< in: name of table/database */
|
||||
hash_table_t* hash) /*!< in/out: hash to insert into */
|
||||
{
|
||||
xb_filter_entry_t* entry;
|
||||
|
||||
entry = xb_new_filter_entry(name);
|
||||
xb_filter_entry_t* entry = xb_new_filter_entry(name);
|
||||
|
||||
if (UNIV_UNLIKELY(!hash->array)) {
|
||||
hash->create(1000);
|
||||
}
|
||||
HASH_INSERT(xb_filter_entry_t,
|
||||
name_hash, hash,
|
||||
ut_fold_string(entry->name),
|
||||
entry);
|
||||
|
||||
const ulint fold = my_crc32c(0, entry->name, strlen(entry->name));
|
||||
HASH_INSERT(xb_filter_entry_t, name_hash, hash, fold, entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
@ -3943,8 +3947,9 @@ xb_register_filter_entry(
|
|||
dbname[p - name] = 0;
|
||||
|
||||
if (databases_hash && databases_hash->array) {
|
||||
const ulint fold = my_crc32c(0, dbname, p - name);
|
||||
HASH_SEARCH(name_hash, databases_hash,
|
||||
ut_fold_string(dbname),
|
||||
fold,
|
||||
xb_filter_entry_t*,
|
||||
db_entry, (void) 0,
|
||||
!strcmp(db_entry->name, dbname));
|
||||
|
@ -4153,9 +4158,10 @@ xb_filter_hash_free(hash_table_t* hash)
|
|||
|
||||
table = static_cast<xb_filter_entry_t *>
|
||||
(HASH_GET_NEXT(name_hash, prev_table));
|
||||
|
||||
const ulint fold = my_crc32c(0, prev_table->name,
|
||||
strlen(prev_table->name));
|
||||
HASH_DELETE(xb_filter_entry_t, name_hash, hash,
|
||||
ut_fold_string(prev_table->name), prev_table);
|
||||
fold, prev_table);
|
||||
free(prev_table);
|
||||
}
|
||||
}
|
||||
|
@ -5049,15 +5055,17 @@ exit:
|
|||
return file;
|
||||
}
|
||||
|
||||
const size_t len = strlen(dest_space_name);
|
||||
/* remember space name for further reference */
|
||||
table = static_cast<xb_filter_entry_t *>
|
||||
(malloc(sizeof(xb_filter_entry_t) +
|
||||
strlen(dest_space_name) + 1));
|
||||
len + 1));
|
||||
|
||||
table->name = ((char*)table) + sizeof(xb_filter_entry_t);
|
||||
strcpy(table->name, dest_space_name);
|
||||
memcpy(table->name, dest_space_name, len + 1);
|
||||
const ulint fold = my_crc32c(0, dest_space_name, len);
|
||||
HASH_INSERT(xb_filter_entry_t, name_hash, &inc_dir_tables_hash,
|
||||
ut_fold_string(table->name), table);
|
||||
fold, table);
|
||||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
fil_space = fil_space_get_by_name(dest_space_name);
|
||||
|
@ -5458,8 +5466,10 @@ static ibool prepare_handle_new_files(const char *data_home_dir,
|
|||
(malloc(sizeof(xb_filter_entry_t) + table_name.size() + 1));
|
||||
table->name = ((char*)table) + sizeof(xb_filter_entry_t);
|
||||
strcpy(table->name, table_name.c_str());
|
||||
const ulint fold = my_crc32c(0, table->name,
|
||||
table_name.size());
|
||||
HASH_INSERT(xb_filter_entry_t, name_hash, &inc_dir_tables_hash,
|
||||
ut_fold_string(table->name), table);
|
||||
fold, table);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -5482,9 +5492,11 @@ rm_if_not_found(
|
|||
|
||||
snprintf(name, FN_REFLEN, "%s/%s", db_name, file_name);
|
||||
/* Truncate ".ibd" */
|
||||
name[strlen(name) - 4] = '\0';
|
||||
const size_t len = strlen(name) - 4;
|
||||
name[len] = '\0';
|
||||
const ulint fold = my_crc32c(0, name, len);
|
||||
|
||||
HASH_SEARCH(name_hash, &inc_dir_tables_hash, ut_fold_string(name),
|
||||
HASH_SEARCH(name_hash, &inc_dir_tables_hash, fold,
|
||||
xb_filter_entry_t*,
|
||||
table, (void) 0,
|
||||
!strcmp(table->name, name));
|
||||
|
@ -6690,7 +6702,7 @@ static int main_low(char** argv)
|
|||
/* get default temporary directory */
|
||||
if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0]) {
|
||||
opt_mysql_tmpdir = getenv("TMPDIR");
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
if (!opt_mysql_tmpdir) {
|
||||
opt_mysql_tmpdir = getenv("TEMP");
|
||||
}
|
||||
|
|
|
@ -284,4 +284,16 @@ fil_file_readdir_next_file(
|
|||
os_file_dir_t dir, /*!< in: directory stream */
|
||||
os_file_stat_t* info); /*!< in/out: buffer where the
|
||||
info is returned */
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
#include <fil0fil.h>
|
||||
extern void dbug_mariabackup_event(const char *event,
|
||||
const fil_space_t::name_type key);
|
||||
|
||||
#define DBUG_MARIABACKUP_EVENT(A, B) \
|
||||
DBUG_EXECUTE_IF("mariabackup_events", dbug_mariabackup_event(A, B);)
|
||||
#else
|
||||
#define DBUG_MARIABACKUP_EVENT(A, B) /* empty */
|
||||
#endif // DBUG_OFF
|
||||
|
||||
#endif /* XB_XTRABACKUP_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
IF(MSVC)
|
||||
IF(MSVC_INTEL)
|
||||
PROJECT(wolfssl C ASM_MASM)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
|
||||
PROJECT(wolfssl C ASM)
|
||||
|
@ -7,7 +7,7 @@ ELSE()
|
|||
ENDIF()
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
IF(MSVC)
|
||||
IF(MSVC_INTEL)
|
||||
SET(WOLFSSL_INTELASM ON)
|
||||
SET(WOLFSSL_X86_64_BUILD 1)
|
||||
SET(HAVE_INTEL_RDSEED 1)
|
||||
|
@ -134,6 +134,7 @@ IF(WOLFSSL_X86_64_BUILD)
|
|||
SET(USE_INTEL_SPEEDUP 1)
|
||||
LIST(APPEND WOLFCRYPT_SOURCES
|
||||
${WOLFCRYPT_SRCDIR}/aes_asm.S
|
||||
${WOLFCRYPT_SRCDIR}/aes_gcm_asm.S
|
||||
${WOLFCRYPT_SRCDIR}/sha512_asm.S
|
||||
${WOLFCRYPT_SRCDIR}/sha256_asm.S)
|
||||
ADD_DEFINITIONS(-maes -msse4.2 -mpclmul)
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
#define WC_RSA_BLINDING
|
||||
#define HAVE_TLS_EXTENSIONS
|
||||
#define HAVE_AES_ECB
|
||||
#define HAVE_AESGCM
|
||||
#define WOLFSSL_AES_COUNTER
|
||||
#define NO_WOLFSSL_STUB
|
||||
#define OPENSSL_ALL
|
||||
#undef WOLFSSL_ALLOW_TLSV10 /* see https://github.com/wolfSSL/wolfssl/issues/2960 */
|
||||
#define WOLFSSL_ALLOW_TLSV10
|
||||
#define NO_OLD_TIMEVAL_NAME
|
||||
/*
|
||||
FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013 SkySQL Ab
|
||||
/* Copyright (c) 2013, 2021, MariaDB Corporation.
|
||||
|
||||
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
|
||||
|
@ -74,7 +74,6 @@
|
|||
{ "HA_ERR_INDEX_COL_TOO_LONG", HA_ERR_INDEX_COL_TOO_LONG, "" },
|
||||
{ "HA_ERR_INDEX_CORRUPT", HA_ERR_INDEX_CORRUPT, "" },
|
||||
{ "HA_ERR_UNDO_REC_TOO_BIG", HA_ERR_UNDO_REC_TOO_BIG, "" },
|
||||
{ "HA_ERR_TABLE_IN_FK_CHECK", HA_ERR_TABLE_IN_FK_CHECK, "" },
|
||||
{ "HA_ERR_ROW_NOT_VISIBLE", HA_ERR_ROW_NOT_VISIBLE, "" },
|
||||
{ "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" },
|
||||
{ "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" },
|
||||
|
|
|
@ -43,9 +43,10 @@ public:
|
|||
|
||||
Type load(std::memory_order o= std::memory_order_relaxed) const
|
||||
{ return m.load(o); }
|
||||
void store(Type i, std::memory_order o= std::memory_order_relaxed)
|
||||
{ m.store(i, o); }
|
||||
operator Type() const { return m.load(); }
|
||||
Type operator=(const Type val)
|
||||
{ m.store(val, std::memory_order_relaxed); return val; }
|
||||
Type operator=(const Type i) { store(i); return i; }
|
||||
Type operator=(const Atomic_relaxed<Type> &rhs) { return *this= Type{rhs}; }
|
||||
Type operator+=(const Type i) { return fetch_add(i); }
|
||||
Type fetch_add(const Type i, std::memory_order o= std::memory_order_relaxed)
|
||||
|
|
|
@ -513,7 +513,7 @@ enum ha_base_keytype {
|
|||
#define HA_ERR_INDEX_CORRUPT 180 /* Index corrupted */
|
||||
#define HA_ERR_UNDO_REC_TOO_BIG 181 /* Undo log record too big */
|
||||
#define HA_FTS_INVALID_DOCID 182 /* Invalid InnoDB Doc ID */
|
||||
#define HA_ERR_TABLE_IN_FK_CHECK 183 /* Table being used in foreign key check */
|
||||
/* #define HA_ERR_TABLE_IN_FK_CHECK 183 */ /* Table being used in foreign key check */
|
||||
#define HA_ERR_TABLESPACE_EXISTS 184 /* The tablespace existed in storage engine */
|
||||
#define HA_ERR_TOO_MANY_FIELDS 185 /* Table has too many columns */
|
||||
#define HA_ERR_ROW_IN_WRONG_PARTITION 186 /* Row in wrong partition */
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
format (low byte first). There are 'korr' (assume 'corrector') variants
|
||||
for integer types, but 'get' (assume 'getter') for floating point types.
|
||||
*/
|
||||
#if (defined(__i386__) || defined(_WIN32)) && !defined(WITH_UBSAN)
|
||||
#if (defined(__i386__) || defined(_M_IX86)) && !defined(WITH_UBSAN)
|
||||
#define MY_BYTE_ORDER_ARCH_OPTIMIZED
|
||||
#include "byte_order_generic_x86.h"
|
||||
#elif defined(__x86_64__) && !defined(WITH_UBSAN)
|
||||
#elif (defined(__x86_64__) || defined (_M_X64)) && !defined(WITH_UBSAN)
|
||||
#include "byte_order_generic_x86_64.h"
|
||||
#else
|
||||
#include "byte_order_generic.h"
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
#ifndef _my_dbug_h
|
||||
#define _my_dbug_h
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
#include <signal.h>
|
||||
#endif /* not __WIN__ */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -134,7 +134,7 @@ extern int (*dbug_sanity)(void);
|
|||
#define DBUG_FREE_CODE_STATE(arg) dbug_free_code_state(arg)
|
||||
#undef DBUG_ASSERT_AS_PRINTF
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
#define DBUG_ABORT() (_db_flush_(), abort())
|
||||
#else
|
||||
/*
|
||||
|
@ -156,12 +156,12 @@ extern int (*dbug_sanity)(void);
|
|||
An alternative would be to use _exit(EXIT_FAILURE),
|
||||
but then valgrind would report lots of memory leaks.
|
||||
*/
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
#define DBUG_SUICIDE() DBUG_ABORT()
|
||||
#else
|
||||
extern void _db_suicide_(void);
|
||||
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
|
||||
#endif /* __WIN__ */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#else /* No debugger */
|
||||
|
||||
|
|
|
@ -20,9 +20,17 @@
|
|||
#ifndef MY_GLOBAL_INCLUDED
|
||||
#define MY_GLOBAL_INCLUDED
|
||||
|
||||
/* Client library users on Windows need this macro defined here. */
|
||||
#if !defined(__WIN__) && defined(_WIN32)
|
||||
#define __WIN__
|
||||
/*
|
||||
MDEV-25602 Deprecate __WIN__ symbol.
|
||||
Temporarily, allow inside connect engine,
|
||||
until fixed in upstream.
|
||||
*/
|
||||
#ifndef connect_EXPORTS
|
||||
#ifdef _MSC_VER
|
||||
#pragma deprecated("__WIN__")
|
||||
#elif defined (__GNUC__)
|
||||
#pragma GCC poison __WIN__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -43,7 +51,7 @@
|
|||
#undef _WIN
|
||||
#undef _WIN32
|
||||
#undef _WIN64
|
||||
#undef __WIN__
|
||||
#undef _WIN32
|
||||
#undef __WIN32__
|
||||
#define HAVE_ERRNO_AS_DEFINE
|
||||
#define _POSIX_MONOTONIC_CLOCK
|
||||
|
@ -79,7 +87,7 @@
|
|||
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
|
||||
|
||||
/* Make it easier to add conditional code in _expressions_ */
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
#define IF_WIN(A,B) A
|
||||
#else
|
||||
#define IF_WIN(A,B) B
|
||||
|
@ -240,7 +248,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
|
||||
#endif
|
||||
|
@ -261,7 +269,7 @@ C_MODE_END
|
|||
#if !defined(SCO) && !defined(_REENTRANT)
|
||||
#define _REENTRANT 1 /* Threads requires reentrant code */
|
||||
#endif
|
||||
#endif /* !defined(__WIN__) */
|
||||
#endif /* !defined(_WIN32) */
|
||||
|
||||
/* gcc/egcs issues */
|
||||
|
||||
|
@ -588,12 +596,12 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
#endif
|
||||
|
||||
/* additional file share flags for win32 */
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
|
||||
#define _SH_DENYWRD 0x120 /* deny write mode & delete */
|
||||
#define _SH_DENYRDD 0x130 /* deny read mode & delete */
|
||||
#define _SH_DENYDEL 0x140 /* deny delete only */
|
||||
#endif /* __WIN__ */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/* General constants */
|
||||
|
@ -693,7 +701,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
/* Some defines of functions for portability */
|
||||
|
||||
#undef remove /* Crashes MySQL on SCO 5.0.0 */
|
||||
#ifndef __WIN__
|
||||
#ifndef _WIN32
|
||||
#define closesocket(A) close(A)
|
||||
#endif
|
||||
|
||||
|
@ -915,7 +923,7 @@ typedef ulonglong uint64;
|
|||
|
||||
#if defined(NO_CLIENT_LONG_LONG)
|
||||
typedef unsigned long my_ulonglong;
|
||||
#elif defined (__WIN__)
|
||||
#elif defined (_WIN32)
|
||||
typedef unsigned __int64 my_ulonglong;
|
||||
#else
|
||||
typedef unsigned long long my_ulonglong;
|
||||
|
@ -955,7 +963,7 @@ typedef ulonglong table_map; /* Used for table bits in join */
|
|||
typedef const struct charset_info_st CHARSET_INFO;
|
||||
typedef struct st_mysql_lex_string LEX_STRING;
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
#define socket_errno WSAGetLastError()
|
||||
#define SOCKET_EINTR WSAEINTR
|
||||
#define SOCKET_ETIMEDOUT WSAETIMEDOUT
|
||||
|
|
|
@ -43,7 +43,7 @@ C_MODE_START
|
|||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
|
@ -52,7 +52,7 @@ C_MODE_START
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
#define O_NONBLOCK 1 /* For emulation of fcntl() */
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
#define EXTERNC
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
typedef CRITICAL_SECTION pthread_mutex_t;
|
||||
typedef DWORD pthread_t;
|
||||
typedef struct thread_attr {
|
||||
|
@ -277,7 +277,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
|
|||
#define HAVE_PTHREAD_KILL 1
|
||||
#endif
|
||||
|
||||
#endif /* defined(__WIN__) */
|
||||
#endif /* defined(_WIN32) */
|
||||
|
||||
#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
|
||||
#undef pthread_cond_timedwait
|
||||
|
|
|
@ -130,8 +130,10 @@ static inline ulonglong my_timer_cycles(void)
|
|||
{
|
||||
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
|
||||
return __builtin_readcyclecounter();
|
||||
# elif defined _WIN32 || defined __i386__ || defined __x86_64__
|
||||
# elif defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__
|
||||
return __rdtsc();
|
||||
#elif defined _M_ARM64
|
||||
return _ReadStatusReg(ARM64_CNTVCT);
|
||||
# elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
|
||||
return (ulonglong) __getReg(_IA64_REG_AR_ITC); /* (3116) */
|
||||
#elif defined(__GNUC__) && defined(__ia64__)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
(defined(__alpha__) && defined(__GNUC__))
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
#elif defined(__WIN__) || defined(HAVE_PRINTSTACK)
|
||||
#elif defined(_WIN32) || defined(HAVE_PRINTSTACK)
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
|
||||
|
@ -49,12 +49,12 @@ void my_write_core(int sig);
|
|||
# if BACKTRACE_DEMANGLE
|
||||
char *my_demangle(const char *mangled_name, int *status);
|
||||
# endif /* BACKTRACE_DEMANGLE */
|
||||
# ifdef __WIN__
|
||||
# ifdef _WIN32
|
||||
# define my_setup_stacktrace()
|
||||
void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
|
||||
# else
|
||||
void my_setup_stacktrace(void);
|
||||
# endif /* __WIN__ */
|
||||
# endif /* _WIN32 */
|
||||
#else
|
||||
# define my_setup_stacktrace()
|
||||
#endif /* ! (defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)) */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2020, MariaDB Corporation.
|
||||
Copyright (c) 2010, 2021, MariaDB Corporation.
|
||||
|
||||
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
|
||||
|
@ -185,8 +185,10 @@ extern BOOL my_obtain_privilege(LPCSTR lpPrivilege);
|
|||
void my_init_atomic_write(void);
|
||||
#ifdef __linux__
|
||||
my_bool my_test_if_atomic_write(File handle, int pagesize);
|
||||
my_bool my_test_if_thinly_provisioned(File handle);
|
||||
#else
|
||||
#define my_test_if_atomic_write(A, B) 0
|
||||
# define my_test_if_atomic_write(A, B) 0
|
||||
# define my_test_if_thinly_provisioned(A) 0
|
||||
#endif /* __linux__ */
|
||||
extern my_bool my_may_have_atomic_write;
|
||||
|
||||
|
|
|
@ -32,13 +32,6 @@
|
|||
#include <standards.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */
|
||||
#undef WIN
|
||||
#undef _WIN
|
||||
#undef _WIN32
|
||||
#undef _WIN64
|
||||
#undef __WIN__
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -53,10 +46,7 @@ extern "C" {
|
|||
typedef char my_bool;
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__)
|
||||
#define __WIN__
|
||||
#endif
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#define STDCALL
|
||||
#else
|
||||
#define STDCALL __stdcall
|
||||
|
@ -130,7 +120,7 @@ typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
|
|||
#ifndef MY_GLOBAL_INCLUDED
|
||||
#if defined(NO_CLIENT_LONG_LONG)
|
||||
typedef unsigned long my_ulonglong;
|
||||
#elif defined (__WIN__)
|
||||
#elif defined (_WIN32)
|
||||
typedef unsigned __int64 my_ulonglong;
|
||||
#else
|
||||
typedef unsigned long long my_ulonglong;
|
||||
|
|
|
@ -660,6 +660,8 @@ int thd_in_lock_tables(const MYSQL_THD thd);
|
|||
int thd_tablespace_op(const MYSQL_THD thd);
|
||||
long long thd_test_options(const MYSQL_THD thd, long long test_options);
|
||||
int thd_sql_command(const MYSQL_THD thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const MYSQL_THD thd);
|
||||
void thd_storage_lock_wait(MYSQL_THD thd, long long value);
|
||||
int thd_tx_isolation(const MYSQL_THD thd);
|
||||
int thd_tx_is_read_only(const MYSQL_THD thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -560,6 +560,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -608,6 +608,8 @@ int thd_in_lock_tables(const THD* thd);
|
|||
int thd_tablespace_op(const THD* thd);
|
||||
long long thd_test_options(const THD* thd, long long test_options);
|
||||
int thd_sql_command(const THD* thd);
|
||||
struct DDL_options_st;
|
||||
struct DDL_options_st *thd_ddl_options(const THD* thd);
|
||||
void thd_storage_lock_wait(THD* thd, long long value);
|
||||
int thd_tx_isolation(const THD* thd);
|
||||
int thd_tx_is_read_only(const THD* thd);
|
||||
|
|
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
/* The max key length of all supported algorithms */
|
||||
#define MY_AES_MAX_KEY_LENGTH 32
|
||||
|
||||
#define MY_AES_CTX_SIZE 640
|
||||
#define MY_AES_CTX_SIZE 656
|
||||
|
||||
enum my_aes_mode {
|
||||
MY_AES_ECB, MY_AES_CBC
|
||||
|
|
|
@ -96,10 +96,10 @@
|
|||
#define LOCAL_HOST_NAMEDPIPE "."
|
||||
|
||||
|
||||
#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
|
||||
#if defined(_WIN32) && !defined( _CUSTOMCONFIG_)
|
||||
#define MYSQL_NAMEDPIPE "MySQL"
|
||||
#define MYSQL_SERVICENAME "MySQL"
|
||||
#endif /* __WIN__ */
|
||||
#endif
|
||||
|
||||
/*
|
||||
You should add new commands to the end of this list, otherwise old
|
||||
|
|
|
@ -65,7 +65,7 @@ typedef my_bool ALARM;
|
|||
#define end_thr_alarm(A)
|
||||
|
||||
#else
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
typedef struct st_thr_alarm_entry
|
||||
{
|
||||
UINT_PTR crono;
|
||||
|
@ -77,7 +77,7 @@ typedef int thr_alarm_entry;
|
|||
|
||||
#define thr_got_alarm(thr_alarm) (**(thr_alarm))
|
||||
|
||||
#endif /* __WIN__ */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
typedef thr_alarm_entry* thr_alarm_t;
|
||||
|
||||
|
|
|
@ -74,11 +74,11 @@ struct vio_keepalive_opts
|
|||
|
||||
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
|
||||
Vio* mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
Vio* vio_new_win32pipe(HANDLE hPipe);
|
||||
#else
|
||||
#define HANDLE void *
|
||||
#endif /* __WIN__ */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
void vio_delete(Vio* vio);
|
||||
int vio_close(Vio* vio);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 01ada4b85f15c1c5841082f92180bf129d89debc
|
||||
Subproject commit fffa8167d883bbf841ecb04a77abe2fbf1d1dfc9
|
|
@ -115,7 +115,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
NET *net= &mysql->net;
|
||||
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
|
||||
|
||||
if (thd->killed != NOT_KILLED)
|
||||
if (thd && thd->killed != NOT_KILLED)
|
||||
{
|
||||
if (thd->killed < KILL_CONNECTION)
|
||||
thd->killed= NOT_KILLED;
|
||||
|
@ -578,7 +578,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
|||
|
||||
/* Get default temporary directory */
|
||||
opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
if (!opt_mysql_tmpdir)
|
||||
opt_mysql_tmpdir=getenv("TEMP");
|
||||
if (!opt_mysql_tmpdir)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -46,7 +46,7 @@
|
|||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#endif /* !defined(__WIN__) */
|
||||
#endif /* !defined(_WIN32) */
|
||||
#if defined(HAVE_POLL_H)
|
||||
#include <poll.h>
|
||||
#elif defined(HAVE_SYS_POLL_H)
|
||||
|
@ -55,7 +55,7 @@
|
|||
#ifdef HAVE_SYS_UN_H
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#include <my_pthread.h> /* because of signal() */
|
||||
#endif
|
||||
#ifndef INADDR_NONE
|
||||
|
@ -78,13 +78,13 @@ ulong max_allowed_packet= 1024L*1024L*1024L;
|
|||
my_bool net_flush(NET *net);
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
/* socket_errno is defined in my_global.h for all platforms */
|
||||
#define perror(A)
|
||||
#else
|
||||
#include <errno.h>
|
||||
#define SOCKET_ERROR -1
|
||||
#endif /* __WIN__ */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
If allowed through some configuration, then this needs to
|
||||
|
@ -167,7 +167,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
|
|||
if (!mysql_unix_port)
|
||||
{
|
||||
char *env;
|
||||
#ifdef __WIN__
|
||||
#ifdef _WIN32
|
||||
mysql_unix_port = (char*) MYSQL_NAMEDPIPE;
|
||||
#else
|
||||
mysql_unix_port = (char*) MYSQL_UNIX_ADDR;
|
||||
|
@ -176,7 +176,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
|
|||
mysql_unix_port = env;
|
||||
}
|
||||
mysql_debug(NullS);
|
||||
#if defined(SIGPIPE) && !defined(__WIN__)
|
||||
#if defined(SIGPIPE) && !defined(_WIN32)
|
||||
(void) signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
|
@ -421,7 +421,7 @@ struct passwd *getpwuid(uid_t);
|
|||
char* getlogin(void);
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
|
||||
void read_user_name(char *name)
|
||||
{
|
||||
|
@ -2132,7 +2132,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
|
|||
buff[4]= (char) stmt->flags;
|
||||
int4store(buff+5, 1); /* iteration count */
|
||||
|
||||
res= MY_TEST(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
|
||||
res= MY_TEST((*mysql->methods->advanced_command)(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
|
||||
(uchar*) packet, length, 1, stmt) ||
|
||||
(*mysql->methods->read_query_result)(mysql));
|
||||
stmt->affected_rows= mysql->affected_rows;
|
||||
|
@ -2524,9 +2524,16 @@ static void reinit_result_set_metadata(MYSQL_STMT *stmt)
|
|||
}
|
||||
|
||||
|
||||
static int has_cursor(MYSQL_STMT *stmt)
|
||||
{
|
||||
return stmt->server_status & SERVER_STATUS_CURSOR_EXISTS &&
|
||||
stmt->flags & CURSOR_TYPE_READ_ONLY;
|
||||
}
|
||||
|
||||
|
||||
static void prepare_to_fetch_result(MYSQL_STMT *stmt)
|
||||
{
|
||||
if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
|
||||
if (has_cursor(stmt))
|
||||
{
|
||||
stmt->mysql->status= MYSQL_STATUS_READY;
|
||||
stmt->read_row_func= stmt_read_row_from_cursor;
|
||||
|
@ -4470,8 +4477,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
if (mysql->status == MYSQL_STATUS_READY &&
|
||||
stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
|
||||
if (mysql->status == MYSQL_STATUS_READY && has_cursor(stmt))
|
||||
{
|
||||
/*
|
||||
Server side cursor exist, tell server to start sending the rows
|
||||
|
@ -4483,7 +4489,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
|||
/* Send row request to the server */
|
||||
int4store(buff, stmt->stmt_id);
|
||||
int4store(buff + 4, (int)~0); /* number of rows to fetch */
|
||||
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
|
||||
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH, buff, sizeof(buff),
|
||||
(uchar*) 0, 0, 1, stmt))
|
||||
{
|
||||
/*
|
||||
|
@ -4930,6 +4936,12 @@ int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt)
|
|||
alloc_stmt_fields(stmt);
|
||||
prepare_to_fetch_result(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->affected_rows= stmt->mysql->affected_rows;
|
||||
stmt->server_status= stmt->mysql->server_status;
|
||||
stmt->insert_id= stmt->mysql->insert_id;
|
||||
}
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -54,7 +54,7 @@
|
|||
extern ulong net_buffer_length;
|
||||
extern ulong max_allowed_packet;
|
||||
|
||||
#if defined(__WIN__)
|
||||
#if defined(_WIN32)
|
||||
#define ERRNO WSAGetLastError()
|
||||
#define perror(A)
|
||||
#else
|
||||
|
@ -69,13 +69,6 @@ struct passwd *getpwuid(uid_t);
|
|||
char* getlogin(void);
|
||||
#endif
|
||||
|
||||
#ifdef __WIN__
|
||||
static my_bool is_NT(void)
|
||||
{
|
||||
char *os=getenv("OS");
|
||||
return (os && !strcmp(os, "Windows_NT")) ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int mysql_init_character_set(MYSQL *mysql);
|
||||
|
||||
|
|
|
@ -19,24 +19,63 @@ INSTALL_MYSQL_TEST("." ".")
|
|||
IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
# Enable running mtr from build directory
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb-test-run.pl
|
||||
@ONLY
|
||||
)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb-stress-test.pl
|
||||
@ONLY
|
||||
)
|
||||
IF(WIN32)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
|
||||
@ONLY)
|
||||
ENDIF()
|
||||
SET(out_of_source_build TRUE)
|
||||
ELSEIF(WIN32)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-test-run.pl
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
|
||||
COPYONLY)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mysql-stress-test.pl
|
||||
COPYONLY)
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND chmod +x mysql-test-run.pl
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
./mysql-test-run.pl mtr
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
./mysql-test-run.pl mysql-test-run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
IF(INSTALL_MYSQLTESTDIR AND out_of_source_build)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
|
||||
COMMAND chmod +x mariadb-test-run.pl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
FOREACH (lnk mysql-test-run mtr mysql-test-run.pl mariadb-test-run)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
./mariadb-test-run.pl ${lnk}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
IF(INSTALL_MYSQLTESTDIR)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lnk}
|
||||
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||
COMPONENT Test)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND chmod +x mariadb-stress-test.pl
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
./mariadb-stress-test.pl mysql-stress-test.pl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ELSE()
|
||||
IF(INSTALL_MYSQLTESTDIR)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-test-run.pl
|
||||
RENAME mysql-test-run.pl
|
||||
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||
COMPONENT Test)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
|
||||
RENAME mysql-stress-test.pl
|
||||
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||
COMPONENT Test)
|
||||
ENDIF()
|
||||
|
@ -156,4 +195,3 @@ IF (MAX_INDEXES)
|
|||
MESSAGE(STATUS "mysql-test/include/max_indexes.inc adjusted")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
|
|
@ -2,10 +2,8 @@ This directory contains test suites for the MariaDB server. To run
|
|||
currently existing test cases, execute ./mysql-test-run in this directory.
|
||||
|
||||
Some tests are known to fail on some platforms or be otherwise unreliable.
|
||||
The file "unstable-tests" contains the list of such tests along with
|
||||
a comment for every test.
|
||||
To exclude them from the test run, execute
|
||||
# ./mysql-test-run --skip-test-list=unstable-tests
|
||||
In the file collections/smoke_test there is a list of tests that are
|
||||
expected to be stable.
|
||||
|
||||
In general you do not have to have to do "make install", and you can have
|
||||
a co-existing MariaDB installation, the tests will not conflict with it.
|
||||
|
@ -15,7 +13,7 @@ In Red Hat distributions, you should run the script as user "mysql".
|
|||
The user is created with nologin shell, so the best bet is something like
|
||||
# su -
|
||||
# cd /usr/share/mysql-test
|
||||
# su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=unstable-tests"
|
||||
# su -s /bin/bash mysql -c ./mysql-test-run
|
||||
|
||||
This will use the installed MariaDB executables, but will run a private
|
||||
copy of the server process (using data files within /usr/share/mysql-test),
|
||||
|
@ -27,8 +25,7 @@ the listed failures occur for you.
|
|||
To clean up afterwards, remove the created "var" subdirectory, e.g.
|
||||
# su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
|
||||
|
||||
If one or more tests fail on your system on reasons other than listed
|
||||
in lists of unstable tests, please read the following manual section
|
||||
If tests fail on your system, please read the following manual section
|
||||
for instructions on how to report the problem:
|
||||
|
||||
https://mariadb.com/kb/en/reporting-bugs
|
||||
|
|
|
@ -161,8 +161,13 @@ sub gcov_one_file {
|
|||
system($cmd)==0 or die "system($cmd): $? $!";
|
||||
}
|
||||
|
||||
# now, read the generated file
|
||||
open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
|
||||
(my $filename = $_)=~ s/\.[^.]+$//; # remove extension
|
||||
my $gcov_file_path= $File::Find::dir."/$filename.gcov";
|
||||
if (! -f $gcov_file_path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
|
||||
my $fname;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
|
|
|
@ -97,10 +97,7 @@ call mtr.check_testcase();
|
|||
|
||||
let $datadir=`select @@datadir`;
|
||||
list_files $datadir mysql_upgrade_info;
|
||||
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
|
||||
--replace_regex /#sql-ib[1-9][0-9]*\.ibd\n//
|
||||
cat_file $datadir.tempfiles.txt;
|
||||
remove_file $datadir.tempfiles.txt;
|
||||
list_files $datadir/test #sql*;
|
||||
list_files $datadir/mysql #sql*;
|
||||
|
||||
#
|
||||
|
|
|
@ -28,6 +28,8 @@ DROP TABLE t1;
|
|||
--echo # The following statements return deprecated syntax warnings
|
||||
--echo #
|
||||
|
||||
--enable_prepare_warnings
|
||||
|
||||
--eval CREATE TABLE t1 (a $type DEFAULT '' COMPRESSED)
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -35,6 +37,7 @@ DROP TABLE t1;
|
|||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_prepare_warnings
|
||||
|
||||
--echo #
|
||||
--echo # The following statements fail by the grammar,
|
||||
|
|
|
@ -53,6 +53,8 @@ DROP TABLE t1;
|
|||
--echo # The following statements return deprecated syntax warnings
|
||||
--echo #
|
||||
|
||||
--enable_prepare_warnings
|
||||
|
||||
--eval CREATE TABLE t1 (a $type BINARY COMPRESSED)
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -63,6 +65,7 @@ DROP TABLE t1;
|
|||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_prepare_warnings
|
||||
|
||||
--echo #
|
||||
--echo # The following statements fail by the grammar,
|
||||
|
|
|
@ -1043,7 +1043,7 @@ update t1 set a= a + 0.1;
|
|||
select a, hex(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
--enable_prepare_warnings
|
||||
#
|
||||
# Columns
|
||||
#
|
||||
|
@ -1203,7 +1203,6 @@ create table t2 as select concat(a) from t1;
|
|||
show create table t2;
|
||||
drop table t1, t2;
|
||||
|
||||
|
||||
#
|
||||
# create view with string functions with numeric input
|
||||
#
|
||||
|
@ -1517,6 +1516,7 @@ select hex(a) from v1;
|
|||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
--disable_prepare_warnings
|
||||
#
|
||||
# User defined function returning numeric result
|
||||
#
|
||||
|
|
|
@ -28,9 +28,11 @@
|
|||
--echo #
|
||||
|
||||
if ($select) {
|
||||
--enable_prepare_warnings
|
||||
--disable_query_log
|
||||
--eval $select INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/before_explain.txt'
|
||||
--enable_query_log
|
||||
--disable_prepare_warnings
|
||||
}
|
||||
|
||||
if ($innodb) {
|
||||
|
@ -122,7 +124,9 @@ if ($validation) {
|
|||
--disable_query_log
|
||||
|
||||
if ($select) {
|
||||
--enable_prepare_warnings
|
||||
--eval $select INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/after_explain.txt'
|
||||
--disable_prepare_warnings
|
||||
--diff_files '$MYSQLTEST_VARDIR/tmp/before_explain.txt' '$MYSQLTEST_VARDIR/tmp/after_explain.txt'
|
||||
--remove_file '$MYSQLTEST_VARDIR/tmp/before_explain.txt'
|
||||
--remove_file '$MYSQLTEST_VARDIR/tmp/after_explain.txt'
|
||||
|
|
4
mysql-test/include/not_aix.inc
Normal file
4
mysql-test/include/not_aix.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
#
|
||||
# suite.pm will make sure that all tests including this file
|
||||
# will be skipped if run under AIX
|
||||
#
|
|
@ -1,4 +1,6 @@
|
|||
[win]
|
||||
|
||||
[aix]
|
||||
|
||||
[unix]
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ my %debuggers = (
|
|||
script => 'set args {args} < {input}',
|
||||
},
|
||||
ddd => {
|
||||
interactive => 1,
|
||||
options => '--command {script} {exe}',
|
||||
script => 'set args {args} < {input}',
|
||||
},
|
||||
|
@ -53,9 +54,11 @@ my %debuggers = (
|
|||
options => '-c "stop in main; run {exe} {args} < {input}"',
|
||||
},
|
||||
devenv => {
|
||||
interactive => 1,
|
||||
options => '/debugexe {exe} {args}',
|
||||
},
|
||||
windbg => {
|
||||
interactive => 1,
|
||||
options => '{exe} {args}',
|
||||
},
|
||||
lldb => {
|
||||
|
@ -74,7 +77,7 @@ my %debuggers = (
|
|||
options => '-f -o {log} {exe} {args}',
|
||||
},
|
||||
rr => {
|
||||
options => '_RR_TRACE_DIR={log} rr record {exe} {args} --loose-skip-innodb-use-native-aio',
|
||||
options => '_RR_TRACE_DIR={log} rr record {exe} {args} --loose-skip-innodb-use-native-aio --loose-innodb-flush-method=fsync',
|
||||
run => 'env',
|
||||
pre => sub {
|
||||
::mtr_error('rr requires kernel.perf_event_paranoid <= 1')
|
||||
|
@ -190,11 +193,15 @@ sub fix_options(@) {
|
|||
|
||||
sub pre_setup() {
|
||||
my $used;
|
||||
my $interactive;
|
||||
for my $k (keys %debuggers) {
|
||||
for my $opt ($k, "manual-$k", "boot-$k", "client-$k") {
|
||||
if ($opt_vals{$opt})
|
||||
{
|
||||
$used = 1;
|
||||
$interactive ||= ($debuggers{$k}->{interactive} ||
|
||||
$debuggers{$k}->{term} ||
|
||||
($opt =~ /^manual-/));
|
||||
if ($debuggers{$k}->{pre}) {
|
||||
$debuggers{$k}->{pre}->();
|
||||
delete $debuggers{$k}->{pre};
|
||||
|
@ -209,10 +216,10 @@ sub pre_setup() {
|
|||
|
||||
$::opt_retry= 1;
|
||||
$::opt_retry_failure= 1;
|
||||
$::opt_testcase_timeout= 7 * 24 * 60; # in minutes
|
||||
$::opt_suite_timeout= 7 * 24 * 60; # in minutes
|
||||
$::opt_shutdown_timeout= 24 * 60 *60; # in seconds
|
||||
$::opt_start_timeout= 24 * 60 * 60; # in seconds
|
||||
$::opt_testcase_timeout= ($interactive ? 24 : 4) * 60; # in minutes
|
||||
$::opt_suite_timeout= 24 * 60; # in minutes
|
||||
$::opt_shutdown_timeout= ($interactive ? 24 * 60 : 3) * 60; # in seconds
|
||||
$::opt_start_timeout= $::opt_shutdown_timeout; # in seconds
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ use File::Basename;
|
|||
use File::Path;
|
||||
|
||||
use base qw(Exporter);
|
||||
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
|
||||
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL IS_AIX
|
||||
native_path posix_path mixed_path
|
||||
check_socket_path_length process_alive open_for_append);
|
||||
|
||||
|
@ -54,6 +54,15 @@ BEGIN {
|
|||
}
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
if ($^O eq "aix") {
|
||||
eval 'sub IS_AIX { 1 }';
|
||||
}
|
||||
else {
|
||||
eval 'sub IS_AIX { 0 }';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# native_path
|
||||
|
|
|
@ -109,6 +109,7 @@ sub sleep_until_file_created ($$$$) {
|
|||
my $warn_seconds = shift;
|
||||
my $sleeptime= 10; # Milliseconds
|
||||
my $loops= ($timeout * 10000) / $sleeptime;
|
||||
my $message_time= 60;
|
||||
|
||||
for ( my $loop= 0; $loop <= $loops; $loop++ )
|
||||
{
|
||||
|
@ -130,9 +131,10 @@ sub sleep_until_file_created ($$$$) {
|
|||
mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile");
|
||||
|
||||
# Print extra message every $warn_seconds seconds
|
||||
if ( $seconds > 1 && ($seconds*10) % ($warn_seconds*10) == 0 && $seconds < $timeout )
|
||||
if ( $seconds >= $message_time)
|
||||
{
|
||||
my $left= $timeout - $seconds;
|
||||
$message_time= $message_time+60;
|
||||
my $left= $timeout - int($seconds);
|
||||
mtr_warning("Waited $seconds seconds for $pidfile to be created, " .
|
||||
"still waiting for $left seconds...");
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ sub run_stress_test ()
|
|||
}
|
||||
|
||||
mtr_init_args(\$args);
|
||||
mtr_add_args($args, "$::glob_mysql_test_dir/mysql-stress-test.pl");
|
||||
mtr_add_args($args, "$::glob_mysql_test_dir/mariadb-stress-test.pl");
|
||||
mtr_add_arg($args, "--server-socket=%s", $::master->[0]->{'path_sock'});
|
||||
mtr_add_arg($args, "--server-user=%s", $::opt_user);
|
||||
mtr_add_arg($args, "--server-database=%s", "test");
|
||||
|
|
|
@ -182,7 +182,7 @@ sub run_stress_test ()
|
|||
}
|
||||
|
||||
#Run stress test
|
||||
mtr_run("$::glob_mysql_test_dir/mysql-stress-test.pl", $args, "", "", "", "");
|
||||
mtr_run("$::glob_mysql_test_dir/mariadb-stress-test.pl", $args, "", "", "", "");
|
||||
if ( ! $::glob_use_embedded_server )
|
||||
{
|
||||
stop_all_servers();
|
||||
|
|
|
@ -21,6 +21,7 @@ create table t10 (c1 int);
|
|||
--enable_warnings
|
||||
|
||||
# Query PS to know initial read count for frm file.
|
||||
--enable_prepare_warnings
|
||||
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
|
||||
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
|
||||
into @count_read_before;
|
||||
|
@ -45,6 +46,7 @@ into @count_read_after;
|
|||
|
||||
select @count_read_after-@count_read_before;
|
||||
|
||||
--disable_prepare_warnings
|
||||
--disable_warnings
|
||||
drop table t1;
|
||||
drop database show_table_lw_db;
|
||||
|
|
|
@ -29,6 +29,7 @@ let $typec= BLOB COMPRESSED;
|
|||
let $typeu= BLOB;
|
||||
--source column_compression.inc
|
||||
|
||||
--enable_prepare_warnings
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t1(a CHAR(100) COMPRESSED);
|
||||
--error ER_WRONG_FIELD_SPEC
|
||||
|
@ -291,6 +292,7 @@ CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED, FULLTEXT INDEX(a));
|
|||
--error ER_COMPRESSED_COLUMN_USED_AS_KEY
|
||||
CREATE TABLE t1 (a TEXT COMPRESSED, FULLTEXT INDEX(a));
|
||||
|
||||
--disable_prepare_warnings
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
|
|
@ -101,7 +101,7 @@ t1
|
|||
t2
|
||||
t3
|
||||
t4
|
||||
set @a=0;
|
||||
set @a=0|
|
||||
repeat
|
||||
set @a = @a + 1;
|
||||
until @a > 5
|
||||
|
@ -154,7 +154,7 @@ master-bin.000001 # Query # # use `test`; insert t1 values( NAME_CONST('a',4)+3)
|
|||
master-bin.000001 # Query # # COMMIT
|
||||
drop function fn|
|
||||
drop table t1|
|
||||
set @@sql_mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
|
||||
set @@sql_mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"|
|
||||
begin not atomic select @@sql_mode; end|
|
||||
@@sql_mode
|
||||
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue