1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge branch '10.6' into 10.11

This commit is contained in:
Sergei Golubchik
2024-04-22 11:00:03 +02:00
418 changed files with 7074 additions and 2930 deletions

View File

@ -70,7 +70,6 @@ IndentPPDirectives: None
IndentWidth: 2 IndentWidth: 2
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1

View File

@ -199,8 +199,9 @@ OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system librar
# Can be switched on only for debug build. # Can be switched on only for debug build.
# #
OPTION(WITH_PROTECT_STATEMENT_MEMROOT "Enable protection of statement's memory root after first SP/PS execution. Turned into account only for debug build" OFF) OPTION(WITH_PROTECT_STATEMENT_MEMROOT "Enable protection of statement's memory root after first SP/PS execution. Turned into account only for debug build" OFF)
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND WITH_PROTECT_STATEMENT_MEMROOT) IF (WITH_PROTECT_STATEMENT_MEMROOT)
ADD_DEFINITIONS(-DPROTECT_STATEMENT_MEMROOT) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPROTECT_STATEMENT_MEMROOT")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPROTECT_STATEMENT_MEMROOT")
ENDIF() ENDIF()
INCLUDE(check_compiler_flag) INCLUDE(check_compiler_flag)

View File

@ -3,7 +3,7 @@ Code status:
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com * [![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 ## MariaDB: The innovative open source database
MariaDB was designed as a drop-in replacement of MySQL(R) with more MariaDB was designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance. features, new storage engines, fewer bugs, and better performance.
@ -33,28 +33,23 @@ https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/
https://mariadb.com/kb/en/new-and-old-releases/ https://mariadb.com/kb/en/new-and-old-releases/
Getting the code, building it and testing it
---------------------------------------------------------------
Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/ which outlines how to correctly build the source code and run the MariaDB testing framework.
Help Help
----- -----
More help is available from the Maria Discuss mailing list More help is available from the Maria Discuss mailing list
https://launchpad.net/~maria-discuss, MariaDB's Zulip https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/ and MariaDB's Zulip
instance, https://mariadb.zulipchat.com/ instance, https://mariadb.zulipchat.com/
Live QA for beginner contributors
----
MariaDB has a dedicated time each week when we answer new contributor questions live on Zulip.
From 8:00 to 10:00 UTC on Mondays, and 10:00 to 12:00 UTC on Thursdays,
anyone can ask any questions theyd like, and a live developer will be available to assist.
New contributors can ask questions any time, but we will provide immediate feedback during that interval.
Licensing Licensing
--------- ---------
*************************************************************************** ***************************************************************************
NOTE:
MariaDB is specifically available only under version 2 of the GNU MariaDB is specifically available only under version 2 of the GNU
General Public License (GPLv2). (I.e. Without the "any later version" General Public License (GPLv2). (I.e. Without the "any later version"
clause.) This is inherited from MySQL. Please see the README file in clause.) This is inherited from MySQL. Please see the README file in

View File

@ -1405,7 +1405,9 @@ static void usage(void)
refresh Flush all tables and close and open logfiles\n\ refresh Flush all tables and close and open logfiles\n\
shutdown Take server down\n\ shutdown Take server down\n\
status Gives a short status message from the server\n\ status Gives a short status message from the server\n\
start-all-slaves Start all slaves\n\
start-slave Start slave\n\ start-slave Start slave\n\
stop-all-slaves Stop all slaves\n\
stop-slave Stop slave\n\ stop-slave Stop slave\n\
variables Prints variables available\n\ variables Prints variables available\n\
version Get version info from server"); version Get version info from server");

View File

@ -397,7 +397,7 @@ enum enum_commands {
Q_IF, Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_WRITE_FILE, Q_WRITE_LINE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE, Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
@ -500,6 +500,7 @@ const char *command_names[]=
"remove_file", "remove_file",
"file_exists", "file_exists",
"write_file", "write_file",
"write_line",
"copy_file", "copy_file",
"perl", "perl",
"die", "die",
@ -1534,7 +1535,6 @@ void free_used_memory()
void ha_pre_shutdown(); void ha_pre_shutdown();
#endif #endif
ATTRIBUTE_NORETURN static void cleanup_and_exit(int exit_code, ATTRIBUTE_NORETURN static void cleanup_and_exit(int exit_code,
bool called_from_die) bool called_from_die)
{ {
@ -4369,6 +4369,49 @@ void do_write_file(struct st_command *command)
do_write_file_command(command, FALSE); do_write_file_command(command, FALSE);
} }
/**
Write a line to the start of the file.
Truncates existing file, creates new one if it doesn't exist.
Usage
write_line <line> <filename>;
Example
--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
@note Both the file and the line parameters are evaluated
(can be variables).
@note This is a better alternative to
exec echo > file, as it doesn't depend on shell,
and can better handle sporadic file access errors caused
by antivirus or backup software on Windows.
*/
void do_write_line(struct st_command *command)
{
DYNAMIC_STRING ds_line;
DYNAMIC_STRING ds_filename;
struct command_arg write_line_args[] = {
{ "line", ARG_STRING, FALSE, &ds_line, "line to add" },
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
};
DBUG_ENTER("do_write_line");
check_command_args(command,
command->first_argument,
write_line_args,
sizeof(write_line_args)/sizeof(struct command_arg),
' ');
if (bad_path(ds_filename.str))
DBUG_VOID_RETURN;
dynstr_append_mem(&ds_line, "\n", 1);
str_to_file2(ds_filename.str, ds_line.str, ds_line.length, FALSE);
dynstr_free(&ds_filename);
dynstr_free(&ds_line);
DBUG_VOID_RETURN;
}
/* /*
SYNOPSIS SYNOPSIS
@ -5286,7 +5329,11 @@ void do_shutdown_server(struct st_command *command)
*/ */
if (timeout && mysql_shutdown(mysql, SHUTDOWN_DEFAULT)) if (timeout && mysql_shutdown(mysql, SHUTDOWN_DEFAULT))
die("mysql_shutdown failed"); {
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), &ds_res);
DBUG_VOID_RETURN;
}
if (!timeout || wait_until_dead(pid, timeout)) if (!timeout || wait_until_dead(pid, timeout))
{ {
@ -7495,7 +7542,7 @@ void str_to_file2(const char *fname, char *str, size_t size, my_bool append)
die("Could not open '%s' for writing, errno: %d", buff, errno); die("Could not open '%s' for writing, errno: %d", buff, errno);
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR) if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
die("Could not find end of file '%s', errno: %d", buff, errno); die("Could not find end of file '%s', errno: %d", buff, errno);
if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP))) if (size > 0 && my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
die("write failed, errno: %d", errno); die("write failed, errno: %d", errno);
my_close(fd, MYF(0)); my_close(fd, MYF(0));
} }
@ -8290,7 +8337,7 @@ static int match_expected_error(struct st_command *command,
SYNOPSIS SYNOPSIS
handle_error() handle_error()
q - query context command - command
err_errno - error number err_errno - error number
err_error - error message err_error - error message
err_sqlstate - sql state err_sqlstate - sql state
@ -10291,6 +10338,7 @@ int main(int argc, char **argv)
break; break;
case Q_FILE_EXIST: do_file_exist(command); break; case Q_FILE_EXIST: do_file_exist(command); break;
case Q_WRITE_FILE: do_write_file(command); break; case Q_WRITE_FILE: do_write_file(command); break;
case Q_WRITE_LINE: do_write_line(command); break;
case Q_APPEND_FILE: do_append_file(command); break; case Q_APPEND_FILE: do_append_file(command); break;
case Q_DIFF_FILES: do_diff_files(command); break; case Q_DIFF_FILES: do_diff_files(command); break;
case Q_SEND_QUIT: do_send_quit(command); break; case Q_SEND_QUIT: do_send_quit(command); break;

View File

@ -379,5 +379,11 @@ FUNCTION (MAYBE_DISABLE_IPO target)
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF
INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF) INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF)
IF(CMAKE_CONFIGURATION_TYPES)
FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES})
STRING(TOUPPER "${cfg}" cfg_upper)
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_${cfg_upper} OFF)
ENDFOREACH()
ENDIF()
ENDIF() ENDIF()
ENDFUNCTION() ENDFUNCTION()

View File

@ -40,6 +40,13 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC)
MESSAGE("== Configuring MariaDB Connector/C") MESSAGE("== Configuring MariaDB Connector/C")
ADD_SUBDIRECTORY(libmariadb) ADD_SUBDIRECTORY(libmariadb)
IF(MSVC AND TARGET mariadb_obj AND TARGET mariadbclient)
# With MSVC, do not produce LTCG-compiled static client libraries.
# They are not usable by end-users, being tied to exact compiler version
MAYBE_DISABLE_IPO(mariadb_obj)
MAYBE_DISABLE_IPO(mariadbclient)
ENDIF()
IF(UNIX) IF(UNIX)
INSTALL(CODE "EXECUTE_PROCESS( INSTALL(CODE "EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}) COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR})

View File

@ -984,3 +984,8 @@ IF(have_C__Werror)
) )
SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
ENDIF() ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
MY_CHECK_AND_SET_COMPILER_FLAG("-no-ansi-alias")
MY_CHECK_AND_SET_COMPILER_FLAG("-fp-model precise")
ENDIF()

View File

@ -655,6 +655,7 @@ extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
myf MyFlags); myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags);
extern void (*my_sleep_for_space)(unsigned int seconds);
/* implemented in my_memmem.c */ /* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen, extern void *my_memmem(const void *haystack, size_t haystacklen,

View File

@ -1,5 +1,5 @@
if "%MTR_PARALLEL%"=="" set MTR_PARALLEL=%NUMBER_OF_PROCESSORS% if "%MTR_PARALLEL%"=="" set MTR_PARALLEL=%NUMBER_OF_PROCESSORS%
perl mysql-test-run.pl --verbose-restart --force --suite-timeout=120 --max-test-fail=10 --retry=3 --suite=^ perl mysql-test-run.pl --force --suite-timeout=120 --max-test-fail=10 --retry=3 --suite=^
vcol,gcol,perfschema,^ vcol,gcol,perfschema,^
main,^ main,^
innodb,^ innodb,^

View File

@ -613,13 +613,17 @@ call p_verify_status_increment(2, 0, 2, 0);
drop table t2; drop table t2;
set sql_mode=no_engine_substitution; set sql_mode=no_engine_substitution;
create temporary table t2 (a int); create temporary table t2 (a int);
call p_verify_status_increment(1, 0, 0, 0); # One commit for the create temporary table, and two for committing the
# read of the stored procedure from Aria table (creating temporary table
# clears the sp cache).
call p_verify_status_increment(3, 0, 2, 0);
set sql_mode=default; set sql_mode=default;
--echo # 19. A function changes temp-trans-table. --echo # 19. A function changes temp-trans-table.
--echo # --echo #
select f1(); select f1();
--echo # Two commits because a binary log record is written --echo # Two commits because a binary log record is written, and another two
call p_verify_status_increment(2, 0, 1, 0); --echo # as the function f1() is reloaded after creating temporary table.
call p_verify_status_increment(4, 0, 3, 0);
commit; commit;
call p_verify_status_increment(2, 0, 1, 0); call p_verify_status_increment(2, 0, 1, 0);
@ -672,9 +676,11 @@ call p_verify_status_increment(2, 0, 1, 0);
--echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction --echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
--echo # --echo #
drop temporary table t2; drop temporary table t2;
call p_verify_status_increment(1, 0, 1, 0); # Dropping temporary table clears SP caches, so get another two commit
# increments from loading the p_verify_status_increment procedure.
call p_verify_status_increment(3, 0, 2, 0);
commit; commit;
call p_verify_status_increment(1, 0, 1, 0); call p_verify_status_increment(1, 0, 0, 0);
--echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit --echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit
--echo # --echo #
@ -721,7 +727,9 @@ call p_verify_status_increment(1, 0, 1, 0);
create table t2 (a int); create table t2 (a int);
call p_verify_status_increment(0, 0, 0, 0); call p_verify_status_increment(0, 0, 0, 0);
do (select f1() from t1 where a=2); do (select f1() from t1 where a=2);
call p_verify_status_increment(2, 2, 2, 2); # Again extra 2 commit increments from re-loading function f1 after
# dropping temporary table.
call p_verify_status_increment(4, 2, 4, 2);
commit; commit;
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(2, 2, 2, 2);

View File

@ -4,7 +4,7 @@
--source include/not_embedded.inc --source include/not_embedded.inc
# Write file to make mysql-test-run.pl expect crash and restart # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Setup the mysqld to crash at shutdown # Setup the mysqld to crash at shutdown
SET debug_dbug="d,crash_shutdown"; SET debug_dbug="d,crash_shutdown";

View File

@ -91,7 +91,7 @@ loose-performance-schema-events-statements-history-size=10
loose-performance-schema-events-statements-history-long-size=1000 loose-performance-schema-events-statements-history-long-size=1000
loose-performance-schema-events-transactions-history-size=10 loose-performance-schema-events-transactions-history-size=10
loose-performance-schema-events-transactions-history-long-size=1000 loose-performance-schema-events-transactions-history-long-size=1000
loose-performance-schema-max-thread-instances=200 loose-performance-schema-max-thread-instances=400
loose-performance-schema-session-connect-attrs-size=2048 loose-performance-schema-session-connect-attrs-size=2048
loose-performance-schema-max-metadata-locks=10000 loose-performance-schema-max-metadata-locks=10000

View File

@ -2,4 +2,4 @@
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
# There should be a debug crash after using this .inc file # There should be a debug crash after using this .inc file
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name

View File

@ -7,7 +7,7 @@ if (!$restart_parameters)
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--echo # Kill and $restart_parameters --echo # Kill and $restart_parameters
--exec echo "$restart_parameters" > $_expect_file_name --write_line "$restart_parameters" $_expect_file_name
--shutdown_server 0 --shutdown_server 0
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--enable_reconnect --enable_reconnect

View File

@ -3,7 +3,7 @@
# Write file to make mysql-test-run.pl expect the crash, but don't start it # Write file to make mysql-test-run.pl expect the crash, but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Kill the connected server # Kill the connected server
--disable_reconnect --disable_reconnect

View File

@ -2,6 +2,6 @@
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--echo # Kill the server --echo # Kill the server
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
--shutdown_server 0 --shutdown_server 0
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc

View File

@ -96,10 +96,11 @@
# Remove whitespace from $rpl_topology # Remove whitespace from $rpl_topology
--let $rpl_topology= `SELECT REPLACE('$rpl_topology', ' ', '')` --let $rpl_topology= `SELECT REPLACE('$rpl_topology', ' ', '')`
--source include/slow_environ.inc
--let $include_filename= rpl_change_topology.inc [new topology=$rpl_topology] --let $include_filename= rpl_change_topology.inc [new topology=$rpl_topology]
--source include/begin_include_file.inc --source include/begin_include_file.inc
if ($rpl_debug) if ($rpl_debug)
{ {
--echo ---- Check input ---- --echo ---- Check input ----
@ -235,11 +236,11 @@ if (!$rpl_skip_change_master)
} }
if ($rpl_master_log_file) if ($rpl_master_log_file)
{ {
eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1, MASTER_USE_GTID=NO; eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1$_timeout_adjustment, MASTER_USE_GTID=NO;
} }
if (!$rpl_master_log_file) if (!$rpl_master_log_file)
{ {
eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_CONNECT_RETRY=1; eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_CONNECT_RETRY=1$_timeout_adjustment;
} }
} }
if ($_rpl_master == '') if ($_rpl_master == '')

View File

@ -49,7 +49,7 @@ if ($rpl_server_parameters)
--source include/rpl_connection.inc --source include/rpl_connection.inc
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line "$_rpl_start_server_command" $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
if (!$rpl_server_error) if (!$rpl_server_error)
{ {

View File

@ -44,7 +44,7 @@ if ($rpl_debug)
# Write file to make mysql-test-run.pl expect the "crash", but don't start # Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to # it until it's told to
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
# Send shutdown to the connected server and give # Send shutdown to the connected server and give
# it 60 seconds (of mysqltest's default) to die before zapping it # it 60 seconds (of mysqltest's default) to die before zapping it

View File

@ -36,7 +36,7 @@
# let SEARCH_FILE= $error_log; # let SEARCH_FILE= $error_log;
# # Stop the server # # Stop the server
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; # let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# --exec echo "wait" > $restart_file # --write_line wait $restart_file
# --shutdown_server # --shutdown_server
# --source include/wait_until_disconnected.inc # --source include/wait_until_disconnected.inc
# #

View File

@ -24,18 +24,15 @@ if ($rpl_inited)
# Write file to make mysql-test-run.pl expect the "crash", but don't start it # Write file to make mysql-test-run.pl expect the "crash", but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Avoid warnings from connection threads that does not have time to exit # Avoid warnings from connection threads that does not have time to exit
--disable_query_log --disable_query_log
set @@global.log_warnings=0; set @@global.log_warnings=0;
--enable_query_log --enable_query_log
--let $server_shutdown_timeout= 60 --source include/slow_environ.inc
if ($VALGRIND_TEST) --let $server_shutdown_timeout= 60$_timeout_adjustment
{
--let $server_shutdown_timeout= 300
}
if ($shutdown_timeout) if ($shutdown_timeout)
{ {

View File

@ -0,0 +1,9 @@
if (!$slow_environ_check)
{
let $_timeout_adjustment=;
if (`select $VALGRIND_TEST + count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like '%SAN%'`)
{
let $_timeout_adjustment=0;
}
let $slow_environ_check=1;
}

View File

@ -21,7 +21,7 @@ if ($restart_bindir)
if ($restart_parameters) if ($restart_parameters)
{ {
--exec echo "$restart_cmd: $restart_parameters" > $_expect_file_name --write_line "$restart_cmd: $restart_parameters" $_expect_file_name
if (!$restart_noprint) if (!$restart_noprint)
{ {
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@ -34,7 +34,7 @@ if ($restart_parameters)
} }
if (!$restart_parameters) if (!$restart_parameters)
{ {
--exec echo "$restart_cmd" > $_expect_file_name --write_line "$restart_cmd" $_expect_file_name
if ($restart_noprint < 2) if ($restart_noprint < 2)
{ {
--exec echo "# $restart_cmd" --exec echo "# $restart_cmd"

View File

@ -34,8 +34,17 @@ if (!$rpl_debug)
--disable_query_log --disable_query_log
} }
let $_enable_warnings=0;
if ($rpl_allow_error) {
if ($ENABLED_WARNINGS) {
let $_enable_warnings=1;
disable_warnings;
}
}
STOP SLAVE IO_THREAD; STOP SLAVE IO_THREAD;
if ($_enable_warnings) {
enable_warnings;
}
--source include/wait_for_slave_io_to_stop.inc --source include/wait_for_slave_io_to_stop.inc

View File

@ -25,11 +25,8 @@
let $_slave_timeout= $slave_timeout; let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout) if (!$_slave_timeout)
{ {
let $_slave_timeout= 300; source include/slow_environ.inc;
if ($VALGRIND_TEST) let $_slave_timeout= 300$_timeout_adjustment;
{
let $_slave_timeout= 1500;
}
} }
--let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1) --let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)

View File

@ -33,11 +33,8 @@
let $_slave_timeout= $slave_timeout; let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout) if (!$_slave_timeout)
{ {
let $_slave_timeout= 120; source include/slow_environ.inc;
if ($VALGRIND_TEST) let $_slave_timeout= 120$_timeout_adjustment;
{
let $_slave_timeout= 1200;
}
} }
--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)` --let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)`

View File

@ -49,11 +49,8 @@
let $_slave_timeout= $slave_timeout; let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout) if (!$_slave_timeout)
{ {
let $_slave_timeout= 300; source include/slow_environ.inc;
if ($VALGRIND_TEST) let $_slave_timeout= 300$_timeout_adjustment;
{
let $_slave_timeout= 1500;
}
} }
let $_slave_param_comparison= $slave_param_comparison; let $_slave_param_comparison= $slave_param_comparison;

View File

@ -263,6 +263,7 @@ sub pre_setup() {
$::opt_suite_timeout= 24 * 60; # in minutes $::opt_suite_timeout= 24 * 60; # in minutes
$::opt_shutdown_timeout= ($interactive ? 24 * 60 : 3) * 60; # in seconds $::opt_shutdown_timeout= ($interactive ? 24 * 60 : 3) * 60; # in seconds
$::opt_start_timeout= $::opt_shutdown_timeout; # in seconds $::opt_start_timeout= $::opt_shutdown_timeout; # in seconds
$::opt_debug_sync_timeout= 3000; # in seconds
} }
} }

View File

@ -634,7 +634,7 @@ SUCCESS
drop table t2; drop table t2;
set sql_mode=no_engine_substitution; set sql_mode=no_engine_substitution;
create temporary table t2 (a int); create temporary table t2 (a int);
call p_verify_status_increment(1, 0, 0, 0); call p_verify_status_increment(3, 0, 2, 0);
SUCCESS SUCCESS
set sql_mode=default; set sql_mode=default;
@ -643,8 +643,9 @@ set sql_mode=default;
select f1(); select f1();
f1() f1()
2 2
# Two commits because a binary log record is written # Two commits because a binary log record is written, and another two
call p_verify_status_increment(2, 0, 1, 0); # as the function f1() is reloaded after creating temporary table.
call p_verify_status_increment(4, 0, 3, 0);
SUCCESS SUCCESS
commit; commit;
@ -715,11 +716,11 @@ SUCCESS
# 25. DDL: DROP TEMPORARY TABLE, does not start a transaction # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
# #
drop temporary table t2; drop temporary table t2;
call p_verify_status_increment(1, 0, 1, 0); call p_verify_status_increment(3, 0, 2, 0);
SUCCESS SUCCESS
commit; commit;
call p_verify_status_increment(1, 0, 1, 0); call p_verify_status_increment(1, 0, 0, 0);
SUCCESS SUCCESS
# 26. Verify that SET AUTOCOMMIT issues an implicit commit # 26. Verify that SET AUTOCOMMIT issues an implicit commit
@ -801,7 +802,7 @@ call p_verify_status_increment(0, 0, 0, 0);
SUCCESS SUCCESS
do (select f1() from t1 where a=2); do (select f1() from t1 where a=2);
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(4, 2, 4, 2);
SUCCESS SUCCESS
commit; commit;

View File

@ -235,3 +235,16 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop procedure sp; drop procedure sp;
drop table t1; drop table t1;
#
# MDEV-33768: Memory leak found in the test main.constraints run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT
# This test case was added by reviewer's request.
#
PREPARE stmt FROM 'CREATE TABLE t1 (a INT)';
EXECUTE stmt;
DROP TABLE t1;
EXECUTE stmt;
EXECUTE stmt;
ERROR 42S01: Table 't1' already exists
# Clean up
DROP TABLE t1;
DEALLOCATE PREPARE stmt;

View File

@ -189,3 +189,18 @@ call sp;
show create table t1; show create table t1;
drop procedure sp; drop procedure sp;
drop table t1; drop table t1;
--echo #
--echo # MDEV-33768: Memory leak found in the test main.constraints run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT
--echo # This test case was added by reviewer's request.
--echo #
PREPARE stmt FROM 'CREATE TABLE t1 (a INT)';
EXECUTE stmt;
DROP TABLE t1;
EXECUTE stmt;
--error ER_TABLE_EXISTS_ERROR
EXECUTE stmt;
--echo # Clean up
DROP TABLE t1;
DEALLOCATE PREPARE stmt;

View File

@ -17,7 +17,7 @@ insert into t1 values(9);
SET GLOBAL debug_dbug="d,crash_commit_before"; SET GLOBAL debug_dbug="d,crash_commit_before";
# Write file to make mysql-test-run.pl expect crash and restart # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Run the crashing query # Run the crashing query
--error 2013 --error 2013

View File

@ -1803,7 +1803,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`color` char(32) GENERATED ALWAYS AS (column_get(`dynamic_cols`,1 as char charset latin1)) STORED, `color` char(32) GENERATED ALWAYS AS (column_get(`dynamic_cols`,1 as char charset latin1)) STORED,
`cl` char(32) GENERATED ALWAYS AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 ),2,'ttt'),`i` as char charset latin1)) STORED, `cl` char(32) GENERATED ALWAYS AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 collate latin1_swedish_ci ),2,'ttt'),`i` as char charset latin1)) STORED,
`item_name` varchar(32) NOT NULL, `item_name` varchar(32) NOT NULL,
`i` int(11) DEFAULT NULL, `i` int(11) DEFAULT NULL,
`dynamic_cols` blob DEFAULT NULL, `dynamic_cols` blob DEFAULT NULL,

View File

@ -150,7 +150,7 @@ select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings: Warnings:
Note 1003 select hex(column_create(1,'afaf' AS char charset utf8mb3 ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `ex` Note 1003 select hex(column_create(1,'afaf' AS char charset utf8mb3 collate utf8mb3_general_ci ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `ex`
select hex(column_create(1, 0.0 AS decimal)); select hex(column_create(1, 0.0 AS decimal));
hex(column_create(1, 0.0 AS decimal)) hex(column_create(1, 0.0 AS decimal))
000100010004 000100010004
@ -354,7 +354,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings: Warnings:
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 ),1 as char charset utf8mb3) AS `ex` Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_general_ci ),1 as char charset utf8mb3) AS `ex`
select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) as ex; select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) as ex;
ex ex
1212 1212
@ -414,7 +414,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings: Warnings:
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 ),1 as char charset binary) AS `ex` Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_general_ci ),1 as char charset binary) AS `ex`
# #
# column get real # column get real
# #
@ -1882,7 +1882,7 @@ drop table t1;
create view v1 as select column_get(column_add(column_create(1 , 'blue' as char), 2, 'ttt'), 1 as char); create view v1 as select column_get(column_add(column_create(1 , 'blue' as char), 2, 'ttt'), 1 as char);
show create view v1; show create view v1;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select column_get(column_add(column_create(1,'blue' AS char charset utf8mb3 ),2,'ttt'),1 as char charset utf8mb3) AS `Name_exp_1` utf8mb3 utf8mb3_general_ci v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select column_get(column_add(column_create(1,'blue' AS char charset utf8mb3 collate utf8mb3_general_ci ),2,'ttt'),1 as char charset utf8mb3) AS `Name_exp_1` utf8mb3 utf8mb3_general_ci
select * from v1; select * from v1;
Name_exp_1 Name_exp_1
blue blue
@ -1949,3 +1949,23 @@ ex
# #
# End of 10.4 tests # End of 10.4 tests
# #
#
# Start of 10.5 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol
#
SELECT hex(column_create(1,'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)) AS ex;
ex
0001000100035361
SELECT hex(column_add(column_create(
1, 'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin),
2, 'b' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci)) AS ex;
ex
00020001000302001353612162
#
# Start of 10.5 tests
#

View File

@ -1000,3 +1000,24 @@ SELECT HEX(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL)) as ex;
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol
--echo #
SELECT hex(column_create(1,'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)) AS ex;
SELECT hex(column_add(column_create(
1, 'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin),
2, 'b' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci)) AS ex;
--echo #
--echo # Start of 10.5 tests
--echo #

View File

@ -3,10 +3,10 @@
# #
--source include/not_embedded.inc --source include/not_embedded.inc
create server '' foreign data wrapper w2 options (host '127.0.0.1'); create server '' foreign data wrapper w2 options (host '127.0.0.1');
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect -- enable_reconnect
-- source include/wait_until_connected_again.inc -- source include/wait_until_connected_again.inc

View File

@ -208,12 +208,13 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`,`b`) KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1; drop table t1;
set sql_mode= default;
# #
# MDEV-33460 select '123' 'x'; unexpected result # MDEV-33460 select '123' 'x'; unexpected result
# #
SELECT ''; SELECT '';
NULL
NULL
SELECT '' 'b' 'c'; SELECT '' 'b' 'c';
bc bc
bc bc

View File

@ -25,12 +25,15 @@ flush tables;
update t1 set a = 2; update t1 set a = 2;
show create table t1; show create table t1;
drop table t1; drop table t1;
set sql_mode= default;
--echo # --echo #
--echo # MDEV-33460 select '123' 'x'; unexpected result --echo # MDEV-33460 select '123' 'x'; unexpected result
--echo # --echo #
--disable_view_protocol
SELECT ''; SELECT '';
--enable_view_protocol
SELECT '' 'b' 'c'; SELECT '' 'b' 'c';
SELECT '' '' 'c'; SELECT '' '' 'c';
SELECT 'a' '' 'c'; SELECT 'a' '' 'c';

View File

@ -971,6 +971,84 @@ c1
9223372036854775808 9223372036854775808
drop table `a`; drop table `a`;
# #
# MDEV-18319 BIGINT UNSIGNED Performance issue
#
CREATE OR REPLACE TABLE t1 (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
);
FOR i IN 0..255
DO
INSERT INTO t1 VALUES ();
END FOR
$$
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
MIN(id) MAX(id) COUNT(*)
1 256 256
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
DROP TABLE t1;
#
# MDEV-18898 SELECT using wrong index when using operator IN with mixed types
#
CREATE TEMPORARY TABLE t1 (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
name varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
);
FOR i IN 1..255
DO
INSERT INTO t1 VALUES (i, MD5(i));
END FOR
$$
#
# Constants alone
#
ANALYZE SELECT id, name FROM t1 WHERE id = 1;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 NULL 100.00 NULL
ANALYZE SELECT id, name FROM t1 WHERE id = '2';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 NULL 100.00 NULL
#
# Two constants using IN
#
ANALYZE SELECT id, name FROM t1 WHERE id IN (1, 2);
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id IN ('1', 2) /* Used a wrong index */;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id IN (1, '2') /* Used a wrong index */;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id IN ('1', '2');
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
#
# Two constants using OR
#
ANALYZE SELECT id, name FROM t1 WHERE id = 1 OR id = 2;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id = '1' OR id = '2';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id = 1 OR id = '2';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
ANALYZE SELECT id, name FROM t1 WHERE id = '1' OR id = 2;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 2.00 100.00 100.00 Using index condition
DROP TABLE t1;
#
# End of 10.5 tests # End of 10.5 tests
# #
# #

View File

@ -742,6 +742,66 @@ SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775807 );
SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775808 ); SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775808 );
drop table `a`; drop table `a`;
--echo #
--echo # MDEV-18319 BIGINT UNSIGNED Performance issue
--echo #
CREATE OR REPLACE TABLE t1 (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
);
DELIMITER $$;
FOR i IN 0..255
DO
INSERT INTO t1 VALUES ();
END FOR
$$
DELIMITER ;$$
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
DROP TABLE t1;
--echo #
--echo # MDEV-18898 SELECT using wrong index when using operator IN with mixed types
--echo #
CREATE TEMPORARY TABLE t1 (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
name varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
);
DELIMITER $$;
FOR i IN 1..255
DO
INSERT INTO t1 VALUES (i, MD5(i));
END FOR
$$
DELIMITER ;$$
--echo #
--echo # Constants alone
--echo #
ANALYZE SELECT id, name FROM t1 WHERE id = 1;
ANALYZE SELECT id, name FROM t1 WHERE id = '2';
--echo #
--echo # Two constants using IN
--echo #
ANALYZE SELECT id, name FROM t1 WHERE id IN (1, 2);
ANALYZE SELECT id, name FROM t1 WHERE id IN ('1', 2) /* Used a wrong index */;
ANALYZE SELECT id, name FROM t1 WHERE id IN (1, '2') /* Used a wrong index */;
ANALYZE SELECT id, name FROM t1 WHERE id IN ('1', '2');
--echo #
--echo # Two constants using OR
--echo #
ANALYZE SELECT id, name FROM t1 WHERE id = 1 OR id = 2;
ANALYZE SELECT id, name FROM t1 WHERE id = '1' OR id = '2';
ANALYZE SELECT id, name FROM t1 WHERE id = 1 OR id = '2';
ANALYZE SELECT id, name FROM t1 WHERE id = '1' OR id = 2;
DROP TABLE t1;
--echo # --echo #
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #

View File

@ -1690,6 +1690,13 @@ select json_arrayagg('ä'), json_objectagg(1, 'ä');
json_arrayagg('ä') json_objectagg(1, 'ä') json_arrayagg('ä') json_objectagg(1, 'ä')
["ä"] {"1":"ä"} ["ä"] {"1":"ä"}
# #
# MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json
#
CREATE TABLE t (id CHAR AS (JSON_COMPACT (JSON_EXTRACT(doc,"$._id"))) UNIQUE KEY,doc JSON,CONSTRAINT notnu CHECK (id IS NOT NULL));
INSERT INTO t (doc) VALUES ('{ "_id" : { "$oid" : "0ca0b0f0" },"a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" :0} ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
ERROR 22001: Data too long for column 'id' at row 1
DROP TABLE t;
#
# End of 10.5 tests # End of 10.5 tests
# #
# #

View File

@ -1118,6 +1118,16 @@ set names latin1;
select json_arrayagg('ä'), json_objectagg(1, 'ä'); select json_arrayagg('ä'), json_objectagg(1, 'ä');
--enable_service_connection --enable_service_connection
--echo #
--echo # MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json
--echo #
CREATE TABLE t (id CHAR AS (JSON_COMPACT (JSON_EXTRACT(doc,"$._id"))) UNIQUE KEY,doc JSON,CONSTRAINT notnu CHECK (id IS NOT NULL));
--error ER_DATA_TOO_LONG
INSERT INTO t (doc) VALUES ('{ "_id" : { "$oid" : "0ca0b0f0" },"a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" :0} ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
DROP TABLE t;
--echo # --echo #
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #

View File

@ -6373,3 +6373,57 @@ NULL
SELECT FROM_UNIXTIME(LEAST(3696610869, NULL)); SELECT FROM_UNIXTIME(LEAST(3696610869, NULL));
FROM_UNIXTIME(LEAST(3696610869, NULL)) FROM_UNIXTIME(LEAST(3696610869, NULL))
NULL NULL
#
# Start of 10.5 tests
#
#
# MDEV-29149 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
#
SET @@timestamp= UNIX_TIMESTAMP('2022-07-21 23:00:00');
SELECT DATE_SUB('2022-07-21 00:00:00', INTERVAL 800 HOUR) AS expected_result;
expected_result
2022-06-17 16:00:00
SELECT
IF(1,TIMEDIFF('38:59:59','839:00:00'),CAST('2022-12-12' AS DATE)) AS c1,
IF(1,TIMEDIFF('-839:00:00','-38:59:59'),CAST('2022-12-12' AS DATE)) AS c2;
c1 c2
2022-06-17 16:00:00 2022-06-17 16:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '839:00:00'
Warning 1292 Truncated incorrect time value: '-839:00:00'
SELECT
IF(1,TIMEDIFF(385959,8390000),CAST('2022-12-12' AS DATE)) AS c1,
IF(1,TIMEDIFF(-8390000,-385959),CAST('2022-12-12' AS DATE)) AS c2;
c1 c2
2022-06-17 16:00:00 2022-06-17 16:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '8390000'
Warning 1292 Truncated incorrect time value: '-8390000'
SELECT
TIMEDIFF('38:59:59','839:00:00') AS c1,
CAST(TIMEDIFF('38:59:59','839:00:00') AS TIME(6)) AS c2,
TIMEDIFF('839:00:00','38:59:59') AS c3,
CAST(TIMEDIFF('839:00:00','38:59:59') AS TIME(6)) AS c4;
c1 c2 c3 c4
-800:00:00 -800:00:00.000000 800:00:00 800:00:00.000000
Warnings:
Warning 1292 Truncated incorrect time value: '839:00:00'
Warning 1292 Truncated incorrect time value: '839:00:00'
Warning 1292 Truncated incorrect time value: '839:00:00'
Warning 1292 Truncated incorrect time value: '839:00:00'
SELECT
TIMEDIFF(385959,8390000) AS c1,
CAST(TIMEDIFF(385959,8390000) AS TIME(6)) AS c2,
TIMEDIFF(8390000,385959) AS c3,
CAST(TIMEDIFF(8390000,385959) AS TIME(6)) AS c4;
c1 c2 c3 c4
-800:00:00 -800:00:00.000000 800:00:00 800:00:00.000000
Warnings:
Warning 1292 Truncated incorrect time value: '8390000'
Warning 1292 Truncated incorrect time value: '8390000'
Warning 1292 Truncated incorrect time value: '8390000'
Warning 1292 Truncated incorrect time value: '8390000'
SET @@timestamp= DEFAULT;
#
# End of 10.5 tests
#

View File

@ -3218,3 +3218,42 @@ SELECT CONCAT(MAKETIME('01', '01', LEAST( -100, NULL )));
--echo # --echo #
SELECT FROM_UNIXTIME(LEAST(3696610869, NULL)); SELECT FROM_UNIXTIME(LEAST(3696610869, NULL));
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-29149 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
--echo #
SET @@timestamp= UNIX_TIMESTAMP('2022-07-21 23:00:00');
SELECT DATE_SUB('2022-07-21 00:00:00', INTERVAL 800 HOUR) AS expected_result;
SELECT
IF(1,TIMEDIFF('38:59:59','839:00:00'),CAST('2022-12-12' AS DATE)) AS c1,
IF(1,TIMEDIFF('-839:00:00','-38:59:59'),CAST('2022-12-12' AS DATE)) AS c2;
SELECT
IF(1,TIMEDIFF(385959,8390000),CAST('2022-12-12' AS DATE)) AS c1,
IF(1,TIMEDIFF(-8390000,-385959),CAST('2022-12-12' AS DATE)) AS c2;
SELECT
TIMEDIFF('38:59:59','839:00:00') AS c1,
CAST(TIMEDIFF('38:59:59','839:00:00') AS TIME(6)) AS c2,
TIMEDIFF('839:00:00','38:59:59') AS c3,
CAST(TIMEDIFF('839:00:00','38:59:59') AS TIME(6)) AS c4;
SELECT
TIMEDIFF(385959,8390000) AS c1,
CAST(TIMEDIFF(385959,8390000) AS TIME(6)) AS c2,
TIMEDIFF(8390000,385959) AS c3,
CAST(TIMEDIFF(8390000,385959) AS TIME(6)) AS c4;
SET @@timestamp= DEFAULT;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -5072,37 +5072,37 @@ ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(PO
# MDEV-20009 Add CAST(expr AS pluggable_type) # MDEV-20009 Add CAST(expr AS pluggable_type)
# #
SELECT CAST(1 AS GEOMETRY); SELECT CAST(1 AS GEOMETRY);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometry)'
SELECT CAST(1 AS GEOMETRYCOLLECTION); SELECT CAST(1 AS GEOMETRYCOLLECTION);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometrycollection)'
SELECT CAST(1 AS POINT); SELECT CAST(1 AS POINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS point)' ERROR HY000: Operator does not exist: 'CAST(expr AS point)'
SELECT CAST(1 AS LINESTRING); SELECT CAST(1 AS LINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS linestring)'
SELECT CAST(1 AS POLYGON); SELECT CAST(1 AS POLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS polygon)'
SELECT CAST(1 AS MULTIPOINT); SELECT CAST(1 AS MULTIPOINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipoint)'
SELECT CAST(1 AS MULTILINESTRING); SELECT CAST(1 AS MULTILINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS multilinestring)'
SELECT CAST(1 AS MULTIPOLYGON); SELECT CAST(1 AS MULTIPOLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipolygon)'
SELECT CONVERT(1, GEOMETRY); SELECT CONVERT(1, GEOMETRY);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometry)'
SELECT CONVERT(1, GEOMETRYCOLLECTION); SELECT CONVERT(1, GEOMETRYCOLLECTION);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometrycollection)'
SELECT CONVERT(1, POINT); SELECT CONVERT(1, POINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS point)' ERROR HY000: Operator does not exist: 'CAST(expr AS point)'
SELECT CONVERT(1, LINESTRING); SELECT CONVERT(1, LINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS linestring)'
SELECT CONVERT(1, POLYGON); SELECT CONVERT(1, POLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS polygon)'
SELECT CONVERT(1, MULTIPOINT); SELECT CONVERT(1, MULTIPOINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipoint)'
SELECT CONVERT(1, MULTILINESTRING); SELECT CONVERT(1, MULTILINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS multilinestring)'
SELECT CONVERT(1, MULTIPOLYGON); SELECT CONVERT(1, MULTIPOLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipolygon)'
# #
# MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY # MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY
# #

View File

@ -43,10 +43,10 @@ select @@global.Host_Cache_Size > 0;
--echo # Restart server with Host_Cache_Size 1 --echo # Restart server with Host_Cache_Size 1
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
-- exec echo "restart:--host_cache_size=1 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--host_cache_size=1 " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect -- enable_reconnect
-- source include/wait_until_connected_again.inc -- source include/wait_until_connected_again.inc
@ -142,10 +142,10 @@ SELECT Host_Cache_Size = @@SESSION.Host_Cache_Size;
#--remove_file $MYSQL_TMP_DIR/bind_ip #--remove_file $MYSQL_TMP_DIR/bind_ip
#let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; #let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
#--exec echo "wait" > $restart_file #--write_line wait $restart_file
#--shutdown_server #--shutdown_server
#--source include/wait_until_disconnected.inc #--source include/wait_until_disconnected.inc
#-- exec echo "restart:--bind-address=$bind_ip " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect #-- write_line "restart:--bind-address=$bind_ip " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
#-- enable_reconnect #-- enable_reconnect
#-- source include/wait_until_connected_again.inc #-- source include/wait_until_connected_again.inc

View File

@ -15,12 +15,12 @@ EOF
--enable_reconnect --enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--init-file=$MYSQLTEST_VARDIR/init.file " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
select user,host,password,plugin,authentication_string from mysql.user where user='foo'; select user,host,password,plugin,authentication_string from mysql.user where user='foo';

View File

@ -6401,5 +6401,27 @@ b b d c c
10 NULL NULL NULL NULL 10 NULL NULL NULL NULL
DROP TABLE t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
# #
# MDEV-21102: Server crashes in JOIN_CACHE::write_record_data upon EXPLAIN with subqueries and constant tables
#
CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
CREATE TABLE t2 (c int, d int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,10);
CREATE TABLE t3 (e int, key (e)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (2),(3);
# Must not crash, must use join buffer in subquery
EXPLAIN
SELECT * FROM t1
WHERE a > b OR a IN (
SELECT c FROM t2 WHERE EXISTS (
SELECT * FROM t3 t3a JOIN t3 t3b WHERE t3a.e < d
)
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
3 SUBQUERY t3a range e e 5 NULL 2 Using where; Using index
3 SUBQUERY t3b index NULL e 5 NULL 2 Using index; Using join buffer (flat, BNL join)
DROP TABLE t1,t2,t3;
#
# End of 10.4 tests # End of 10.4 tests
# #

View File

@ -4304,6 +4304,27 @@ eval $q2;
DROP TABLE t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
--echo #
--echo # MDEV-21102: Server crashes in JOIN_CACHE::write_record_data upon EXPLAIN with subqueries and constant tables
--echo #
CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
CREATE TABLE t2 (c int, d int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,10);
CREATE TABLE t3 (e int, key (e)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (2),(3);
--echo # Must not crash, must use join buffer in subquery
EXPLAIN
SELECT * FROM t1
WHERE a > b OR a IN (
SELECT c FROM t2 WHERE EXISTS (
SELECT * FROM t3 t3a JOIN t3 t3b WHERE t3a.e < d
)
);
DROP TABLE t1,t2,t3;
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -1,8 +1,4 @@
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go';
select 1;
connect con1,localhost,root,,; connect con1,localhost,root,,;
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';
SHOW PROCESSLIST; SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress Id User Host db Command Time State Info Progress
# root # test Sleep # # NULL 0.000 # root # test Sleep # # NULL 0.000
@ -10,8 +6,6 @@ Id User Host db Command Time State Info Progress
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
SHOW PROCESSLIST; SHOW PROCESSLIST;
connection default; connection default;
1
1
SET DEBUG_SYNC='now WAIT_FOR ready'; SET DEBUG_SYNC='now WAIT_FOR ready';
KILL QUERY con_id; KILL QUERY con_id;
SET DEBUG_SYNC='now SIGNAL go'; SET DEBUG_SYNC='now SIGNAL go';

View File

@ -4,23 +4,24 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
# This is to ensure that the following SHOW PROCESSLIST does not show the query --disable_ps_protocol
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go'; # Ensure no lingering connections from an earlier test run, which can very
--send select 1 # rarely still be visible in SHOW PROCESSLIST here.
--let $wait_condition= SELECT COUNT(*) = 1 from information_schema.processlist
--source include/wait_condition.inc
--connect (con1,localhost,root,,) --connect (con1,localhost,root,,)
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';
--let $con_id = `SELECT CONNECTION_ID()` --let $con_id = `SELECT CONNECTION_ID()`
let $wait_condition=select command = 'sleep' from information_schema.processlist where id != $con_id;
source include/wait_condition.inc;
--replace_result Execute Query --replace_result Execute Query
--replace_column 1 # 3 # 6 # 7 # --replace_column 1 # 3 # 6 # 7 #
SHOW PROCESSLIST; SHOW PROCESSLIST;
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
send SHOW PROCESSLIST; send SHOW PROCESSLIST;
--connection default --connection default
--reap
# We must wait for the SHOW PROCESSLIST query to have started before sending # We must wait for the SHOW PROCESSLIST query to have started before sending
# the kill. Otherwise, the KILL may be lost since it is reset at the start of # the kill. Otherwise, the KILL may be lost since it is reset at the start of
# query execution. # query execution.
@ -34,9 +35,7 @@ reap;
SET DEBUG_SYNC='reset'; SET DEBUG_SYNC='reset';
# Wait until default connection has reset query string # Wait until default connection has reset query string
let $wait_condition= let $wait_condition=select command = 'sleep' from information_schema.processlist where id != $con_id;
SELECT COUNT(*) = 1 from information_schema.processlist
WHERE info is NULL;
--source include/wait_condition.inc --source include/wait_condition.inc
--replace_result Execute Query --replace_result Execute Query

View File

@ -0,0 +1,18 @@
set global alter_algorithm=INPLACE;
RENAME TABLE mysql.time_zone TO mysql.time_zone_BACKUP;
RENAME TABLE mysql.time_zone_name TO mysql.time_zone_name_BACKUP;
RENAME TABLE mysql.time_zone_transition TO mysql.time_zone_transition_BACKUP;
RENAME TABLE mysql.time_zone_transition_type TO mysql.time_zone_transition_type_BACKUP;
CREATE TABLE mysql.time_zone LIKE mysql.time_zone_BACKUP;
CREATE TABLE mysql.time_zone_name LIKE mysql.time_zone_name_BACKUP;
CREATE TABLE mysql.time_zone_transition LIKE mysql.time_zone_transition_BACKUP;
CREATE TABLE mysql.time_zone_transition_type LIKE mysql.time_zone_transition_type_BACKUP;
DROP TABLE mysql.time_zone;
DROP TABLE mysql.time_zone_name;
DROP TABLE mysql.time_zone_transition;
DROP TABLE mysql.time_zone_transition_type;
RENAME TABLE mysql.time_zone_BACKUP TO mysql.time_zone;
RENAME TABLE mysql.time_zone_name_BACKUP TO mysql.time_zone_name;
RENAME TABLE mysql.time_zone_transition_BACKUP TO mysql.time_zone_transition;
RENAME TABLE mysql.time_zone_transition_type_BACKUP TO mysql.time_zone_transition_type;
set global alter_algorithm=DEFAULT;

View File

@ -0,0 +1,40 @@
--source include/not_embedded.inc
# MDEV-33044 Loading time zones does not work with alter_algorithm INPLACE
set global alter_algorithm=INPLACE;
# Because loading timezones alters the mysql tables,
# this test will leave mysql in a different state than when it started.
# Furthermore, checksums on the various mysql.timezone_x tables will fail.
# Therefore we:
# 1. Make "backups" of the existing tables by renaming them
# 2. Make dummy clones of the tables we just backed up
# 3. Load timezones with alterations made to the dummy clone tables
# 4. Drop the newly made tables with changes made to them
# 5. Restore the backed up tables so the checksums will pass
RENAME TABLE mysql.time_zone TO mysql.time_zone_BACKUP;
RENAME TABLE mysql.time_zone_name TO mysql.time_zone_name_BACKUP;
RENAME TABLE mysql.time_zone_transition TO mysql.time_zone_transition_BACKUP;
RENAME TABLE mysql.time_zone_transition_type TO mysql.time_zone_transition_type_BACKUP;
CREATE TABLE mysql.time_zone LIKE mysql.time_zone_BACKUP;
CREATE TABLE mysql.time_zone_name LIKE mysql.time_zone_name_BACKUP;
CREATE TABLE mysql.time_zone_transition LIKE mysql.time_zone_transition_BACKUP;
CREATE TABLE mysql.time_zone_transition_type LIKE mysql.time_zone_transition_type_BACKUP;
--exec $MYSQL_TZINFO_TO_SQL std_data/zoneinfo | $MYSQL mysql
DROP TABLE mysql.time_zone;
DROP TABLE mysql.time_zone_name;
DROP TABLE mysql.time_zone_transition;
DROP TABLE mysql.time_zone_transition_type;
RENAME TABLE mysql.time_zone_BACKUP TO mysql.time_zone;
RENAME TABLE mysql.time_zone_name_BACKUP TO mysql.time_zone_name;
RENAME TABLE mysql.time_zone_transition_BACKUP TO mysql.time_zone_transition;
RENAME TABLE mysql.time_zone_transition_type_BACKUP TO mysql.time_zone_transition_type;
set global alter_algorithm=DEFAULT;

View File

@ -30,12 +30,12 @@
--echo # Case 2: Starting server with fifo file as general log file --echo # Case 2: Starting server with fifo file as general log file
--echo # and slow query log file. --echo # and slow query log file.
# Restart server with fifo file as general log file. # Restart server with fifo file as general log file.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--enable_reconnect --enable_reconnect
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
# Error 6 is reported, because the other end is closed # Error 6 is reported, because the other end is closed

View File

@ -16,7 +16,7 @@ let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
--remove_file $SEARCH_FILE --remove_file $SEARCH_FILE
#Shutdown the server #Shutdown the server
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
@ -30,7 +30,7 @@ let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is co
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
#Restart the server #Restart the server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
#Cleanup #Cleanup

View File

@ -2431,6 +2431,9 @@ create table t1 (a int) engine=myisam;
create table t2 (a int) stats_persistent=0, engine=innodb; create table t2 (a int) stats_persistent=0, engine=innodb;
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
connect con1, localhost, root;
start transaction with consistent snapshot;
connection default;
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait execute 2'; SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait execute 2';
update t1,t2 set t1.a=2,t2.a=3; update t1,t2 set t1.a=2,t2.a=3;
connection con2; connection con2;
@ -2462,6 +2465,7 @@ connection default;
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
drop table t1,t2; drop table t1,t2;
disconnect con2; disconnect con2;
disconnect con1;
# #
# Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null' # Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null'
# failed in open_ltable() # failed in open_ltable()

View File

@ -3115,6 +3115,12 @@ create table t2 (a int) stats_persistent=0, engine=innodb;
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
connect (con1, localhost, root);
# disable innodb purge thread, otherwise it might start purging t2,
# and will take an mdl, affecting metadata_lock_info output.
start transaction with consistent snapshot;
connection default;
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait execute 2'; SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait execute 2';
--send update t1,t2 set t1.a=2,t2.a=3 --send update t1,t2 set t1.a=2,t2.a=3
@ -3160,6 +3166,7 @@ connection default;
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
drop table t1,t2; drop table t1,t2;
disconnect con2; disconnect con2;
disconnect con1;
--echo # --echo #
--echo # Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null' --echo # Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null'

View File

@ -26,14 +26,14 @@ INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6);
SET SESSION debug_dbug="d,crash_before_flush_keys"; SET SESSION debug_dbug="d,crash_before_flush_keys";
--echo # Write file to make mysql-test-run.pl expect crash --echo # Write file to make mysql-test-run.pl expect crash
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query --echo # Run the crashing query
--error 2013 --error 2013
FLUSH TABLE t1; FLUSH TABLE t1;
--echo # Write file to make mysql-test-run.pl start the server --echo # Write file to make mysql-test-run.pl start the server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Turn on reconnect --echo # Turn on reconnect
--enable_reconnect --enable_reconnect

View File

@ -23,7 +23,7 @@ call mtr.add_suppression(" IP address .* could not be resolved");
# server or run mysql-test-run --debug mysql_client_test and check # server or run mysql-test-run --debug mysql_client_test and check
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST" $MYSQLTEST_VARDIR/log/mysql_client_test.out.log
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
# End of 4.1 tests # End of 4.1 tests

View File

@ -12,7 +12,7 @@ SET @old_slow_query_log= @@global.slow_query_log;
call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'");
call mtr.add_suppression(" IP address .* could not be resolved"); call mtr.add_suppression(" IP address .* could not be resolved");
--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST" $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1
# End of test # End of test

View File

@ -19,7 +19,7 @@ call mtr.add_suppression(" IP address .* could not be resolved");
# server or run mysql-test-run --debug mysql_client_test and check # server or run mysql-test-run --debug mysql_client_test and check
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--exec echo "$MYSQL_CLIENT_TEST --non-blocking-api" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST --non-blocking-api" $MYSQLTEST_VARDIR/log/mysql_client_test.out.log
--exec $MYSQL_CLIENT_TEST --non-blocking-api --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --non-blocking-api --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
# End of 4.1 tests # End of 4.1 tests

View File

@ -18,6 +18,8 @@ execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
SET @old_alter_alg=@@SESSION.alter_algorithm;
SET session alter_algorithm='COPY';
TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
@ -52,6 +54,7 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone E
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0');
SET session alter_algorithm=@old_alter_alg;
# #
# MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases # MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases
# #
@ -67,6 +70,8 @@ execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
SET @old_alter_alg=@@SESSION.alter_algorithm;
SET session alter_algorithm='COPY';
TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
@ -98,6 +103,7 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone E
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0');
SET session alter_algorithm=@old_alter_alg;
SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone;
COUNT(*) COUNT(*)
2 2
@ -123,6 +129,8 @@ execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF'
SET @save_sql_log_bin=@@SQL_LOG_BIN; SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0; SET SESSION SQL_LOG_BIN=0;
SET @wsrep_cannot_replicate_tz=0; SET @wsrep_cannot_replicate_tz=0;
SET @old_alter_alg=@@SESSION.alter_algorithm;
SET session alter_algorithm='COPY';
TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
@ -152,6 +160,7 @@ execute immediate if(@wsrep_cannot_replicate_tz, 'do 0','ALTER TABLE time_zone_t
execute immediate if(@wsrep_cannot_replicate_tz, 'do 0','ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id'); execute immediate if(@wsrep_cannot_replicate_tz, 'do 0','ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id');
SET SESSION SQL_LOG_BIN=@save_sql_log_bin; SET SESSION SQL_LOG_BIN=@save_sql_log_bin;
execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'); execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0');
SET session alter_algorithm=@old_alter_alg;
SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone;
COUNT(*) COUNT(*)
2 2
@ -505,6 +514,8 @@ execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
SET @old_alter_alg=@@SESSION.alter_algorithm;
SET session alter_algorithm='COPY';
TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
@ -522,6 +533,7 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone E
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0');
SET session alter_algorithm=@old_alter_alg;
DROP TABLE baseline; DROP TABLE baseline;
DROP TABLE time_zone; DROP TABLE time_zone;
DROP TABLE time_zone_name; DROP TABLE time_zone_name;

View File

@ -4,13 +4,16 @@ Test bad default storage engine.
Test non-numeric value passed to number option. Test non-numeric value passed to number option.
Test that bad value for plugin enum option is rejected correctly. Test that bad value for plugin enum option is rejected correctly.
Test to see if multiple unknown options will be displayed in the error output Test to see if multiple unknown options will be displayed in the error output
unknown option '--nonexistentoption' FOUND 1 /unknown option '--nonexistentoption2'/ in mysqltest.log
unknown option '--alsononexistent' FOUND 1 /unknown option '--alsononexistent'/ in mysqltest.log
unknown variable 'nonexistentvariable=1' FOUND 1 /unknown variable 'nonexistentvariable=1'/ in mysqltest.log
Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output
Error while setting value 'invalid_value' to 'sql_mode' FOUND 1 /Error while setting value 'invalid_value' to 'sql_mode'/ in mysqltest.log
ambiguous option '--character' (character-set-client-handshake, character_sets_dir) FOUND 1 /ambiguous option '--character'/ in mysqltest.log
option '--bootstrap' cannot take an argument FOUND 1 /option '--bootstrap' cannot take an argument/ in mysqltest.log
FOUND 1 /Integer value out of range for uint64: '18446744073709551616' for binlog_cache_size/ in mysqltest.log
FOUND 1 /Unknown suffix 'y' used for variable 'bulk_insert_buffer_size' \(value '123y'\). Legal suffix characters are: K, M, G, T, P, E/ in mysqltest.log
FOUND 1 /Error while setting value '123y' to 'bulk_insert_buffer_size'/ in mysqltest.log
Test that --help --verbose works Test that --help --verbose works
Test that --not-known-option --help --verbose gives error Test that --not-known-option --help --verbose gives error
Done. Done.

View File

@ -25,7 +25,7 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--echo Test bad binlog format. --echo Test bad binlog format.
--error 1 --error 13
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1 --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
@ -35,7 +35,7 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--echo Test non-numeric value passed to number option. --echo Test non-numeric value passed to number option.
--error 1 --error 9
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --min-examined-row-limit=notanumber >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1 --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --min-examined-row-limit=notanumber >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
@ -46,17 +46,35 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--error 7 --error 7
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1 --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log
--echo Test to see if multiple unknown options will be displayed in the error output --echo Test to see if multiple unknown options will be displayed in the error output
# Remove the noise to make the test robust
--replace_regex /^((?!nonexistent).)*$// /.*unknown/unknown/
--error 7 --error 7
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption --alsononexistent --nonexistentvariable=1 2>&1 --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption2 --alsononexistent --nonexistentvariable=1 >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--let SEARCH_PATTERN=unknown option '--nonexistentoption2'
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=unknown option '--alsononexistent'
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=unknown variable 'nonexistentvariable=1'
--source include/search_pattern_in_file.inc
--echo Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output --echo Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output
# Remove the noise to make the test robust --error 9
--replace_regex /^((?!('sql_mode'|'--character'|'--bootstrap')).)*$// /.*Error while setting value/Error while setting value/ /.*ambiguous option/ambiguous option/ /.*option '--bootstrap'/option '--bootstrap'/ --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --getopt-prefix-matching --sql-mode=invalid_value --character --bootstrap=partstoob --binlog_cache_size=18446744073709551616 --bulk_insert_buffer_size=123y >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --getopt-prefix-matching --sql-mode=invalid_value --character --bootstrap=partstoob 2>&1 --let SEARCH_PATTERN=Error while setting value 'invalid_value' to 'sql_mode'
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=ambiguous option '--character'
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=option '--bootstrap' cannot take an argument
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Integer value out of range for uint64: '18446744073709551616' for binlog_cache_size
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Unknown suffix 'y' used for variable 'bulk_insert_buffer_size' \(value '123y'\). Legal suffix characters are: K, M, G, T, P, E
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Error while setting value '123y' to 'bulk_insert_buffer_size'
--source include/search_pattern_in_file.inc
# #
# Test that an wrong option with --help --verbose gives an error # Test that an wrong option with --help --verbose gives an error

View File

@ -68,7 +68,7 @@ drop table t1;
# Test that we can't open connection to server if we are using # Test that we can't open connection to server if we are using
# a different cacert # a different cacert
# #
--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql --write_line "this query should not execute;" $MYSQLTEST_VARDIR/tmp/test.sql
# Handle that openssl gives different error messages from YaSSL. # Handle that openssl gives different error messages from YaSSL.
--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/ --replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1 --error 1

View File

@ -13,14 +13,14 @@ FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name = 'innodb';
--echo # --echo #
--echo # MDEV-6351 --plugin=force has no effect for built-in plugins --echo # MDEV-6351 --plugin=force has no effect for built-in plugins
--echo # --echo #
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--error 1 --error 1
--exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000 --disable-log-error --exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000 --disable-log-error
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--disable_reconnect --disable_reconnect

View File

@ -5979,6 +5979,19 @@ EXECUTE stmt USING DEFAULT;
# Clean up # Clean up
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2; DROP TABLE t1, t2;
# MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed. in st_select_lex::fix_prepare_information
CREATE TABLE t1 AS SELECT 1 f;
PREPARE stmt FROM 'SHOW CREATE TABLE t1';
DROP TABLE t1;
EXECUTE stmt;
ERROR 42S02: Table 'test.t1' doesn't exist
CREATE VIEW t1 AS SELECT 1;
EXECUTE stmt;
View Create View character_set_client collation_connection
t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select 1 AS `1` latin1 latin1_swedish_ci
# Clean up
DEALLOCATE PREPARE stmt;
DROP VIEW t1;
# #
# End of 10.4 tests # End of 10.4 tests
# #

View File

@ -5421,6 +5421,18 @@ EXECUTE stmt USING DEFAULT;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2; DROP TABLE t1, t2;
--echo # MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed. in st_select_lex::fix_prepare_information
CREATE TABLE t1 AS SELECT 1 f;
PREPARE stmt FROM 'SHOW CREATE TABLE t1';
DROP TABLE t1;
--error ER_NO_SUCH_TABLE
EXECUTE stmt;
CREATE VIEW t1 AS SELECT 1;
EXECUTE stmt;
--echo # Clean up
DEALLOCATE PREPARE stmt;
DROP VIEW t1;
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -2208,12 +2208,42 @@ Qcache_queries_in_cache 0
DROP FUNCTION foo; DROP FUNCTION foo;
drop table t1; drop table t1;
# #
# MDEV-33861: main.query_cache fails with embedded after
# enabling WITH_PROTECT_STATEMENT_MEMROOT
#
create table t1 (s1 int);
create procedure f3 () begin
select * from t1;
end;
//
create procedure f4 () begin
select * from t1;
end;
//
Call f4();
s1
cAll f3();
s1
insert into t1 values (2);
caLl f3();
s1
2
drop procedure f3;
drop procedure f4;
drop table t1;
#
# End of 10.4 tests
#
#
# MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression # MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
# #
SET @qc= @@query_cache_size; SET @qc= @@query_cache_size;
set global Query_cache_size=18446744073709547520; set global Query_cache_size=18446744073709547520;
SET GLOBAL query_cache_size= @qc; SET GLOBAL query_cache_size= @qc;
# #
# End of 10.5 tests
#
#
# MDEV-22301 JSON_TABLE: Queries are not inserted into query cache. # MDEV-22301 JSON_TABLE: Queries are not inserted into query cache.
# #
create table t1 (a text); create table t1 (a text);
@ -2239,6 +2269,7 @@ DROP TABLE t;
restore defaults restore defaults
SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_type= default;
SET GLOBAL query_cache_size=@save_query_cache_size; SET GLOBAL query_cache_size=@save_query_cache_size;
# End of 10.6 tests
# #
# MDEV-29028: Queries using RANDOM_BYTES get stored in query cache # MDEV-29028: Queries using RANDOM_BYTES get stored in query cache
# #
@ -2261,6 +2292,4 @@ improbable
0 0
drop table t1; drop table t1;
set global query_cache_type= @qcache; set global query_cache_type= @qcache;
#
# End of 10.10 tests # End of 10.10 tests
#

View File

@ -1807,6 +1807,40 @@ show status like "Qcache_queries_in_cache";
DROP FUNCTION foo; DROP FUNCTION foo;
drop table t1; drop table t1;
--echo #
--echo # MDEV-33861: main.query_cache fails with embedded after
--echo # enabling WITH_PROTECT_STATEMENT_MEMROOT
--echo #
create table t1 (s1 int);
--delimiter //
create procedure f3 () begin
select * from t1;
end;
//
create procedure f4 () begin
select * from t1;
end;
//
--delimiter ;
Call f4();
cAll f3();
insert into t1 values (2);
caLl f3();
drop procedure f3;
drop procedure f4;
drop table t1;
--echo #
--echo # End of 10.4 tests
--echo #
--echo # --echo #
--echo # MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression --echo # MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
--echo # --echo #
@ -1816,6 +1850,10 @@ set global Query_cache_size=18446744073709547520;
SET GLOBAL query_cache_size= @qc; SET GLOBAL query_cache_size= @qc;
--enable_warnings --enable_warnings
--echo #
--echo # End of 10.5 tests
--echo #
--echo # --echo #
--echo # MDEV-22301 JSON_TABLE: Queries are not inserted into query cache. --echo # MDEV-22301 JSON_TABLE: Queries are not inserted into query cache.
--echo # --echo #
@ -1838,6 +1876,8 @@ DROP TABLE t;
SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_type= default;
SET GLOBAL query_cache_size=@save_query_cache_size; SET GLOBAL query_cache_size=@save_query_cache_size;
--echo # End of 10.6 tests
--echo # --echo #
--echo # MDEV-29028: Queries using RANDOM_BYTES get stored in query cache --echo # MDEV-29028: Queries using RANDOM_BYTES get stored in query cache
--echo # --echo #
@ -1866,7 +1906,6 @@ select random_bytes(1024) = random_bytes(1024) as improbable;
drop table t1; drop table t1;
set global query_cache_type= @qcache; set global query_cache_type= @qcache;
--echo #
--echo # End of 10.10 tests --echo # End of 10.10 tests
--echo #
--enable_ps2_protocol --enable_ps2_protocol

View File

@ -70,7 +70,7 @@ UNLOCK TABLES;
DROP TABLE t1; DROP TABLE t1;
DROP USER test@localhost; DROP USER test@localhost;
disconnect con1; disconnect con1;
echo End of 5.1 tests # End of 5.1 tests
# #
# Bug#33669: Transactional temporary tables do not work under --read-only # Bug#33669: Transactional temporary tables do not work under --read-only
# #
@ -244,3 +244,26 @@ connection default;
SET GLOBAL READ_ONLY = OFF; SET GLOBAL READ_ONLY = OFF;
DROP USER bug33669@localhost; DROP USER bug33669@localhost;
DROP DATABASE db1; DROP DATABASE db1;
# End of 5.5 tests
#
# MDEV-33889 Read only server throws error when running a create temporary table as select statement
#
create table t1(a int) engine=innodb;
create user u1@localhost;
grant insert, select, update, delete, create temporary tables on test.* to u1@localhost;
insert into t1 values (1);
set global read_only=1;
connect u1,localhost,u1;
set default_tmp_storage_engine=innodb;
create temporary table tt1 (a int);
create temporary table tt2 like t1;
create temporary table tt3 as select * from t1;
select * from tt3;
a
1
disconnect u1;
connection default;
drop table t1;
drop user u1@localhost;
set global read_only=0;
# End of 10.5 tests

View File

@ -103,7 +103,7 @@ DROP USER test@localhost;
disconnect con1; disconnect con1;
--echo echo End of 5.1 tests --echo # End of 5.1 tests
--echo # --echo #
--echo # Bug#33669: Transactional temporary tables do not work under --read-only --echo # Bug#33669: Transactional temporary tables do not work under --read-only
@ -250,3 +250,29 @@ SET GLOBAL READ_ONLY = OFF;
DROP USER bug33669@localhost; DROP USER bug33669@localhost;
DROP DATABASE db1; DROP DATABASE db1;
--echo # End of 5.5 tests
--echo #
--echo # MDEV-33889 Read only server throws error when running a create temporary table as select statement
--echo #
create table t1(a int) engine=innodb;
create user u1@localhost;
grant insert, select, update, delete, create temporary tables on test.* to u1@localhost;
insert into t1 values (1);
set global read_only=1;
connect u1,localhost,u1;
set default_tmp_storage_engine=innodb;
create temporary table tt1 (a int);
create temporary table tt2 like t1;
create temporary table tt3 as select * from t1;
select * from tt3;
disconnect u1;
connection default;
drop table t1;
drop user u1@localhost;
set global read_only=0;
--echo # End of 10.5 tests

View File

@ -4170,5 +4170,105 @@ Warnings:
Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c1`))))
DROP TABLE t1,t2; DROP TABLE t1,t2;
set global innodb_stats_persistent= @stats.save; #
# MDEV-31154: Fatal InnoDB error or assertion `!is_v' failure upon multi-update with indexed virtual column
#
# Test with auto generated Primary Key
#
SET @save_optimizer_switch= @@optimizer_switch;
SET optimizer_switch='rowid_filter=on';
CREATE TABLE t0(a int);
INSERT INTO t0 SELECT seq FROM seq_1_to_20;
ANALYZE TABLE t0 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t0 analyze status Engine-independent statistics collected
test.t0 analyze status OK
CREATE TABLE t1 (
a int,
b int as (a * 2) VIRTUAL,
f char(200), /* Filler */
key (b),
key (a)
) engine=innodb;
INSERT INTO t1 (a, f) SELECT seq, seq FROM seq_1_to_1000;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# Test for type 'ref|filter'
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 20 Using where
1 SIMPLE t1 ref|filter b,a b|a 5|5 test.t0.a 1 (2%) Using where; Using rowid filter
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
count(*)
10
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 20 Using where
1 SIMPLE t1 ref|filter b,a b|a 5|5 test.t0.a 1 (2%) Using where; Using rowid filter
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
count(*)
10
# Test for type 'range|filter'
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range|filter b,a b|a 5|5 NULL 49 (10%) Using where; Using rowid filter
SELECT count(*) FROM t1 WHERE a<100 and b <100;
count(*)
49
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range|filter b,a b|a 5|5 NULL 49 (10%) Using where; Using rowid filter
SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
count(*)
49
# Test with Primary Key
#
DROP TABLE t1;
CREATE TABLE t1 (
p int PRIMARY KEY AUTO_INCREMENT,
a int,
b int as (a * 2) VIRTUAL,
f char(200), /* Filler */
key (b),
key (a)
) engine=innodb;
INSERT INTO t1 (a, f) SELECT seq, seq FROM seq_1_to_1000;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# Test for type 'ref|filter'
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 20 Using where
1 SIMPLE t1 ref|filter b,a b|a 5|5 test.t0.a 1 (2%) Using where; Using rowid filter
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
count(*)
10
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 20 Using where
1 SIMPLE t1 ref|filter b,a b|a 5|5 test.t0.a 1 (2%) Using where; Using rowid filter
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
count(*)
10
# Test for type 'range|filter'
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range|filter b,a b|a 5|5 NULL 49 (10%) Using where; Using rowid filter
SELECT count(*) FROM t1 WHERE a<100 and b <100;
count(*)
49
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range|filter b,a b|a 5|5 NULL 49 (10%) Using where; Using rowid filter
SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
count(*)
49
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t0, t1;
# End of 10.4 tests # End of 10.4 tests
# End of 10.6 tests
set global innodb_stats_persistent= @stats.save;

View File

@ -1,6 +1,8 @@
--source include/no_valgrind_without_big.inc --source include/no_valgrind_without_big.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_sequence.inc
--source include/innodb_stable_estimates.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
@ -683,6 +685,82 @@ eval EXPLAIN EXTENDED $q;
DROP TABLE t1,t2; DROP TABLE t1,t2;
set global innodb_stats_persistent= @stats.save; --echo #
--echo # MDEV-31154: Fatal InnoDB error or assertion `!is_v' failure upon multi-update with indexed virtual column
--echo #
--echo # Test with auto generated Primary Key
--echo #
SET @save_optimizer_switch= @@optimizer_switch;
SET optimizer_switch='rowid_filter=on';
CREATE TABLE t0(a int);
INSERT INTO t0 SELECT seq FROM seq_1_to_20;
ANALYZE TABLE t0 PERSISTENT FOR ALL;
CREATE TABLE t1 (
a int,
b int as (a * 2) VIRTUAL,
f char(200), /* Filler */
key (b),
key (a)
) engine=innodb;
INSERT INTO t1 (a, f) SELECT seq, seq FROM seq_1_to_1000;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
--echo # Test for type 'ref|filter'
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
--echo # Test for type 'range|filter'
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100;
SELECT count(*) FROM t1 WHERE a<100 and b <100;
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
--echo # Test with Primary Key
--echo #
DROP TABLE t1;
CREATE TABLE t1 (
p int PRIMARY KEY AUTO_INCREMENT,
a int,
b int as (a * 2) VIRTUAL,
f char(200), /* Filler */
key (b),
key (a)
) engine=innodb;
INSERT INTO t1 (a, f) SELECT seq, seq FROM seq_1_to_1000;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
--echo # Test for type 'ref|filter'
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20;
EXPLAIN SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
SELECT count(*) from t0,t1 WHERE t0.a=t1.b AND t1.a<20 FOR UPDATE;
--echo # Test for type 'range|filter'
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100;
SELECT count(*) FROM t1 WHERE a<100 and b <100;
EXPLAIN SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
SELECT count(*) FROM t1 WHERE a<100 and b <100 FOR UPDATE;
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t0, t1;
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # End of 10.6 tests
set global innodb_stats_persistent= @stats.save;

View File

@ -20,13 +20,13 @@ drop procedure try_shutdown;
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
--send shutdown --send shutdown
--connection default --connection default
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $_expect_file_name --write_line restart $_expect_file_name
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc

View File

@ -176,12 +176,12 @@ drop user baz@baz;
SELECT @@skip_grant_tables AS EXPECT_1; SELECT @@skip_grant_tables AS EXPECT_1;
# Also check when the server starts without "--skip-grant-table" option # Also check when the server starts without "--skip-grant-table" option
--let $restart_parameters = "--skip-skip-grant-tables" --let $restart_parameters = --skip-skip-grant-tables
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
SELECT @@skip_grant_tables AS EXPECT_0; SELECT @@skip_grant_tables AS EXPECT_0;
# Need to restart the server to restore the "--skip-grant-tables" state # Need to restart the server to restore the "--skip-grant-tables" state
--let $restart_parameters = "--skip-grant-tables" --let $restart_parameters = --skip-grant-tables
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--echo # --echo #

View File

@ -7179,15 +7179,14 @@ CREATE VIEW t1 AS SELECT 10 AS f1;
CALL p1(1); CALL p1(1);
ERROR HY000: The target table t1 of the INSERT is not insertable-into ERROR HY000: The target table t1 of the INSERT is not insertable-into
CREATE TEMPORARY TABLE t1 (f1 INT); CREATE TEMPORARY TABLE t1 (f1 INT);
# t1 still refers to the view since it was inlined
CALL p1(2); CALL p1(2);
ERROR HY000: The target table t1 of the INSERT is not insertable-into
DROP VIEW t1; DROP VIEW t1;
# t1 now refers to the temporary table # t1 now refers to the temporary table
CALL p1(3); CALL p1(3);
# Check which values were inserted into the temp table. # Check which values were inserted into the temp table.
SELECT * FROM t1; SELECT * FROM t1;
f1 f1
2
3 3
DROP TEMPORARY TABLE t1; DROP TEMPORARY TABLE t1;
DROP PROCEDURE p1; DROP PROCEDURE p1;

View File

@ -8632,8 +8632,6 @@ CALL p1(1);
CREATE TEMPORARY TABLE t1 (f1 INT); CREATE TEMPORARY TABLE t1 (f1 INT);
--echo # t1 still refers to the view since it was inlined
--error ER_NON_INSERTABLE_TABLE
CALL p1(2); CALL p1(2);
DROP VIEW t1; DROP VIEW t1;

View File

@ -2,4 +2,4 @@
Variable_name Value Variable_name Value
Ssl_version TLS_VERSION Ssl_version TLS_VERSION
# try logging in with a certificate in the server's --ssl-crl : should fail # try logging in with a certificate in the server's --ssl-crl : should fail
ERROR 2026 (HY000): TLS/SSL error: sslv3 alert certificate revoked ERROR 2026 (HY000): TLS/SSL error: ssl/tls alert certificate revoked

View File

@ -7,7 +7,7 @@
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-new-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" --exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-new-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'"
--echo # try logging in with a certificate in the server's --ssl-crl : should fail --echo # try logging in with a certificate in the server's --ssl-crl : should fail
# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is different # OpenSSL 1.1.1a and later releases correctly rejects the certificate, but the error message is different
--replace_regex /ERROR 2013 \(HY000\): Lost connection to server at '.*', system error: [0-9]+/ERROR 2026 (HY000): TLS\/SSL error: sslv3 alert certificate revoked/ --replace_regex /(ERROR 2013 \(HY000\): Lost connection to server at '.*', system error: [0-9]+|ERROR 2026 \(HY000\): TLS\/SSL error: sslv3 alert certificate revoked)/ERROR 2026 (HY000): TLS\/SSL error: ssl\/tls alert certificate revoked/
--error 1 --error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1 --exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1

View File

@ -1,5 +1,5 @@
# connect with read timeout so SLEEP() should timeout # connect with read timeout so SLEEP() should timeout
connect ssl_con,localhost,root,,,,,SSL read_timeout=5; connect ssl_con,localhost,root,,,,,SSL read_timeout=5$_timeout_adjustment;
# Check ssl turned on # Check ssl turned on
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'; SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
have_ssl have_ssl

View File

@ -1,10 +1,11 @@
--source include/have_ssl_communication.inc --source include/have_ssl_communication.inc
--source include/slow_environ.inc
# Save the initial number of concurrent sessions # Save the initial number of concurrent sessions
--source include/count_sessions.inc --source include/count_sessions.inc
--echo # connect with read timeout so SLEEP() should timeout --echo # connect with read timeout so SLEEP() should timeout
connect (ssl_con,localhost,root,,,,,SSL read_timeout=5); connect (ssl_con,localhost,root,,,,,SSL read_timeout=5$_timeout_adjustment);
--echo # Check ssl turned on --echo # Check ssl turned on
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'; SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';

View File

@ -3330,4 +3330,33 @@ a
2 2
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
#
# MDEV-33747: Optimization of (SELECT) IN (SELECT ...) executes subquery at prepare stage
#
create table t1 (a int, b int);
insert into t1 select seq, seq from seq_1_to_200;
create table t2 as select * from t1;
create table t3 as select * from t1;
analyze table t1,t2,t3;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
select @@expensive_subquery_limit < 200 as DEFAULTS_ARE_SUITABLE;
DEFAULTS_ARE_SUITABLE
1
flush status;
explain select * from t1 where a<3 or (select max(a) from t2) in (select b from t3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 200 Using where
3 SUBQUERY t3 ALL NULL NULL NULL NULL 200 Using where
2 SUBQUERY t2 ALL NULL NULL NULL NULL 200
# Must show 0. If this shows 200, this means subquery was executed and you have a bug:
show status like 'Handler_read_rnd_next%';
Variable_name Value
Handler_read_rnd_next 0
drop table t1,t2,t3;
# End of 10.4 tests # End of 10.4 tests

View File

@ -2670,5 +2670,20 @@ DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
--echo #
--echo # MDEV-33747: Optimization of (SELECT) IN (SELECT ...) executes subquery at prepare stage
--echo #
create table t1 (a int, b int);
insert into t1 select seq, seq from seq_1_to_200;
create table t2 as select * from t1;
create table t3 as select * from t1;
analyze table t1,t2,t3;
select @@expensive_subquery_limit < 200 as DEFAULTS_ARE_SUITABLE;
flush status;
explain select * from t1 where a<3 or (select max(a) from t2) in (select b from t3);
--echo # Must show 0. If this shows 200, this means subquery was executed and you have a bug:
show status like 'Handler_read_rnd_next%';
drop table t1,t2,t3;
--echo # End of 10.4 tests --echo # End of 10.4 tests

View File

@ -614,6 +614,55 @@ Tables_in_test
# in 11.2 and above here should be listed above used temporary tables # in 11.2 and above here should be listed above used temporary tables
DROP TEMPORARY TABLE t1, t2; DROP TEMPORARY TABLE t1, t2;
# #
# MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed. in st_select_lex::fix_prepare_information
#
CREATE VIEW v1 AS SELECT 5;
CREATE PROCEDURE sp() SELECT * FROM v1;
CREATE TEMPORARY TABLE v1 as SELECT 7;
# sp() accesses the temporary table v1 that hides the view with the same name
# Therefore expected output is the row (7)
CALL sp();
7
7
DROP TEMPORARY TABLE v1;
# After the temporary table v1 has been dropped the next invocation of sp()
# accesses the view v1. So, expected output is the row (5)
CALL sp();
5
5
# Clean up
DROP VIEW v1;
DROP PROCEDURE sp;
# Another use case is when a temporary table hides a view is dropped
# inside a stored routine being called.
CREATE VIEW t1 AS SELECT 1;
CREATE PROCEDURE p1()
BEGIN
DROP TEMPORARY TABLE t1;
END
|
CREATE FUNCTION f1() RETURNS INT
BEGIN
CALL p1();
RETURN 1;
END
|
CREATE TEMPORARY TABLE t1 AS SELECT 1 AS a;
PREPARE stmt FROM 'SELECT f1()';
EXECUTE stmt;
f1()
1
# The temporary table t1 has been dropped on first
# execution of the prepared statement 'stmt',
# next time this statement is run it results in issuing
# the error ER_BAD_TABLE_ERROR
EXECUTE stmt;
ERROR 42S02: Unknown table 'test.t1'
# Clean up
DROP VIEW t1;
DROP FUNCTION f1;
DROP PROCEDURE p1;
#
# End of 10.4 tests # End of 10.4 tests
# #
create function f1() returns int create function f1() returns int

View File

@ -669,6 +669,60 @@ SHOW TABLES;
DROP TEMPORARY TABLE t1, t2; DROP TEMPORARY TABLE t1, t2;
--echo #
--echo # MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed. in st_select_lex::fix_prepare_information
--echo #
CREATE VIEW v1 AS SELECT 5;
CREATE PROCEDURE sp() SELECT * FROM v1;
CREATE TEMPORARY TABLE v1 as SELECT 7;
--echo # sp() accesses the temporary table v1 that hides the view with the same name
--echo # Therefore expected output is the row (7)
CALL sp();
DROP TEMPORARY TABLE v1;
--echo # After the temporary table v1 has been dropped the next invocation of sp()
--echo # accesses the view v1. So, expected output is the row (5)
CALL sp();
--echo # Clean up
DROP VIEW v1;
DROP PROCEDURE sp;
--echo # Another use case is when a temporary table hides a view is dropped
--echo # inside a stored routine being called.
CREATE VIEW t1 AS SELECT 1;
--delimiter |
CREATE PROCEDURE p1()
BEGIN
DROP TEMPORARY TABLE t1;
END
|
CREATE FUNCTION f1() RETURNS INT
BEGIN
CALL p1();
RETURN 1;
END
|
--delimiter ;
CREATE TEMPORARY TABLE t1 AS SELECT 1 AS a;
PREPARE stmt FROM 'SELECT f1()';
EXECUTE stmt;
--echo # The temporary table t1 has been dropped on first
--echo # execution of the prepared statement 'stmt',
--echo # next time this statement is run it results in issuing
--echo # the error ER_BAD_TABLE_ERROR
--error ER_BAD_TABLE_ERROR
EXECUTE stmt;
--echo # Clean up
DROP VIEW t1;
DROP FUNCTION f1;
DROP PROCEDURE p1;
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -4550,8 +4550,6 @@ sub extract_warning_lines ($$) {
qr/WSREP: Guessing address for incoming client/, qr/WSREP: Guessing address for incoming client/,
qr/InnoDB: Difficult to find free blocks in the buffer pool*/, qr/InnoDB: Difficult to find free blocks in the buffer pool*/,
# for UBSAN
qr/decimal\.c.*: runtime error: signed integer overflow/,
# Disable test for UBSAN on dynamically loaded objects # Disable test for UBSAN on dynamically loaded objects
qr/runtime error: member call.*object.*'Handler_share'/, qr/runtime error: member call.*object.*'Handler_share'/,
qr/sql_type\.cc.* runtime error: member call.*object.* 'Type_collection'/, qr/sql_type\.cc.* runtime error: member call.*object.* 'Type_collection'/,
@ -5711,6 +5709,8 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'}); mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
} }
mtr_add_arg($args, "--wait-for-pos-timeout=%d", $opt_debug_sync_timeout);
client_debug_arg($args, "mysqltest"); client_debug_arg($args, "mysqltest");
if ( $opt_record ) if ( $opt_record )

View File

@ -98,7 +98,7 @@ reset master;
--echo # crash_purge_before_update_index --echo # crash_purge_before_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_before_update_index"; SET SESSION debug_dbug="+d,crash_purge_before_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
@ -119,7 +119,7 @@ SELECT @index;
--echo # crash_purge_non_critical_after_update_index --echo # crash_purge_non_critical_after_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index"; SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
@ -143,7 +143,7 @@ SELECT @index;
--echo # crash_purge_critical_after_update_index --echo # crash_purge_critical_after_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index"; SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
@ -167,7 +167,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000008;
SELECT @index; SELECT @index;
--echo # crash_create_non_critical_before_update_index --echo # crash_create_non_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index"; SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
--error 2013 --error 2013
flush logs; flush logs;
@ -185,7 +185,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000009;
SELECT @index; SELECT @index;
--echo # crash_create_critical_before_update_index --echo # crash_create_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index"; SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
--error 2013 --error 2013
flush logs; flush logs;
@ -205,7 +205,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000011;
SELECT @index; SELECT @index;
--echo # crash_create_after_update_index --echo # crash_create_after_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_after_update_index"; SET SESSION debug_dbug="+d,crash_create_after_update_index";
--error 2013 --error 2013
flush logs; flush logs;

View File

@ -26,10 +26,10 @@
ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb; ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb;
--echo # Restart the server so mysqld reads the gtid_slave_pos using innodb --echo # Restart the server so mysqld reads the gtid_slave_pos using innodb
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc

View File

@ -68,10 +68,10 @@ while ($loop_times) {
# try to change the log-bin configs and restart # try to change the log-bin configs and restart
--echo # ======= now try to change the log-bin config for mysqld ======= --echo # ======= now try to change the log-bin config for mysqld =======
--let $restart_parameters="--log-bin=new_log_bin" --let $restart_parameters=--log-bin=new_log_bin
--echo #begin to restart mysqld --echo #begin to restart mysqld
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--let $restart_parameters= "" --let $restart_parameters=
--source include/show_binary_logs.inc --source include/show_binary_logs.inc
let $loop_times= 10; let $loop_times= 10;

View File

@ -20,7 +20,7 @@
--connection $_cur_con --connection $_cur_con
--enable_reconnect --enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
shutdown_server; shutdown_server;
@ -31,5 +31,5 @@ if ($rpl_server_parameters)
{ {
--let $_rpl_start_server_command= restart:$rpl_server_parameters --let $_rpl_start_server_command= restart:$rpl_server_parameters
} }
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line "$_rpl_start_server_command" $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc

View File

@ -206,10 +206,12 @@ RETURN x;
END END
|| ||
SET sql_log_bin=1; SET sql_log_bin=1;
include/stop_slave_io.inc
connection server_1; connection server_1;
INSERT INTO t3 VALUES (49,0); INSERT INTO t3 VALUES (49,0);
connection server_2; connection server_2;
START SLAVE SQL_THREAD; CHANGE MASTER TO master_use_gtid=no;
include/start_slave.inc
SELECT * FROM t3 WHERE a >= 40 ORDER BY a; SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
a b a b
41 41 41 41
@ -239,10 +241,6 @@ SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10; SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc include/start_slave.inc
*** 3. Same as (2), but not using gtid mode *** *** 3. Same as (2), but not using gtid mode ***
connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=no;
include/start_slave.inc
connection server_1; connection server_1;
connection con_temp3; connection con_temp3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';

View File

@ -33,37 +33,37 @@ ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(PO
# MDEV-20009 Add CAST(expr AS pluggable_type) # MDEV-20009 Add CAST(expr AS pluggable_type)
# #
SELECT CAST(1 AS GEOMETRY); SELECT CAST(1 AS GEOMETRY);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometry)'
SELECT CAST(1 AS GEOMETRYCOLLECTION); SELECT CAST(1 AS GEOMETRYCOLLECTION);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometrycollection)'
SELECT CAST(1 AS POINT); SELECT CAST(1 AS POINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS point)' ERROR HY000: Operator does not exist: 'CAST(expr AS point)'
SELECT CAST(1 AS LINESTRING); SELECT CAST(1 AS LINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS linestring)'
SELECT CAST(1 AS POLYGON); SELECT CAST(1 AS POLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS polygon)'
SELECT CAST(1 AS MULTIPOINT); SELECT CAST(1 AS MULTIPOINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipoint)'
SELECT CAST(1 AS MULTILINESTRING); SELECT CAST(1 AS MULTILINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS multilinestring)'
SELECT CAST(1 AS MULTIPOLYGON); SELECT CAST(1 AS MULTIPOLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipolygon)'
SELECT CONVERT(1, GEOMETRY); SELECT CONVERT(1, GEOMETRY);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometry)'
SELECT CONVERT(1, GEOMETRYCOLLECTION); SELECT CONVERT(1, GEOMETRYCOLLECTION);
ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)' ERROR HY000: Operator does not exist: 'CAST(expr AS geometrycollection)'
SELECT CONVERT(1, POINT); SELECT CONVERT(1, POINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS point)' ERROR HY000: Operator does not exist: 'CAST(expr AS point)'
SELECT CONVERT(1, LINESTRING); SELECT CONVERT(1, LINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS linestring)'
SELECT CONVERT(1, POLYGON); SELECT CONVERT(1, POLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS polygon)'
SELECT CONVERT(1, MULTIPOINT); SELECT CONVERT(1, MULTIPOINT);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipoint)'
SELECT CONVERT(1, MULTILINESTRING); SELECT CONVERT(1, MULTILINESTRING);
ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)' ERROR HY000: Operator does not exist: 'CAST(expr AS multilinestring)'
SELECT CONVERT(1, MULTIPOLYGON); SELECT CONVERT(1, MULTIPOLYGON);
ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)' ERROR HY000: Operator does not exist: 'CAST(expr AS multipolygon)'
# #
# End of 10.5 tests # End of 10.5 tests
# #

View File

@ -16,7 +16,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau
--let $MYSQLD_DATADIR = `SELECT @@datadir` --let $MYSQLD_DATADIR = `SELECT @@datadir`
--let SEARCH_RANGE = 10000000 --let SEARCH_RANGE = 10000000
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd --let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
@ -25,7 +25,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau
4;770A8A65DA156D24EE2A093277530143 4;770A8A65DA156D24EE2A093277530143
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
@ -47,7 +47,7 @@ UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
@ -62,7 +62,7 @@ ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1"); ib_restore_tablespaces("test", "t1");
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
@ -80,7 +80,7 @@ SELECT * FROM t1;
-- let SEARCH_FILE=$t1_IBD -- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc -- source include/search_pattern_in_file.inc
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--remove_file $MYSQLTEST_VARDIR/keys1.txt --remove_file $MYSQLTEST_VARDIR/keys1.txt
@ -89,7 +89,7 @@ SELECT * FROM t1;
4;770A8A65DA156D24EE2A093277530143 4;770A8A65DA156D24EE2A093277530143
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
DROP TABLE t1; DROP TABLE t1;

View File

@ -21,7 +21,7 @@ CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null,
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
CREATE TABLE t2 (f1 int not null)engine=innodb; CREATE TABLE t2 (f1 int not null)engine=innodb;
let $restart_parameters="--debug=d,ib_log_checkpoint_avoid"; let $restart_parameters=--debug=d,ib_log_checkpoint_avoid;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
# Stop the purge # Stop the purge

View File

@ -22,7 +22,7 @@ galera_concurrent_ctas : MDEV-32779 galera_concurrent_ctas: assertion in the gal
galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback() galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback() galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
galera_sst_mysqldump_with_key : MDEV-32782 galera_sst_mysqldump_with_key test failed galera_sst_mysqldump_with_key : MDEV-32782 galera_sst_mysqldump_with_key test failed
mdev-31285 : MDEV-25089 Assertion `error.len > 0' failed in galera::ReplicatorSMM::handle_apply_error()
galera_var_ignore_apply_errors : MENT-1997 galera_var_ignore_apply_errors test freezes galera_var_ignore_apply_errors : MENT-1997 galera_var_ignore_apply_errors test freezes
MW-402 : temporarily disabled at the request of Codership MW-402 : temporarily disabled at the request of Codership
galera_desync_overlapped : MDEV-21538 galera_desync_overlapped MTR failed: Result content mismatch galera_desync_overlapped : MDEV-21538 galera_desync_overlapped MTR failed: Result content mismatch
galera_create_table_as_select : MDEV-33952 fails sporadically

View File

@ -8,7 +8,7 @@ if (!$kill_signal)
# Write file to make mysql-test-run.pl expect the crash, but don't start it # Write file to make mysql-test-run.pl expect the crash, but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Kill the connected server # Kill the connected server
--disable_reconnect --disable_reconnect

View File

@ -1,18 +0,0 @@
# This is the first half of include/restart_mysqld.inc.
if ($rpl_inited)
{
if (!$allow_rpl_inited)
{
--die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc
}
}
# Write file to make mysql-test-run.pl expect the "crash", but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server
--shutdown_server
--source include/wait_until_disconnected.inc

View File

@ -4,12 +4,12 @@
if ($galera_wsrep_start_position != '') { if ($galera_wsrep_start_position != '') {
--echo Using --wsrep-start-position when starting mysqld ... --echo Using --wsrep-start-position when starting mysqld ...
--exec echo "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" > $_expect_file_name --write_line "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" $_expect_file_name
--let $galera_wsrep_start_position = 0 --let $galera_wsrep_start_position = 0
} }
if ($galera_wsrep_start_position == '') { if ($galera_wsrep_start_position == '') {
--exec echo "restart:$start_mysqld_params" > $_expect_file_name --write_line "restart:$start_mysqld_params" $_expect_file_name
} }
--source include/galera_wait_ready.inc --source include/galera_wait_ready.inc

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