1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 11.4 into 11.7

This commit is contained in:
Marko Mäkelä
2025-01-09 09:41:38 +02:00
552 changed files with 12641 additions and 3550 deletions

View File

@@ -31,7 +31,7 @@ ENDIF()
# in RPM's:
#set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0074 CMP0075 CMP0069 CMP0135)
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0067 CMP0074 CMP0075 CMP0069 CMP0135)
IF(POLICY ${p})
CMAKE_POLICY(SET ${p} NEW)
ENDIF()

View File

@@ -5338,6 +5338,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
}
if (!opt_silent || info_type == INFO_ERROR)
{
report_progress_end();
fflush(stdout);
if (!inited)
{
#ifdef HAVE_SETUPTERM

View File

@@ -9824,7 +9824,7 @@ void init_re(void)
//"[[:space:]]*CALL[[:space:]]|" // XXX run_query_stmt doesn't read multiple result sets
"[[:space:]]*CHANGE[[:space:]]|"
"[[:space:]]*CHECKSUM[[:space:]]|"
"[[:space:]]*COMMIT[[:space:]]|"
"[[:space:]]*COMMIT[[:space:]]*|"
"[[:space:]]*COMPOUND[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+DATABASE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+INDEX[[:space:]]|"

View File

@@ -125,16 +125,20 @@ FUNCTION(DTRACE_INSTRUMENT target)
WORKING_DIRECTORY ${objdir}
)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# dtrace on Linux runs gcc and uses flags from environment
SET(CFLAGS_SAVED $ENV{CFLAGS})
SET(ENV{CFLAGS} ${CMAKE_C_FLAGS})
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# dtrace on Linux runs gcc and uses flags from environment
SET(CFLAGS_SAVED $ENV{CFLAGS})
SET(ENV{CFLAGS} ${CMAKE_C_FLAGS})
ENDIF()
SET(outfile "${CMAKE_BINARY_DIR}/probes_mysql.o")
# Systemtap object
EXECUTE_PROCESS(
COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
-o ${outfile}
)
SET(ENV{CFLAGS} ${CFLAGS_SAVED})
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(ENV{CFLAGS} ${CFLAGS_SAVED})
ENDIF()
ENDIF()
# Do not try to extend the library if we have not built the .o file

View File

@@ -7,6 +7,7 @@ ENDIF()
SET(CONC_WITH_SIGNCODE ${SIGNCODE})
SET(SIGN_OPTIONS ${SIGNTOOL_PARAMETERS})
SET(CONC_WITH_EXTERNAL_ZLIB ON)
SET(CLIENT_PLUGIN_PARSEC OFF)
CHECK_INCLUDE_FILES (threads.h HAVE_THREADS_H)
IF(HAVE_THREADS_H)

View File

@@ -459,9 +459,12 @@ bool get_mysql_vars(MYSQL *connection)
msg("Using server version %s", version_var);
if (!(ret= detect_mysql_capabilities_for_backup()))
if (opt_galera_info && !have_galera_enabled)
{
goto out;
msg("--galera-info is specified on the command "
"line, but the server does not support Galera "
"replication. Ignoring the option.");
opt_galera_info= false;
}
/* make sure datadir value is the same in configuration file */
@@ -554,30 +557,6 @@ out:
return (ret);
}
/*********************************************************************//**
Query the server to find out what backup capabilities it supports.
@return true on success. */
bool
detect_mysql_capabilities_for_backup()
{
/* do some sanity checks */
if (opt_galera_info && !have_galera_enabled) {
msg("--galera-info is specified on the command "
"line, but the server does not support Galera "
"replication. Ignoring the option.");
opt_galera_info = false;
}
if (opt_slave_info && have_multi_threaded_slave &&
!have_gtid_slave) {
msg("The --slave-info option requires GTID enabled for a "
"multi-threaded slave.");
return(false);
}
return(true);
}
static
bool
select_incremental_lsn_from_history(lsn_t *incremental_lsn)

View File

@@ -43,9 +43,6 @@ backup_cleanup();
bool
get_mysql_vars(MYSQL *connection);
bool
detect_mysql_capabilities_for_backup();
MYSQL *
xb_mysql_connect();

View File

@@ -186,6 +186,7 @@ xb_fil_cur_open(
}
#else
err = fstat(cursor->file.m_file, &cursor->statinfo);
MSAN_STAT_WORKAROUND(&cursor->statinfo);
#endif
if (max_file_size < (ulonglong)cursor->statinfo.st_size) {
cursor->statinfo.st_size = (ulonglong)max_file_size;

View File

@@ -915,13 +915,15 @@ datafiles_iter_next(datafiles_iter_t *it)
fil_system.space_list.begin() :
std::next(it->space);
while (it->space != fil_system.space_list.end() &&
(it->space->purpose != FIL_TYPE_TABLESPACE ||
UT_LIST_GET_LEN(it->space->chain) == 0))
while (it->space != fil_system.space_list.end()
&& UT_LIST_GET_LEN(it->space->chain) == 0)
++it->space;
if (it->space == fil_system.space_list.end())
goto end;
ut_ad(!it->space->is_temporary());
ut_ad(!it->space->is_being_imported());
it->node = UT_LIST_GET_FIRST(it->space->chain);
end:
@@ -1113,7 +1115,8 @@ static void backup_file_op(uint32_t space_id, int type,
std::string space_name = filename_to_spacename(name, len);
ddl_tracker.id_to_name[space_id] = space_name;
ddl_tracker.delete_defer(space_id, space_name);
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
space_id, int(len), name);
}
break;
case FILE_MODIFY:
@@ -1129,7 +1132,7 @@ static void backup_file_op(uint32_t space_id, int type,
ddl_tracker.id_to_name[space_id] = new_space_name;
ddl_tracker.rename_defer(space_id, old_space_name,
new_space_name);
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
}
break;
@@ -1137,7 +1140,8 @@ static void backup_file_op(uint32_t space_id, int type,
ddl_tracker.drops.insert(space_id);
ddl_tracker.delete_defer(
space_id, filename_to_spacename(name, len));
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
space_id, int(len), name);
break;
default:
ut_ad(0);
@@ -1188,13 +1192,14 @@ static void backup_file_op_fail(uint32_t space_id, int type,
const std::string spacename{filename_to_spacename(name, len)};
switch (type) {
case FILE_CREATE:
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
space_id, int(len), name);
fail = !check_if_skip_table(spacename.c_str());
break;
case FILE_MODIFY:
break;
case FILE_RENAME:
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
fail = !check_if_skip_table(spacename.c_str())
|| !check_if_skip_table(
@@ -1203,7 +1208,8 @@ static void backup_file_op_fail(uint32_t space_id, int type,
case FILE_DELETE:
fail = !check_if_skip_table(spacename.c_str())
&& !check_if_fts_table(spacename.c_str());
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
space_id, int(len), name);
break;
default:
ut_ad(0);
@@ -1224,7 +1230,7 @@ static void backup_undo_trunc(uint32_t space_id)
/* Function to store the space id of page0 INIT_PAGE
@param space_id space id which has page0 init page */
static void backup_first_page_op(space_id_t space_id)
static void backup_first_page_op(uint32_t space_id)
{
first_page_init_ids.insert(space_id);
}
@@ -3955,8 +3961,8 @@ static void xb_load_single_table_tablespace(const char *dirname,
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
mysql_mutex_lock(&fil_system.mutex);
space = fil_space_t::create(
file->space_id(), file->flags(),
FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */,
uint32_t(file->space_id()), file->flags(), false,
nullptr/* TODO: crypt_data */,
FIL_ENCRYPTION_DEFAULT,
file->handle() != OS_FILE_CLOSED);
ut_ad(space);
@@ -4173,6 +4179,7 @@ next_file:
return(-1);
}
MSAN_STAT_WORKAROUND(&statinfo);
info->size = statinfo.st_size;
if (S_ISDIR(statinfo.st_mode)) {
@@ -5691,8 +5698,8 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
iter != ddl_tracker.tables_in_backup.end();
iter++) {
const std::string name = iter->second;
uint32_t id = iter->first;
const std::string &name = iter->second;
if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) {
dropped_tables.insert(name);
@@ -5719,7 +5726,7 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
iter++) {
uint32_t id = iter->first;
std::string name = iter->second;
const std::string &name = iter->second;
if (ddl_tracker.tables_in_backup.find(id) != ddl_tracker.tables_in_backup.end()) {
/* already processed above */
@@ -6016,8 +6023,8 @@ exit:
char tmpname[FN_REFLEN];
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%u",
dbname, fil_space->id);
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%"
PRIu32, dbname, fil_space->id);
msg("mariabackup: Renaming %s to %s.ibd",
fil_space->chain.start->name, tmpname);
@@ -6072,8 +6079,8 @@ exit:
ut_ad(fil_space_t::physical_size(flags) == info.page_size);
mysql_mutex_lock(&fil_system.mutex);
fil_space_t* space = fil_space_t::create(info.space_id, flags,
FIL_TYPE_TABLESPACE, 0,
fil_space_t* space = fil_space_t::create(uint32_t(info.space_id),
flags, false, 0,
FIL_ENCRYPTION_DEFAULT, true);
mysql_mutex_unlock(&fil_system.mutex);
if (space) {
@@ -6866,7 +6873,8 @@ error:
srv_max_dirty_pages_pct_lwm = srv_max_buf_pool_modified_pct;
}
if (innodb_init()) {
recv_sys.recovery_on = false;
if (innodb_init()) {
goto error;
}

View File

@@ -78,5 +78,7 @@
{ "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" },
{ "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" },
{ "HA_ERR_INCOMPATIBLE_DEFINITION", HA_ERR_INCOMPATIBLE_DEFINITION, "" },
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, "" },
{ "HA_ERR_COMMIT_ERROR", HA_ERR_COMMIT_ERROR, "" },
{ "HA_ERR_PARTITION_LIST", HA_ERR_PARTITION_LIST, ""},
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, ""},
{ "HA_ERR_ROLLBACK", HA_ERR_ROLLBACK, "" },

View File

@@ -105,6 +105,7 @@ typedef struct st_heap_block
uint recbuffer; /* Length of one saved record */
ulong records_in_block; /* Records in one heap-block */
ulong last_allocated; /* number of records there is allocated space for */
size_t alloc_size; /* Allocate blocks of this size */
} HP_BLOCK;
struct st_heap_info; /* For reference */

View File

@@ -485,9 +485,9 @@ typedef struct my_charset_loader_st
{
char error[128];
void *(*once_alloc)(size_t);
void *(*malloc)(size_t);
void *(*realloc)(void *, size_t);
void (*free)(void *);
void *(*malloc)(size_t); /* Not used */
void *(*realloc)(void *, size_t); /* Not used */
void (*free)(void *); /* Not used */
void (*reporter)(enum loglevel, const char *format, ...);
int (*add_collation)(struct charset_info_st *cs);
} MY_CHARSET_LOADER;
@@ -1753,6 +1753,7 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
uint my_ci_get_id_generic(CHARSET_INFO *cs, my_collation_id_type_t type);
LEX_CSTRING my_ci_get_collation_name_generic(CHARSET_INFO *cs,
my_collation_name_mode_t mode);
my_bool compare_collations(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
typedef struct
{

View File

@@ -70,6 +70,17 @@
# endif /* GNUC >= 3.1 */
#endif
/* gcc 7.5.0 does not support __attribute__((no_sanitize("undefined")) */
#ifndef ATTRIBUTE_NO_UBSAN
# if (GCC_VERSION >= 8000) || defined(__clang__)
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
# elif (GCC_VERSION >= 6001)
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize_undefined))
# else
# define ATTRIBUTE_NO_UBSAN
# endif
#endif
/* Define pragmas to disable warnings for stack frame checking */
#if defined(__clang__)

View File

@@ -544,9 +544,10 @@ enum ha_base_keytype {
#define HA_ERR_COMMIT_ERROR 197
#define HA_ERR_PARTITION_LIST 198
#define HA_ERR_NO_ENCRYPTION 199
#define HA_ERR_LOCAL_TMP_SPACE_FULL 200
#define HA_ERR_GLOBAL_TMP_SPACE_FULL 201
#define HA_ERR_LAST 201 /* Copy of last error nr * */
#define HA_ERR_ROLLBACK 200 /* Automatic rollback done */
#define HA_ERR_LOCAL_TMP_SPACE_FULL 201
#define HA_ERR_GLOBAL_TMP_SPACE_FULL 202
#define HA_ERR_LAST 202 /* Copy of last error nr * */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

View File

@@ -679,10 +679,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
*/
#define IO_SIZE 4096U
/*
How much overhead does malloc have. The code often allocates
How much overhead does malloc/my_malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes
*/
#define MALLOC_OVERHEAD 8
#define MALLOC_OVERHEAD (8+24)
/* get memory in huncs */
#define ONCE_ALLOC_INIT (uint) 4096

View File

@@ -111,7 +111,8 @@ static const char *handler_error_messages[]=
"Error during commit",
"Cannot select partitions",
"Cannot initialize encryption. Check that all encryption parameters have been set",
/* 200 */
"Transaction was aborted",
/* HA_ERR_LOCAL_TMP_SPACE_FULL=201 */
"Local temporary space limit reached",
"Global temporary space limit reached"
};

View File

@@ -97,7 +97,7 @@ C_MODE_START
/**
A cycle timer.
On clang we use __builtin_readcyclecounter(), except for AARCH64.
On clang we use __builtin_readcyclecounter(), except for AARCH64 and RISC-V.
On other compilers:
On IA-32 and AMD64, we use the RDTSC instruction.
@@ -152,7 +152,7 @@ C_MODE_START
*/
static inline ulonglong my_timer_cycles(void)
{
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__) && !(defined(__linux__) && defined(__riscv))
#define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64
return __builtin_readcyclecounter();
# elif defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__

View File

@@ -270,9 +270,9 @@ extern void (*my_sigtstp_cleanup)(void),
/* Executed before jump to shell */
(*my_sigtstp_restart)(void);
/* Executed when coming from shell */
extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
extern int my_umask_dir,
my_recived_signals, /* Signals we have got */
extern MYSQL_PLUGIN_IMPORT mode_t my_umask; /* Default creation mask */
extern mode_t my_umask_dir;
extern int my_recived_signals, /* Signals we have got */
my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
my_dont_interrupt; /* call remember_intr when set */
#ifdef _WIN32
@@ -651,7 +651,7 @@ extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file,
uint error_message_number, myf MyFlags);
extern File my_create(const char *FileName,int CreateFlags,
extern File my_create(const char *FileName, mode_t CreateFlags,
int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
@@ -659,7 +659,7 @@ extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename,
int createflags, int access_flags,
mode_t createflags, int access_flags,
myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
@@ -911,6 +911,7 @@ extern void my_free_lock(void *ptr);
#define my_free_lock(A) my_free((A))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
#define DEFAULT_ROOT_BLOCK_SIZE 1024
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
size_t block_size, size_t pre_alloc_size,
@@ -1143,6 +1144,9 @@ static inline my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(struct charset_info_st *cs);
extern void add_compiled_extra_collation(struct charset_info_st *cs);
extern my_bool add_alias_for_collation(LEX_CSTRING *collation_name,
LEX_CSTRING *alias,
uint alias_id);
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
char *to, size_t to_length,
const char *from, size_t length,

View File

@@ -0,0 +1,52 @@
/* Copyright (c) 2013, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#ifndef MYSQL_SERVICE_LOG_WARNINGS
#define MYSQL_SERVICE_LOG_WARNINGS
/**
@file
This service provides access to the log warning level for the
current session.
thd_log_warnings(thd)
@return thd->log_warnings
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct thd_log_warnings_service_st {
void *(*thd_log_warnings)(MYSQL_THD);
} *thd_log_warnings_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
# define thd_log_warnings(THD) thd_log_warnings_service->thd_log_warnings(THD)
#else
/**
MDL_context accessor
@param thd the current session
@return pointer to thd->mdl_context
*/
int thd_log_warnings(MYSQL_THD thd);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -2,6 +2,10 @@
# Bug #24200: Provide backwards compatibility mode for 4.x "rollback on
# transaction timeout"
#
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--disable_warnings
drop table if exists t1;
--enable_warnings

View File

@@ -91,12 +91,12 @@ while ($_rpl_server)
--echo **** SHOW BINLOG EVENTS on $CURRENT_CONNECTION ****
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
--echo binlog_name = '$binlog_name'
eval SHOW BINLOG EVENTS IN '$binlog_name';
eval SHOW BINLOG EVENTS IN '$binlog_name' LIMIT 200;
--echo
--echo **** SHOW RELAYLOG EVENTS on $CURRENT_CONNECTION ****
let $relaylog_name= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
--echo relaylog_name = '$relaylog_name'
eval SHOW RELAYLOG EVENTS IN '$relaylog_name';
eval SHOW RELAYLOG EVENTS IN '$relaylog_name' LIMIT 200;
--let $_rpl_is_first_server= 0

View File

@@ -454,9 +454,8 @@ sub mtr_report_stats ($$$$) {
# Print info about reporting the error
print
"The log files in var/log may give you some hint of what went wrong.\n\n",
"If you want to report this error, please read first ",
"the documentation\n",
"at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n\n";
"If you want to report this error, MariaDB's bug tracker is found at\n",
"https://jira.mariadb.org\n\n";
}
else

View File

@@ -198,9 +198,8 @@ sub mtr_report_stats ($) {
print
"The log files in var/log may give you some hint\n",
"of what went wrong.\n",
"If you want to report this error, please read first ",
"the documentation at\n",
"http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n";
"If you want to report this error, MariaDB's bug tracker is found at\n",
"https://jira.mariadb.org\n"
}
if (!$::opt_extern)
{

View File

@@ -1,2 +1,3 @@
FOUND 1 /\[ERROR\] SSL error: Unable to get certificate/ in errorlog.err
FOUND 1 /\[ERROR\] SSL error: Failed to set ciphers to use/ in errorlog.err
# restart

View File

@@ -19,4 +19,11 @@
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
# No valid cipher suites
--error 1
--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --ssl-cipher=ECDHE-ECDSA-FAKE-CIPHER:ECDHE-RSA-INVALID --log-error=$errorlog
--let SEARCH_PATTERN=\[ERROR\] SSL error: Failed to set ciphers to use
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
--source include/start_mysqld.inc

View File

@@ -2,6 +2,10 @@
-- source include/have_innodb.inc
-- source include/not_binlog_format_row.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--echo #
--echo # Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
--echo #

View File

@@ -96,6 +96,8 @@ drop view v1;
create table t1 (user_id char(64) character set utf8);
insert t1 values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17);
set @@tmp_table_size = 1024;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1024'
select count(distinct user_id) from t1;
count(distinct user_id)
17
@@ -125,6 +127,8 @@ insert into t1 values
( 2 , 13 ),
( 3 , 14 );
set @@tmp_table_size=1024;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1024'
select count(distinct a) from t1;
count(distinct a)
10

View File

@@ -456,43 +456,43 @@ select "foo" = "foo " collate latin1_test;
1
The following tests check that two-byte collation IDs work
select * from information_schema.collations where id>256 and is_compiled<>'Yes' order by id;
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
ascii2_general_nopad_ci ascii2 318 1
ascii2_bin2 ascii2 319 1
ascii2_general_ci ascii2 320 Yes 1
ascii2_bin ascii2 321 1
ascii2_general_inherited_ci ascii2 322 1
ascii2_general_inherited2_ci ascii2 323 1
ascii2_badly_inherited_ci ascii2 324 1
ascii2_nopad_bin ascii2 325 1
utf8mb4_test_ci utf8mb4 326 8
utf16_test_ci utf16 327 8
utf8mb4_test_400_ci utf8mb4 328 8
utf8mb4_test_520_nopad_ci utf8mb4 329 8
utf8mb4_uca1400_test01_as_ci utf8mb4 330 4
latin1_test latin1 331 1
latin1_test2 latin1 332 1
latin1_test2_cs latin1 333 1
latin1_swedish_nopad2_ci latin1 334 1
utf8mb3_bengali_standard_ci utf8mb3 336 8
utf8mb3_bengali_traditional_ci utf8mb3 337 8
utf8mb3_implicit_weights_ci utf8mb3 338 8
utf8mb3_phone_ci utf8mb3 352 8
utf8mb3_test_ci utf8mb3 353 8
utf8mb3_5624_1 utf8mb3 354 8
utf8mb3_5624_2 utf8mb3 355 8
utf8mb3_5624_3 utf8mb3 356 8
utf8mb3_5624_4 utf8mb3 357 8
ucs2_test_ci ucs2 358 8
ucs2_vn_ci ucs2 359 8
ucs2_5624_1 ucs2 360 8
utf8mb3_5624_5 utf8mb3 368 8
utf8mb3_5624_5_bad utf8mb3 369 8
utf8mb3_czech_test_w2 utf8mb3 370 4
utf8mb3_czech_test_nopad_w2 utf8mb3 371 4
utf8mb3_czech_test_bad_w2 utf8mb3 372 4
utf32_test_ci utf32 391 8
utf8mb3_maxuserid_ci utf8mb3 2047 8
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN COMMENT
ascii2_general_nopad_ci ascii2 318 1
ascii2_bin2 ascii2 319 1
ascii2_general_ci ascii2 320 Yes 1
ascii2_bin ascii2 321 1
ascii2_general_inherited_ci ascii2 322 1
ascii2_general_inherited2_ci ascii2 323 1
ascii2_badly_inherited_ci ascii2 324 1
ascii2_nopad_bin ascii2 325 1
utf8mb4_test_ci utf8mb4 326 8
utf16_test_ci utf16 327 8
utf8mb4_test_400_ci utf8mb4 328 8
utf8mb4_test_520_nopad_ci utf8mb4 329 8
utf8mb4_uca1400_test01_as_ci utf8mb4 330 4
latin1_test latin1 331 1 cp1252 West European
latin1_test2 latin1 332 1 cp1252 West European
latin1_test2_cs latin1 333 1 cp1252 West European
latin1_swedish_nopad2_ci latin1 334 1 cp1252 West European
utf8mb3_bengali_standard_ci utf8mb3 336 8
utf8mb3_bengali_traditional_ci utf8mb3 337 8
utf8mb3_implicit_weights_ci utf8mb3 338 8
utf8mb3_phone_ci utf8mb3 352 8
utf8mb3_test_ci utf8mb3 353 8
utf8mb3_5624_1 utf8mb3 354 8
utf8mb3_5624_2 utf8mb3 355 8
utf8mb3_5624_3 utf8mb3 356 8
utf8mb3_5624_4 utf8mb3 357 8
ucs2_test_ci ucs2 358 8
ucs2_vn_ci ucs2 359 8
ucs2_5624_1 ucs2 360 8
utf8mb3_5624_5 utf8mb3 368 8
utf8mb3_5624_5_bad utf8mb3 369 8
utf8mb3_czech_test_w2 utf8mb3 370 4
utf8mb3_czech_test_nopad_w2 utf8mb3 371 4
utf8mb3_czech_test_bad_w2 utf8mb3 372 4
utf32_test_ci utf32 391 8
utf8mb3_maxuserid_ci utf8mb3 2047 8
show collation like '%test%';
Collation Charset Id Default Compiled Sortlen
latin1_test latin1 331 1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,116 @@
-- source include/have_ucs2.inc
-- source include/have_utf8mb4.inc
-- source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Basic tests
#
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
where collation_name like "%0900%" order by collation_name;
select * from information_schema.COLLATIONS where collation_name like "%0900%";
SET NAMES utf8mb4;
CREATE TABLE t1 (c1 CHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin);
--source include/ctype_unicode_latin.inc
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_unicode_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_icelandic_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_latvian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_romanian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_slovenian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_polish_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_estonian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_spanish_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_swedish_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_turkish_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_czech_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_danish_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_lithuanian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_slovak_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_spanish2_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_roman_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_esperanto_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_hungarian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_mysql561_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_german2_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_unicode_520_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_vietnamese_ci;
DROP TABLE t1;
--echo #
--echo # MDEV-20912 Add support for utf8mb4_0900_* collations in MariaDB Server
--echo #
CREATE DATABASE db1 CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE db1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT COLLATE utf8mb4_0900_ai_ci;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_sv_0900_ai_ci;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP DATABASE db1;
USE test;
--echo #
--echo # CREATE TABLE - table level character set and collation
--echo #
CREATE DATABASE db1 CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE TABLE db1.t1 (a CHAR(1)) COLLATE utf8mb4_0900_ai_ci;
SHOW CREATE TABLE db1.t1;
ALTER TABLE db1.t1 modify a CHAR(1) COLLATE utf8mb4_sv_0900_ai_ci;
SHOW CREATE TABLE db1.t1;
DROP TABLE db1.t1;
CREATE TABLE db1.t1 (a CHAR(1)) COLLATE utf8mb4_sv_0900_ai_ci;
SHOW CREATE TABLE db1.t1;
DROP TABLE db1.t1;
CREATE TABLE db1.t1 (a CHAR(1)) CHARACTER SET DEFAULT COLLATE utf8mb4_0900_ai_ci;
SHOW CREATE TABLE db1.t1;
DROP TABLE db1.t1;
DROP DATABASE db1;
--echo #
--echo # Ensure that we can seamlessly compare and move between
--echo # utf8mb4_sv_0900_ai_ci and utf8mb4_uca1400_swedish_1400_nopad_ai_ci
--echo #
CREATE TABLE t1 (p int primary key auto_increment, a VARCHAR(10), key (a)) engine=innodb, COLLATE utf8mb4_sv_0900_ai_ci;
show create table t1;
CREATE TABLE t2 (p int primary key auto_increment, a VARCHAR(10), key(a)) engine=innodb, COLLATE utf8mb4_uca1400_swedish_nopad_ai_ci;
show create table t2;
insert into t1 (a) values ("hello"),("world");
insert into t2 (a) values ("hello"),("world");
explain select * from t1,t2 where t1.a=t2.a;
--echo # Check that alter table can convert between the character sets
alter table t1 modify a varchar(10) collate utf8mb4_uca1400_swedish_nopad_ai_ci, algorithm=nocopy;
show create table t1;
alter table t2 modify a varchar(10) collate utf8mb4_sv_0900_ai_ci, algorithm=nocopy;
show create table t2;
drop table t1,t2;
CREATE OR REPLACE TABLE t1 (p int primary key auto_increment, a VARCHAR(10), key (a)) engine=aria, COLLATE utf8mb4_sv_0900_ai_ci;
alter table t1 modify a varchar(10) collate utf8mb4_uca1400_swedish_nopad_ai_ci, algorithm=nocopy;
drop table t1;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
--echo #
--echo # Start of 10.10 tests
--echo #
--echo #
--echo # MDEV-30577 Case folding for uca1400 collations is not up to date
--echo #
SET NAMES utf8mb4 COLLATE utf8mb4_0900_ai_ci;
--source include/ctype_unicode_casefold_bmp.inc
--source include/ctype_unicode_casefold_supplementary.inc
--echo #
--echo # End of 11.4 tests
--echo #

View File

@@ -23590,6 +23590,60 @@ f a c
0 0 -1
DROP VIEW v;
DROP TABLE t1;
#
# MDEV-32395: update_depend_map_for_order: SEGV at
# /mariadb-11.3.0/sql/sql_select.cc:16583
#
create table t1 (c1 int);
insert into t1 values (1), (2);
create table t2 (c2 int);
insert into t2 values (1), (2);
create table t3 (c3 int);
insert into t3 values (1), (2);
set statement optimizer_switch='condition_pushdown_for_derived=off,condition_pushdown_for_subquery=off,condition_pushdown_from_having=off' for
select t1.c1 as a from t2, t1 where t1.c1=t2.c2
order by (select c3 from t3 group by a having a=2);
a
1
2
drop table t1, t2, t3;
# Test case 2
CREATE TABLE t1 ( x BOOLEAN NOT NULL );
INSERT INTO t1 ( x ) VALUES ( 1 ) ;
UPDATE t1 SET x = 1 WHERE x = 1 ;
INSERT INTO t1 ( x ) VALUES ( 1 ) , ( x IN ( SELECT x FROM ( SELECT ( SELECT EXISTS ( SELECT * FROM ( SELECT DISTINCT ( - CASE WHEN x = 1 THEN 1 ELSE x + 1 END >= x IS NOT NULL = 1 AND x = 1 ) OR x = x OR x = 'x' FROM t1 AS x GROUP BY x ) AS x WHERE 1 / x GROUP BY x HAVING ( 1 = 1 AND x = 1 ) ) FROM t1 GROUP BY EXISTS ( SELECT 1 ) ) FROM t1 UNION SELECT x FROM t1 ) AS x ) ) ;
DROP TABLE t1;
# Test case 3
CREATE TABLE t0 ( c6 INT , c21 INT ) ;
INSERT INTO t0 VALUES ( 55 , -95 ) , ( 9 , 90 ) ;
ALTER TABLE t0 ADD COLUMN c37 INT AFTER c6 ;
INSERT INTO t0 VALUES ( ) , ( ) ;
SELECT t0 . c6 AS c42 FROM ( SELECT t0 . c6 = TRIM( TRAILING FROM 96 ) SOUNDS LIKE CONVERT ( t0 . c6 , UNSIGNED ) >> PI ( ) AS c49 FROM t0 ) AS t1 JOIN t0 ON RTRIM ( - RAND ( -66 ) BETWEEN FIND_IN_SET ( 20 , UNHEX ( -80 ) IS NULL OR IF ( 85 , -83 , -113 ) ) AND -125 ) / EXP ( c21 ) = t1 . c49 ORDER BY c42 , ( c42 + ( SELECT c21 AS c61 FROM t0 WHERE t0 . c37 >= -19.601384 = RAND ( ) / TRIM( t0 . c21 FROM 'C@rG3D(#9*17(a.,rV' ) = -106 GROUP BY c21 , c42 HAVING c42 = -73 LIMIT 1 ) ) ;
c42
9
9
55
55
drop table t0;
#
# MDEV-32329 pushdown from having into where: Server crashes at sub_select
#
WITH RECURSIVE cte AS ( SELECT 1 as x UNION SELECT x FROM cte)
SELECT ( SELECT 1 FROM ( SELECT 1 FROM cte) dt GROUP BY x HAVING x= 1 )
FROM cte
GROUP BY 1 ;
( SELECT 1 FROM ( SELECT 1 FROM cte) dt GROUP BY x HAVING x= 1 )
1
# Test case 2
WITH
cte1 AS ( SELECT 1 as x UNION SELECT 1),
cte2 AS ( SELECT 1 as x UNION SELECT 1)
SELECT
( SELECT 1 FROM ( SELECT 1 FROM cte1) dt GROUP BY x HAVING x= 1 )
FROM cte2
GROUP BY 1 ;
( SELECT 1 FROM ( SELECT 1 FROM cte1) dt GROUP BY x HAVING x= 1 )
1
# End of 10.5 tests
#
# MDEV-28958: condition pushable into view after simplification

View File

@@ -4418,6 +4418,58 @@ SELECT * FROM v,t1 WHERE f = DEFAULT(c);
DROP VIEW v;
DROP TABLE t1;
--echo #
--echo # MDEV-32395: update_depend_map_for_order: SEGV at
--echo # /mariadb-11.3.0/sql/sql_select.cc:16583
--echo #
create table t1 (c1 int);
insert into t1 values (1), (2);
create table t2 (c2 int);
insert into t2 values (1), (2);
create table t3 (c3 int);
insert into t3 values (1), (2);
set statement optimizer_switch='condition_pushdown_for_derived=off,condition_pushdown_for_subquery=off,condition_pushdown_from_having=off' for
select t1.c1 as a from t2, t1 where t1.c1=t2.c2
order by (select c3 from t3 group by a having a=2);
drop table t1, t2, t3;
--echo # Test case 2
CREATE TABLE t1 ( x BOOLEAN NOT NULL );
INSERT INTO t1 ( x ) VALUES ( 1 ) ;
UPDATE t1 SET x = 1 WHERE x = 1 ;
INSERT INTO t1 ( x ) VALUES ( 1 ) , ( x IN ( SELECT x FROM ( SELECT ( SELECT EXISTS ( SELECT * FROM ( SELECT DISTINCT ( - CASE WHEN x = 1 THEN 1 ELSE x + 1 END >= x IS NOT NULL = 1 AND x = 1 ) OR x = x OR x = 'x' FROM t1 AS x GROUP BY x ) AS x WHERE 1 / x GROUP BY x HAVING ( 1 = 1 AND x = 1 ) ) FROM t1 GROUP BY EXISTS ( SELECT 1 ) ) FROM t1 UNION SELECT x FROM t1 ) AS x ) ) ;
DROP TABLE t1;
--echo # Test case 3
CREATE TABLE t0 ( c6 INT , c21 INT ) ;
INSERT INTO t0 VALUES ( 55 , -95 ) , ( 9 , 90 ) ;
ALTER TABLE t0 ADD COLUMN c37 INT AFTER c6 ;
INSERT INTO t0 VALUES ( ) , ( ) ;
SELECT t0 . c6 AS c42 FROM ( SELECT t0 . c6 = TRIM( TRAILING FROM 96 ) SOUNDS LIKE CONVERT ( t0 . c6 , UNSIGNED ) >> PI ( ) AS c49 FROM t0 ) AS t1 JOIN t0 ON RTRIM ( - RAND ( -66 ) BETWEEN FIND_IN_SET ( 20 , UNHEX ( -80 ) IS NULL OR IF ( 85 , -83 , -113 ) ) AND -125 ) / EXP ( c21 ) = t1 . c49 ORDER BY c42 , ( c42 + ( SELECT c21 AS c61 FROM t0 WHERE t0 . c37 >= -19.601384 = RAND ( ) / TRIM( t0 . c21 FROM 'C@rG3D(#9*17(a.,rV' ) = -106 GROUP BY c21 , c42 HAVING c42 = -73 LIMIT 1 ) ) ;
drop table t0;
--echo #
--echo # MDEV-32329 pushdown from having into where: Server crashes at sub_select
--echo #
WITH RECURSIVE cte AS ( SELECT 1 as x UNION SELECT x FROM cte)
SELECT ( SELECT 1 FROM ( SELECT 1 FROM cte) dt GROUP BY x HAVING x= 1 )
FROM cte
GROUP BY 1 ;
--echo # Test case 2
WITH
cte1 AS ( SELECT 1 as x UNION SELECT 1),
cte2 AS ( SELECT 1 as x UNION SELECT 1)
SELECT
( SELECT 1 FROM ( SELECT 1 FROM cte1) dt GROUP BY x HAVING x= 1 )
FROM cte2
GROUP BY 1 ;
--echo # End of 10.5 tests

View File

@@ -310,7 +310,7 @@ a char(2) NOT NULL DEFAULT '',
PRIMARY KEY (a)
) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t4 VALUES ('CD');
set @@tmp_table_size=8192;
set @@tmp_table_size=16384;
EXPLAIN
SELECT * FROM t3 AS tx JOIN t2 AS ty ON (tx.pk = ty.pk)
WHERE

View File

@@ -245,7 +245,7 @@ CREATE TABLE t4 (
) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t4 VALUES ('CD');
set @@tmp_table_size=8192;
set @@tmp_table_size=16384;
--replace_column 9 #
EXPLAIN

View File

@@ -2318,6 +2318,8 @@ INSERT INTO t3 VALUES ('Miami');
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch = 'derived_with_keys=on';
SET @@tmp_table_size=1024*4;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '4096'
explain SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 1

View File

@@ -1009,6 +1009,8 @@ DROP TABLE t1;
#
SET @tmp_table_size_save= @@tmp_table_size;
SET @@tmp_table_size= 1024;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1024'
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a+8 FROM t1;

View File

@@ -1,15 +1,12 @@
CREATE TABLE t1 (
a varchar(32) character set utf8 collate utf8_bin NOT NULL,
b varchar(32) character set utf8 collate utf8_bin NOT NULL )
a varchar(128) character set utf8 collate utf8_bin NOT NULL,
b varchar(128) character set utf8 collate utf8_bin NOT NULL )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
('AAAAAAAAAA','AAAAAAAAAA'), ('AAAAAAAAAB','AAAAAAAAAB '),
('AAAAAAAAAB','AAAAAAAAAB'), ('AAAAAAAAAC','AAAAAAAAAC'),
('AAAAAAAAAD','AAAAAAAAAD'), ('AAAAAAAAAE','AAAAAAAAAE'),
('AAAAAAAAAF','AAAAAAAAAF'), ('AAAAAAAAAG','AAAAAAAAAG'),
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
INSERT INTO t1
select concat(repeat("A", 50),char(32+mod(seq,31)),char(32+mod(seq,29))),
concat(repeat("A", 50),char(32+mod(seq,31)),char(32+mod(seq,29)))
from seq_1_to_128;
set tmp_table_size=16384;
SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,raise_error";
SELECT MAX(a) FROM t1 GROUP BY a,b;

View File

@@ -1,23 +1,20 @@
--source include/have_debug.inc
--source include/not_embedded.inc
--source include/have_sequence.inc
#
# Bug #28499: crash for grouping query when tmp_table_size is too small
#
CREATE TABLE t1 (
a varchar(32) character set utf8 collate utf8_bin NOT NULL,
b varchar(32) character set utf8 collate utf8_bin NOT NULL )
a varchar(128) character set utf8 collate utf8_bin NOT NULL,
b varchar(128) character set utf8 collate utf8_bin NOT NULL )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
('AAAAAAAAAA','AAAAAAAAAA'), ('AAAAAAAAAB','AAAAAAAAAB '),
('AAAAAAAAAB','AAAAAAAAAB'), ('AAAAAAAAAC','AAAAAAAAAC'),
('AAAAAAAAAD','AAAAAAAAAD'), ('AAAAAAAAAE','AAAAAAAAAE'),
('AAAAAAAAAF','AAAAAAAAAF'), ('AAAAAAAAAG','AAAAAAAAAG'),
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
INSERT INTO t1
select concat(repeat("A", 50),char(32+mod(seq,31)),char(32+mod(seq,29))),
concat(repeat("A", 50),char(32+mod(seq,31)),char(32+mod(seq,29)))
from seq_1_to_128;
set tmp_table_size=1024;
set tmp_table_size=16384;
# Set debug flag so an error is returned when
# tmp table in query is converted from heap to myisam

View File

@@ -287,3 +287,20 @@ SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT MAKE_SET(3,t,t) t2 FROM t1) sub;
c2
abcdefghi,abcdefghi-abcdefghi,abcdefghi
DROP TABLE t1;
# Start of 10.5 tests
#
# MDEV-13120 Wrong results with MAKE_SET() and subquery
#
CREATE TABLE t1 (a DATE, b DATETIME, c VARCHAR(8));
INSERT INTO t1 VALUES
('1996-03-06','1985-11-16 08:00:46','foo'),
('2028-08-26','1900-01-01 00:00:00','bar'),
('1973-05-04','1900-01-01 00:00:00','qux');
SELECT CONCAT_WS(' ', a, b, PASSWORD(c)) AS f FROM t1 GROUP BY f WITH ROLLUP;
f
1973-05-04 1900-01-01 00:00:00 *6D720C5AAB5096E70AA751206B45B484E5E0121F
1996-03-06 1985-11-16 08:00:46 *F3A2A51A9B0F2BE2468926B4132313728C250DBF
2028-08-26 1900-01-01 00:00:00 *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB
NULL
DROP TABLE t1;
# End of 10.5 tests

View File

@@ -265,3 +265,19 @@ CREATE TABLE t1 (t VARCHAR(10) CHARSET latin1);
INSERT INTO t1 VALUES('abcdefghi');
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT MAKE_SET(3,t,t) t2 FROM t1) sub;
DROP TABLE t1;
--echo # Start of 10.5 tests
--echo #
--echo # MDEV-13120 Wrong results with MAKE_SET() and subquery
--echo #
CREATE TABLE t1 (a DATE, b DATETIME, c VARCHAR(8));
INSERT INTO t1 VALUES
('1996-03-06','1985-11-16 08:00:46','foo'),
('2028-08-26','1900-01-01 00:00:00','bar'),
('1973-05-04','1900-01-01 00:00:00','qux');
SELECT CONCAT_WS(' ', a, b, PASSWORD(c)) AS f FROM t1 GROUP BY f WITH ROLLUP;
DROP TABLE t1;
--echo # End of 10.5 tests

View File

@@ -1,4 +1,3 @@
drop table if exists t1;
select floor(5.5),floor(-5.5);
floor(5.5) floor(-5.5)
5 -6
@@ -3726,5 +3725,17 @@ SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+
c1
NULL
#
# End of 10.5 tests
# MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers
#
set sql_mode=no_unsigned_subtraction;
select cast(0 as unsigned) - 1;
cast(0 as unsigned) - 1
-1
select 2-cast(3 as unsigned);
2-cast(3 as unsigned)
-1
select cast(1 as unsigned) - cast(2 as unsigned);
cast(1 as unsigned) - cast(2 as unsigned)
-1
set sql_mode=default;
# End of 10.5 tests

View File

@@ -4,10 +4,6 @@
--source include/default_charset.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
select floor(5.5),floor(-5.5);
explain extended select floor(5.5),floor(-5.5);
select ceiling(5.5),ceiling(-5.5);
@@ -1992,7 +1988,13 @@ SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1;
SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
--echo #
--echo # MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers
--echo #
set sql_mode=no_unsigned_subtraction;
select cast(0 as unsigned) - 1;
select 2-cast(3 as unsigned);
select cast(1 as unsigned) - cast(2 as unsigned);
set sql_mode=default;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@@ -5457,6 +5457,14 @@ CREATE TABLE t (f POINT, KEY(f));
DELETE FROM t WHERE f NOT IN (NULL,'x');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
DROP TABLE t;
#
# MDEV-31219 Assertion `fixed' failed in Item_func_hybrid_field_type / Frame_positional_cursor
#
CREATE TABLE t (a INT, b POINT);
INSERT INTO t VALUES (1,POINT(0,0)),(2,POINT(0,0));
SELECT NTH_VALUE(a,b) OVER () FROM t;
ERROR HY000: Illegal parameter data types point and bigint for operation '-'
DROP TABLE t;
# End of 10.5 tests
#
# Start of 11.5 tests

View File

@@ -3461,6 +3461,16 @@ CREATE TABLE t (f POINT, KEY(f));
DELETE FROM t WHERE f NOT IN (NULL,'x');
DROP TABLE t;
--echo #
--echo # MDEV-31219 Assertion `fixed' failed in Item_func_hybrid_field_type / Frame_positional_cursor
--echo #
CREATE TABLE t (a INT, b POINT);
INSERT INTO t VALUES (1,POINT(0,0)),(2,POINT(0,0));
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT NTH_VALUE(a,b) OVER () FROM t;
DROP TABLE t;
--echo # End of 10.5 tests
--echo #

View File

@@ -281,17 +281,17 @@ Charset Description Default collation Maxlen
latin1 cp1252 West European latin1_swedish_ci 1
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
latin1_german1_ci latin1 5 # 1
latin1_swedish_ci latin1 8 Yes # 1
latin1_danish_ci latin1 15 # 1
latin1_german2_ci latin1 31 # 2
latin1_bin latin1 47 # 1
latin1_general_ci latin1 48 # 1
latin1_general_cs latin1 49 # 1
latin1_spanish_ci latin1 94 # 1
latin1_swedish_nopad_ci latin1 1032 # 1
latin1_nopad_bin latin1 1071 # 1
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN COMMENT
latin1_german1_ci latin1 5 # 1 cp1252 West European
latin1_swedish_ci latin1 8 Yes # 1 cp1252 West European
latin1_danish_ci latin1 15 # 1 cp1252 West European
latin1_german2_ci latin1 31 # 2 cp1252 West European
latin1_bin latin1 47 # 1 cp1252 West European
latin1_general_ci latin1 48 # 1 cp1252 West European
latin1_general_cs latin1 49 # 1 cp1252 West European
latin1_spanish_ci latin1 94 # 1 cp1252 West European
latin1_swedish_nopad_ci latin1 1032 # 1
latin1_nopad_bin latin1 1071 # 1
SHOW COLLATION LIKE 'latin1%';
Collation Charset Id Default Compiled Sortlen
latin1_german1_ci latin1 5 # 1
@@ -1660,7 +1660,7 @@ SELECT *
FROM tables ta
JOIN collations co ON ( co.collation_name = ta.table_catalog )
JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN COMMENT CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
DROP TABLE test.t1;
SET max_heap_table_size = DEFAULT;
USE test;
@@ -2400,7 +2400,7 @@ drop database dummy;
USE test;
CREATE VIEW v AS SELECT table_schema AS object_schema, table_name AS object_name, table_type AS object_type FROM information_schema.tables ORDER BY object_schema;
SELECT * FROM v LIMIT ROWS EXAMINED 9;
ERROR HY000: Sort aborted:
ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED
DROP VIEW v;
#
# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset

View File

@@ -1,6 +1,10 @@
--source include/have_metadata_lock_info.inc
-- source include/have_innodb.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc

View File

@@ -883,76 +883,6 @@ INSERT INTO t1 SELECT a*2 FROM t1 ORDER BY a;
Warnings:
Warning 1264 Out of range value for column 'a' at row 4
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 (a) SELECT SUM(1);
INSERT INTO t1 (a, b) SELECT AVG(2), MIN(3);
INSERT INTO t1 (b) SELECT AVG('x') OVER ();
ERROR 22007: Truncated incorrect DOUBLE value: 'x'
INSERT INTO t1 SELECT MIN(7) OVER (), MAX(8) OVER();
SELECT * FROM t1;
a b
1 NULL
2 3
7 8
PREPARE stmt FROM 'INSERT INTO t1 (a) SELECT AVG(?)';
EXECUTE stmt USING 9;
EXECUTE stmt USING 10;
PREPARE stmt FROM 'INSERT INTO t1 SELECT MIN(?), MAX(?)';
EXECUTE stmt USING 11, 12;
EXECUTE stmt USING 13, 14;
DEALLOCATE PREPARE stmt;
SELECT * FROM t1;
a b
1 NULL
2 3
7 8
9 NULL
10 NULL
11 12
13 14
CREATE PROCEDURE p1(param_a INT, param_b INT)
BEGIN
INSERT INTO t1 SELECT MIN(param_a) OVER (), MAX(param_b);
END//
CALL p1(21, 22);
CALL p1(23, 24);
SELECT * FROM t1;
a b
1 NULL
2 3
7 8
9 NULL
10 NULL
11 12
13 14
21 22
23 24
CREATE TABLE t2 (
a DECIMAL UNIQUE CHECK (CASE 0 * 27302337.000000 WHEN 34 THEN
+ 'x' LIKE 'x' OR a NOT IN (-1 / TRUE ^ 2) ELSE 7105743.000000 END));
INSERT INTO t2 VALUES (90),( -1),(31152443.000000),(-32768),(NULL),(NULL);
INSERT INTO t2 SELECT AVG('x') OVER (
PARTITION BY ((NOT AVG(76698761.000000))) IS NOT NULL);
ERROR 22007: Truncated incorrect DOUBLE value: 'x'
INSERT IGNORE INTO t2 () VALUES (0),('x'),(3751286.000000),
('x'),((a = 'x' AND 0 AND 0));
Warnings:
Warning 1366 Incorrect decimal value: 'x' for column `test`.`t2`.`a` at row 2
Warning 1062 Duplicate entry '0' for key 'a'
Warning 1366 Incorrect decimal value: 'x' for column `test`.`t2`.`a` at row 4
Warning 1062 Duplicate entry '0' for key 'a'
Warning 1062 Duplicate entry '0' for key 'a'
INSERT INTO t2 VALUES (127);
INSERT INTO t2 SELECT -2147483648 END FROM t2 AS TEXT JOIN t2 JOIN t2 TABLES;
ERROR 23000: Duplicate entry '-2147483648' for key 'a'
ALTER TABLE t2 ADD (
b INT UNIQUE CHECK ((a = 'x' AND ((-(+(BINARY 49730460.000000)))) = 'x'
BETWEEN 'x' AND 'x')));
ERROR 22007: Truncated incorrect DECIMAL value: 'x'
UPDATE t2 SET a = -128 WHERE a IS NULL ORDER BY 78 IN ('x','x'),a;
ERROR 23000: Duplicate entry '-128' for key 'a'
DROP TABLE t1, t2;
DROP PROCEDURE p1;
# End of 10.2 test
#
# MDEV-28617: INSERT ... SELECT with redundant IN subquery in GROUP BY
@@ -1054,3 +984,52 @@ drop table t1, t2;
#
# End of 10.3 test
#
#
# MDEV-26427 MariaDB Server SEGV on INSERT .. SELECT
#
CREATE TABLE t1 (a int);
INSERT INTO t1 SELECT AVG(1);
SELECT * FROM t1;
a
1
INSERT INTO t1 SELECT MIN(2) OVER ();
SELECT * FROM t1;
a
1
2
CREATE VIEW v1 AS SELECT * FROM t1 ORDER BY a;
INSERT INTO v1 SELECT SUM(3);
SELECT * FROM v1;
a
1
2
3
INSERT INTO v1 SELECT * FROM v1;
SELECT * FROM t1;
a
1
1
2
2
3
3
INSERT INTO t1 SELECT * FROM v1;
SELECT * FROM t1;
a
1
1
1
1
2
2
2
2
3
3
3
3
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.5 test
#

View File

@@ -459,60 +459,6 @@ INSERT INTO t1 SELECT a*2 FROM t1 ORDER BY a;
DROP TABLE t1;
#
# MDEV-26427 MariaDB Server SEGV on INSERT .. SELECT
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 (a) SELECT SUM(1);
INSERT INTO t1 (a, b) SELECT AVG(2), MIN(3);
--error ER_TRUNCATED_WRONG_VALUE
INSERT INTO t1 (b) SELECT AVG('x') OVER ();
INSERT INTO t1 SELECT MIN(7) OVER (), MAX(8) OVER();
SELECT * FROM t1;
PREPARE stmt FROM 'INSERT INTO t1 (a) SELECT AVG(?)';
EXECUTE stmt USING 9;
EXECUTE stmt USING 10;
PREPARE stmt FROM 'INSERT INTO t1 SELECT MIN(?), MAX(?)';
EXECUTE stmt USING 11, 12;
EXECUTE stmt USING 13, 14;
DEALLOCATE PREPARE stmt;
SELECT * FROM t1;
DELIMITER //;
CREATE PROCEDURE p1(param_a INT, param_b INT)
BEGIN
INSERT INTO t1 SELECT MIN(param_a) OVER (), MAX(param_b);
END//
DELIMITER ;//
CALL p1(21, 22);
CALL p1(23, 24);
SELECT * FROM t1;
CREATE TABLE t2 (
a DECIMAL UNIQUE CHECK (CASE 0 * 27302337.000000 WHEN 34 THEN
+ 'x' LIKE 'x' OR a NOT IN (-1 / TRUE ^ 2) ELSE 7105743.000000 END));
INSERT INTO t2 VALUES (90),( -1),(31152443.000000),(-32768),(NULL),(NULL);
--error ER_TRUNCATED_WRONG_VALUE
INSERT INTO t2 SELECT AVG('x') OVER (
PARTITION BY ((NOT AVG(76698761.000000))) IS NOT NULL);
INSERT IGNORE INTO t2 () VALUES (0),('x'),(3751286.000000),
('x'),((a = 'x' AND 0 AND 0));
INSERT INTO t2 VALUES (127);
--error ER_DUP_ENTRY
INSERT INTO t2 SELECT -2147483648 END FROM t2 AS TEXT JOIN t2 JOIN t2 TABLES;
--error ER_TRUNCATED_WRONG_VALUE
ALTER TABLE t2 ADD (
b INT UNIQUE CHECK ((a = 'x' AND ((-(+(BINARY 49730460.000000)))) = 'x'
BETWEEN 'x' AND 'x')));
--error ER_DUP_ENTRY
UPDATE t2 SET a = -128 WHERE a IS NULL ORDER BY 78 IN ('x','x'),a;
DROP TABLE t1, t2;
DROP PROCEDURE p1;
--echo # End of 10.2 test
--echo #
@@ -613,3 +559,38 @@ drop table t1, t2;
--echo #
--echo # End of 10.3 test
--echo #
--echo #
--echo # MDEV-26427 MariaDB Server SEGV on INSERT .. SELECT
--echo #
CREATE TABLE t1 (a int);
INSERT INTO t1 SELECT AVG(1);
--sorted_result
SELECT * FROM t1;
INSERT INTO t1 SELECT MIN(2) OVER ();
--sorted_result
SELECT * FROM t1;
CREATE VIEW v1 AS SELECT * FROM t1 ORDER BY a;
INSERT INTO v1 SELECT SUM(3);
--sorted_result
SELECT * FROM v1;
INSERT INTO v1 SELECT * FROM v1;
--sorted_result
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM v1;
--sorted_result
SELECT * FROM t1;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # End of 10.5 test
--echo #

View File

@@ -602,7 +602,7 @@ select c1, c2 from t3 order by c2, c1 LIMIT ROWS EXAMINED 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 5 Using filesort
select c1, c2 from t3 order by c2, c1 LIMIT ROWS EXAMINED 2;
ERROR HY000: Sort aborted:
ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED
explain
select c1, c2 from t3i order by c2, c1 LIMIT ROWS EXAMINED 2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -618,7 +618,7 @@ select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3i index NULL it3j 8 NULL 5 Using index; Using filesort
select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2;
ERROR HY000: Sort aborted:
ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED
drop table t3,t3i;
=========================================================================
INSERT/DELETE/UPDATE
@@ -889,3 +889,46 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c2` = `test`.`t1`.`c1`
drop table t1,t2;
# End of 10.4 tests
#
# MDEV-35571: Connection hangs after query on a partitioned table with UNION and LIMIT ROWS EXAMINED
#
create table t1 (a int);
insert into t1 values (1), (2);
select * from t1 UNION ALL select * from t1 LIMIT ROWS EXAMINED 1;
a
1
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 1. The query result may be incomplete
select * from t1 UNION DISTINCT select * from t1 LIMIT ROWS EXAMINED 1;
a
1
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 1. The query result may be incomplete
DROP TABLE t1;
create table t1 (a int);
insert into t1 values (1), (2);
(select a from t1 UNION ALL select a from t1) order by a desc LIMIT ROWS EXAMINED 2;
a
1
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete
(select a from t1 UNION DISTINCT select a from t1) order by a desc LIMIT ROWS EXAMINED 2;
a
1
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 SELECT seq%25 FROM seq_1_to_100;
CREATE TABLE t2 (b INT, c INT, KEY(b)) PARTITION BY HASH(c) PARTITIONS 12;
INSERT INTO t2 SELECT seq, seq FROM seq_1_to_10;
SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) UNION ALL SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) LIMIT ROWS EXAMINED 100;
COUNT(*)
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 100. The query result may be incomplete
SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) UNION DISTINCT SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) LIMIT ROWS EXAMINED 100;
COUNT(*)
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 100. The query result may be incomplete
DROP TABLE t1, t2;
# End of 10.5 tests

View File

@@ -617,3 +617,44 @@ select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 2;
drop table t1,t2;
--echo # End of 10.4 tests
--echo #
--echo # MDEV-35571: Connection hangs after query on a partitioned table with UNION and LIMIT ROWS EXAMINED
--echo #
--source include/have_partition.inc
--source include/have_sequence.inc
# Simplified test
create table t1 (a int);
insert into t1 values (1), (2);
select * from t1 UNION ALL select * from t1 LIMIT ROWS EXAMINED 1;
# UNION DISTINCT produces the same result here. Note that this is not
# affected by the MDEV-35571 patch
select * from t1 UNION DISTINCT select * from t1 LIMIT ROWS EXAMINED 1;
DROP TABLE t1;
# Simplified test with order by
create table t1 (a int);
insert into t1 values (1), (2);
(select a from t1 UNION ALL select a from t1) order by a desc LIMIT ROWS EXAMINED 2;
# UNION DISTINCT produces the same result with order by desc. Note
# that this is not affected by the MDEV-35571 patch
(select a from t1 UNION DISTINCT select a from t1) order by a desc LIMIT ROWS EXAMINED 2;
DROP TABLE t1;
# Original test
CREATE TABLE t1 (a INT);
INSERT INTO t1 SELECT seq%25 FROM seq_1_to_100;
CREATE TABLE t2 (b INT, c INT, KEY(b)) PARTITION BY HASH(c) PARTITIONS 12;
INSERT INTO t2 SELECT seq, seq FROM seq_1_to_10;
SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) UNION ALL SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) LIMIT ROWS EXAMINED 100;
# UNION DISTINCT produces the same result here. Note that this is not
# affected by the MDEV-35571 patch
SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) UNION DISTINCT SELECT COUNT(*) FROM t1 JOIN t2 ON (b = a) LIMIT ROWS EXAMINED 100;
DROP TABLE t1, t2;
--echo # End of 10.5 tests

View File

@@ -213,6 +213,23 @@ use `a
b`;
SET timestamp=1234567890;
select count(*) from mysql.global_priv where length(priv)>2
#
# MDEV-31366 Assertion `thd->start_time' failed in bool LOGGER::slow_log_print(THD*, const char*, size_t, ulonglong)
#
TRUNCATE mysql.slow_log;
SET global log_output='TABLE';
SET timestamp=0.99;
SET long_query_time=0.00001;
SELECT SLEEP(0.1);
SLEEP(0.1)
0
SELECT COUNT(*)>0 AS c1 FROM mysql.slow_log;
c1
1
SET global log_output=default;
SET timestamp=default;
SET long_query_time=default;
TRUNCATE mysql.slow_log;
# End of 10.5 tests
#
# MDEV-34251 Conditional jump or move depends on uninitialised value in

View File

@@ -225,6 +225,21 @@ let SEARCH_PATTERN= use \`a\n.*2;
let SEARCH_OUTPUT=matches;
source include/search_pattern_in_file.inc;
--echo #
--echo # MDEV-31366 Assertion `thd->start_time' failed in bool LOGGER::slow_log_print(THD*, const char*, size_t, ulonglong)
--echo #
TRUNCATE mysql.slow_log;
SET global log_output='TABLE';
SET timestamp=0.99;
SET long_query_time=0.00001;
SELECT SLEEP(0.1);
SELECT COUNT(*)>0 AS c1 FROM mysql.slow_log;
SET global log_output=default;
SET timestamp=default;
SET long_query_time=default;
TRUNCATE mysql.slow_log;
--echo # End of 10.5 tests
--echo #

View File

@@ -275,6 +275,42 @@ SELECT @@general_log_file = @my_glf;
@@general_log_file = @my_glf
1
SET GLOBAL general_log_file = @old_general_log_file;
#
# MDEV-35720 Add query_time to statistics
#
connect con2,localhost,root,,;
set @s1=(select variable_value from information_schema.session_status where
variable_name='query_time');
select sleep(3) into @a;
set @s2=(select variable_value from information_schema.session_status where
variable_name='query_time');
set @s3=(select variable_value from information_schema.global_status where
variable_name='query_time');
select @s1 >= 0.00 and @s1 <= 2.00 as "should be true";
should be true
1
select @s2 >= 2.00 and @s2 < 10.00 as "should be true";
should be true
1
select @s3 >= 3.00 as "should be true";
should be true
1
disconnect con2;
connection default;
create procedure p1()
begin
select sleep(1) into @a;
select sleep(2) into @a;
end|
connect con2,localhost,root,,;
call p1();
set @s1=(select variable_value from information_schema.session_status where
variable_name='query_time');
select @s1 > 2.00 and @s1 < 10.00 as "should be true";
should be true
1
disconnect con2;
connection default;
disconnect con1;
connection default;
SET GLOBAL long_query_time = @save_long_query_time;

View File

@@ -321,6 +321,45 @@ SET GLOBAL general_log_file = @old_general_log_file;
--enable_ps_protocol
--echo #
--echo # MDEV-35720 Add query_time to statistics
--echo #
connect (con2,localhost,root,,);
set @s1=(select variable_value from information_schema.session_status where
variable_name='query_time');
select sleep(3) into @a;
set @s2=(select variable_value from information_schema.session_status where
variable_name='query_time');
set @s3=(select variable_value from information_schema.global_status where
variable_name='query_time');
select @s1 >= 0.00 and @s1 <= 2.00 as "should be true";
select @s2 >= 2.00 and @s2 < 10.00 as "should be true";
select @s3 >= 3.00 as "should be true";
# select @s1,@s2,@s3;
disconnect con2;
connection default;
delimiter |;
create procedure p1()
begin
select sleep(1) into @a;
select sleep(2) into @a;
end|
delimiter ;|
connect (con2,localhost,root,,);
call p1();
set @s1=(select variable_value from information_schema.session_status where
variable_name='query_time');
select @s1 > 2.00 and @s1 < 10.00 as "should be true";
# select @s1;
disconnect con2;
connection default;
#
# Cleanup
#

View File

@@ -2,6 +2,10 @@
--source include/have_partition.inc
--source include/have_sequence.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--echo #
--echo # MDEV-18707 Server crash in my_hash_sort_bin, ASAN heap-use-after-free in Field::is_null, server hang, corrupted double-linked list
--echo #

View File

@@ -90,13 +90,11 @@ table->field[0]->offset = 1
table->field[0]->field_length = 10
table->field[0]->null_pos wrt to record 0 = 0
table->field[0]->null_bit_pos = 1
table->field[1]->field_name DB_ROW_HASH_1
table->field[1]->offset = 11
table->field[1]->field_length = 8
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 2
SET debug_dbug="";
drop table t1;
SET debug_dbug="d,print_long_unique_internal_state";
@@ -182,37 +180,31 @@ table->field[0]->offset = 1
table->field[0]->field_length = 10
table->field[0]->null_pos wrt to record 0 = 0
table->field[0]->null_bit_pos = 1
table->field[1]->field_name b
table->field[1]->offset = 11
table->field[1]->field_length = 10
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 2
table->field[2]->field_name c
table->field[2]->offset = 21
table->field[2]->field_length = 10
table->field[2]->null_pos wrt to record 0 = 0
table->field[2]->null_bit_pos = 4
table->field[3]->field_name DB_ROW_HASH_1
table->field[3]->offset = 31
table->field[3]->field_length = 8
table->field[3]->null_pos wrt to record 0 = 0
table->field[3]->null_bit_pos = 8
table->field[4]->field_name DB_ROW_HASH_2
table->field[4]->offset = 39
table->field[4]->field_length = 8
table->field[4]->null_pos wrt to record 0 = 0
table->field[4]->null_bit_pos = 16
table->field[5]->field_name DB_ROW_HASH_3
table->field[5]->offset = 47
table->field[5]->field_length = 8
table->field[5]->null_pos wrt to record 0 = 0
table->field[5]->null_bit_pos = 32
SET debug_dbug="";
drop table t1;
SET debug_dbug="d,print_long_unique_internal_state";
@@ -290,37 +282,31 @@ table->field[0]->offset = 1
table->field[0]->field_length = 10
table->field[0]->null_pos wrt to record 0 = 0
table->field[0]->null_bit_pos = 1
table->field[1]->field_name b
table->field[1]->offset = 11
table->field[1]->field_length = 10
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 2
table->field[2]->field_name c
table->field[2]->offset = 21
table->field[2]->field_length = 10
table->field[2]->null_pos wrt to record 0 = 0
table->field[2]->null_bit_pos = 4
table->field[3]->field_name d
table->field[3]->offset = 31
table->field[3]->field_length = 10
table->field[3]->null_pos wrt to record 0 = 0
table->field[3]->null_bit_pos = 8
table->field[4]->field_name DB_ROW_HASH_1
table->field[4]->offset = 41
table->field[4]->field_length = 8
table->field[4]->null_pos wrt to record 0 = 0
table->field[4]->null_bit_pos = 16
table->field[5]->field_name DB_ROW_HASH_2
table->field[5]->offset = 49
table->field[5]->field_length = 8
table->field[5]->null_pos wrt to record 0 = 0
table->field[5]->null_bit_pos = 32
SET debug_dbug="";
drop table t1;
SET debug_dbug="d,print_long_unique_internal_state";
@@ -406,31 +392,26 @@ table->field[0]->offset = 1
table->field[0]->field_length = 4
table->field[0]->null_pos wrt to record 0 = -1
table->field[0]->null_bit_pos = 0
table->field[1]->field_name b
table->field[1]->offset = 5
table->field[1]->field_length = 10
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 1
table->field[2]->field_name c
table->field[2]->offset = 15
table->field[2]->field_length = 10
table->field[2]->null_pos wrt to record 0 = -1
table->field[2]->null_bit_pos = 0
table->field[3]->field_name DB_ROW_HASH_1
table->field[3]->offset = 25
table->field[3]->field_length = 8
table->field[3]->null_pos wrt to record 0 = 0
table->field[3]->null_bit_pos = 2
table->field[4]->field_name DB_ROW_HASH_2
table->field[4]->offset = 33
table->field[4]->field_length = 8
table->field[4]->null_pos wrt to record 0 = -1
table->field[4]->null_bit_pos = 0
SET debug_dbug="";
drop table t1;
##Using hash
@@ -487,25 +468,21 @@ table->field[0]->offset = 1
table->field[0]->field_length = 4
table->field[0]->null_pos wrt to record 0 = 0
table->field[0]->null_bit_pos = 2
table->field[1]->field_name b
table->field[1]->offset = 5
table->field[1]->field_length = 4
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 4
table->field[2]->field_name c
table->field[2]->offset = 9
table->field[2]->field_length = 4
table->field[2]->null_pos wrt to record 0 = 0
table->field[2]->null_bit_pos = 8
table->field[3]->field_name DB_ROW_HASH_1
table->field[3]->offset = 13
table->field[3]->field_length = 8
table->field[3]->null_pos wrt to record 0 = 0
table->field[3]->null_bit_pos = 16
SET debug_dbug="";
drop table t1;
##Using hash but with memory engine so no long unique column
@@ -562,18 +539,15 @@ table->field[0]->offset = 1
table->field[0]->field_length = 4
table->field[0]->null_pos wrt to record 0 = 0
table->field[0]->null_bit_pos = 2
table->field[1]->field_name b
table->field[1]->offset = 5
table->field[1]->field_length = 4
table->field[1]->null_pos wrt to record 0 = 0
table->field[1]->null_bit_pos = 4
table->field[2]->field_name c
table->field[2]->offset = 9
table->field[2]->field_length = 4
table->field[2]->null_pos wrt to record 0 = 0
table->field[2]->null_bit_pos = 8
SET debug_dbug="";
drop table t1;

View File

@@ -0,0 +1,8 @@
select * from information_schema.processlist where id=0;
should be true
1
should be true
1
show global status like "max_memory_used";
Variable_name Value
Max_memory_used NULL

View File

@@ -0,0 +1,20 @@
#
# Added status variable "Max_memory_used" to SHOW STATUS
#
let $l1=`show status like "max_memory_used"`;
--disable_result_log
select * from information_schema.processlist where id=0;
--enable_result_log
let $l2=`show status like "max_memory_used"`;
--disable_query_log
eval SET @l1= SUBSTRING_INDEX('$l1', ' ', -1);
eval SET @l2= SUBSTRING_INDEX('$l2', ' ', -1);
eval select @l1 > 10000 as "should be true";
eval select @l2+0 > @l1+0 as "should be true";
--enable_query_log
# global max_memory should be NULL as we cannot calculate this
show global status like "max_memory_used";

View File

@@ -1301,6 +1301,52 @@ ERROR: Bad syntax in rewrite-db. Expected syntax is FROM->TO.
ERROR: Bad syntax in rewrite-db. Expected syntax is FROM->TO.
ERROR: Bad syntax in rewrite-db. Expected syntax is FROM->TO.
#
# MDEV-31761: mariadb-binlog prints fractional timestamp part incorrectly
#
SET SESSION binlog_format= MIXED;
RESET MASTER;
SET time_zone= '+02:00';
CREATE TABLE t (a INT,
b TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
set SESSION timestamp= 1689978980.012345;
INSERT INTO t (a) VALUES (1);
SELECT * from t;
a b
1 2023-07-22 00:36:20.012345
FLUSH BINARY LOGS;
SET SESSION timestamp= 1689978980.567890;
SET SESSION binlog_format= ROW;
UPDATE t SET a = 2;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
DROP TABLE t;
SELECT * FROM t;
a b
1 2023-07-22 00:36:20.012345
SELECT * FROM t;
a b
2 2023-07-22 00:36:20.567890
DROP TABLE t;
SET time_zone= default;
#
# MDEV-24959: ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)
#
SET SESSION binlog_format= ROW;
SET SESSION binlog_row_image= MINIMAL;
RESET MASTER;
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0 PRIMARY KEY);
REPLACE INTO t1 () VALUES (),();
DROP TABLE t1;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
SET SESSION binlog_row_image= default;
FOUND 1 /Number of rows: 2/ in mdev24959_1.txt
FOUND 1 /DROP TABLE/ in mdev24959_1.txt
FOUND 1 /Number of rows: 2/ in mdev24959_2.txt
FOUND 1 /DROP TABLE/ in mdev24959_2.txt
FOUND 1 /INSERT INTO .* VALUES/ in mdev24959_2.txt
FOUND 1 /SET /[*] no columns [*]// in mdev24959_2.txt
#
# MDEV-33239: mysqlbinlog always stops at timestamp 0xffffffff
#
RESET MASTER;

View File

@@ -641,6 +641,85 @@ FLUSH LOGS;
--exec $MYSQL_BINLOG --rewrite-db=" test -> foo " --short-form $MYSQLD_DATADIR/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
--echo #
--echo # MDEV-31761: mariadb-binlog prints fractional timestamp part incorrectly
--echo #
SET SESSION binlog_format= MIXED;
RESET MASTER;
SET time_zone= '+02:00';
CREATE TABLE t (a INT,
b TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
set SESSION timestamp= 1689978980.012345;
INSERT INTO t (a) VALUES (1);
SELECT * from t;
FLUSH BINARY LOGS;
SET SESSION timestamp= 1689978980.567890;
SET SESSION binlog_format= ROW;
UPDATE t SET a = 2;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
# Replay to see that timestamps are applied correctly.
# The bug was that leading zeros on the fractional part were not included in
# the mysqlbinlog output, so 1689978980.012345 was applied as 1689978980.12345.
DROP TABLE t;
--let $datadir= `select @@datadir`
--exec $MYSQL_BINLOG $datadir/master-bin.000001 | $MYSQL test
SELECT * FROM t;
--exec $MYSQL_BINLOG $datadir/master-bin.000002 | $MYSQL test
SELECT * FROM t;
DROP TABLE t;
SET time_zone= default;
--echo #
--echo # MDEV-24959: ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)
--echo #
SET SESSION binlog_format= ROW;
SET SESSION binlog_row_image= MINIMAL;
RESET MASTER;
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0 PRIMARY KEY);
REPLACE INTO t1 () VALUES (),();
DROP TABLE t1;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
SET SESSION binlog_row_image= default;
--exec $MYSQL_BINLOG --base64-output=decode-rows $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mdev24959_1.txt
--exec $MYSQL_BINLOG --base64-output=decode-rows --verbose $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mdev24959_2.txt
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mdev24959_1.txt
--let SEARCH_ABORT= NOT FOUND
--let SEARCH_PATTERN= Number of rows: 2
--source include/search_pattern_in_file.inc
# There was a bug that mysqlbinlog would get an error while decoding the
# update rows event with no after image and abort the dump; test that now
# the dump is complete and includes the final DROP TABLE.
--let SEARCH_PATTERN= DROP TABLE
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mdev24959_2.txt
--let SEARCH_PATTERN= Number of rows: 2
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= DROP TABLE
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= INSERT INTO .* VALUES
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= SET /[*] no columns [*]/
--source include/search_pattern_in_file.inc
--remove_file $MYSQLTEST_VARDIR/tmp/mdev24959_1.txt
--remove_file $MYSQLTEST_VARDIR/tmp/mdev24959_2.txt
--echo #
--echo # MDEV-33239: mysqlbinlog always stops at timestamp 0xffffffff
--echo #

View File

@@ -6,7 +6,7 @@ flush tables;
--let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --lower-case-table-names=1 --help --verbose
--exec $MYSQLD_CMD $args > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err
--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* //
--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n//
--cat_file $MYSQL_TMP_DIR/mysqld--help2.err
--echo #
@@ -14,7 +14,7 @@ flush tables;
--echo #
--exec $MYSQLD_CMD $args --datadir=$MYSQL_TMP_DIR/help > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err
--replace_regex /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* //
--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n//
--cat_file $MYSQL_TMP_DIR/mysqld--help2.err
--echo #
@@ -23,7 +23,7 @@ flush tables;
--mkdir $MYSQL_TMP_DIR/help
--exec $MYSQLD_CMD $args --datadir=$MYSQL_TMP_DIR/help > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err
--replace_regex /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* //
--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n//
--cat_file $MYSQL_TMP_DIR/mysqld--help2.err
--list_files $MYSQL_TMP_DIR/help

View File

@@ -1950,14 +1950,14 @@ profiling-history-size 15
progress-report-time 5
protocol-version 10
proxy-protocol-networks
query-alloc-block-size 16384
query-alloc-block-size 32768
query-cache-limit 1048576
query-cache-min-res-unit 4096
query-cache-size 1048576
query-cache-strip-comments FALSE
query-cache-type OFF
query-cache-wlock-invalidate FALSE
query-prealloc-size 24576
query-prealloc-size 32768
range-alloc-block-size 4096
read-binlog-speed-limit 0
read-buffer-size 131072

View File

@@ -4460,6 +4460,8 @@ CREATE TABLE t1(a VARCHAR(1027), b INT);
INSERT INTO t1 SELECT seq, seq from seq_1_to_34;
SET @save_tmp_memory_table_size= @@tmp_memory_table_size;
SET tmp_memory_table_size= 1056*2;
Warnings:
Warning 1292 Truncated incorrect tmp_memory_table_size value: '2112'
SELECT COUNT(DISTINCT a) FROM t1;
COUNT(DISTINCT a)
34

View File

@@ -2859,6 +2859,26 @@ id select_type table type possible_keys key key_len ref rows Extra
set optimizer_switch=@tmp_os;
drop table t1,t2,t3;
#
# MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE
#
create table t (c int)
partition by list (1 div c) (
partition p0 values in (null),
partition p values in (1));
insert ignore into t values (0), (1), (0);
Warnings:
Warning 1365 Division by 0
Warning 1365 Division by 0
update t set c= 2;
ERROR HY000: Table has no partition for value 0
update ignore t set c= 3;
select * from t;
c
0
0
1
drop table t;
#
# MDEV-32388 MSAN / Valgrind errors in
# Item_func_like::get_mm_leaf upon query from partitioned table
#

View File

@@ -3072,6 +3072,22 @@ set optimizer_switch=@tmp_os;
drop table t1,t2,t3;
--echo #
--echo # MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE
--echo #
create table t (c int)
partition by list (1 div c) (
partition p0 values in (null),
partition p values in (1));
insert ignore into t values (0), (1), (0);
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
update t set c= 2;
--disable_warnings
update ignore t set c= 3;
--enable_warnings
select * from t;
drop table t;
--echo #
--echo # MDEV-32388 MSAN / Valgrind errors in

View File

@@ -5,6 +5,9 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
call mtr.add_suppression("InnoDB: Table .* does not exist in the InnoDB internal data dictionary .*");
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--echo #
--echo # Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB,

View File

@@ -191,3 +191,58 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '+ -><()~*:""&|'
SET @@sort_buffer_size=DEFAULT;
End of 5.0 tests.
# Start of 10.5 tests
#
# MDEV-25593 Assertion `0' failed in Type_handler_temporal_result::Item_get_date on double EXECUTE
#
SET time_zone='+00:00';
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
PREPARE stmt FROM 'SELECT ? AS c1';
EXECUTE stmt USING current_timestamp;
c1
2001-01-01 10:20:30
EXECUTE stmt USING @unknown;
c1
NULL
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT ? AS c1 FROM DUAL';
EXECUTE stmt USING current_time;
c1
10:20:30
EXECUTE stmt USING DEFAULT;
c1
NULL
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT ? AS c1 FROM DUAL';
EXECUTE stmt USING current_time;
c1
10:20:30
EXECUTE stmt USING IGNORE;
c1
NULL
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM "SELECT DATE('') between''AND ? AS c1";
EXECUTE stmt USING current_time;
c1
1
Warnings:
Warning 1292 Truncated incorrect datetime value: ''
Warning 1292 Truncated incorrect datetime value: ''
EXECUTE stmt USING @unknown;
c1
NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: ''
Warning 1292 Truncated incorrect datetime value: ''
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT CONCAT(UNIX_TIMESTAMP(?)) AS c1';
EXECUTE stmt USING CURRENT_TIMESTAMP;
c1
978344430
EXECUTE stmt USING @unknown;
c1
NULL
DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
# End of 10.5 tests

View File

@@ -217,3 +217,41 @@ SELECT LEFT("12345", @@ft_boolean_syntax);
SET @@sort_buffer_size=DEFAULT;
--echo End of 5.0 tests.
--echo # Start of 10.5 tests
--echo #
--echo # MDEV-25593 Assertion `0' failed in Type_handler_temporal_result::Item_get_date on double EXECUTE
--echo #
SET time_zone='+00:00';
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
PREPARE stmt FROM 'SELECT ? AS c1';
EXECUTE stmt USING current_timestamp;
EXECUTE stmt USING @unknown;
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT ? AS c1 FROM DUAL';
EXECUTE stmt USING current_time;
EXECUTE stmt USING DEFAULT;
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT ? AS c1 FROM DUAL';
EXECUTE stmt USING current_time;
EXECUTE stmt USING IGNORE;
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM "SELECT DATE('') between''AND ? AS c1";
EXECUTE stmt USING current_time;
EXECUTE stmt USING @unknown;
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT CONCAT(UNIX_TIMESTAMP(?)) AS c1';
EXECUTE stmt USING CURRENT_TIMESTAMP;
EXECUTE stmt USING @unknown;
DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
--echo # End of 10.5 tests

View File

@@ -2037,7 +2037,7 @@ SUCCESS
execute stmt;
Warnings:
Note 1050 Table 't2' already exists
call p_verify_reprepare_count(1);
call p_verify_reprepare_count(0);
SUCCESS
select * from t2;

View File

@@ -1688,7 +1688,7 @@ drop table t2;
execute stmt;
call p_verify_reprepare_count(0);
execute stmt;
call p_verify_reprepare_count(1);
call p_verify_reprepare_count(0);
select * from t2;
execute stmt;
call p_verify_reprepare_count(0);

View File

@@ -4,6 +4,10 @@
--source include/have_sequence.inc
--source include/innodb_stable_estimates.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
SET @save_stats_persistent=@@GLOBAL.innodb_stats_persistent;

View File

@@ -13,10 +13,11 @@ LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`;
LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`;
--disable_ps2_protocol
--disable_cursor_protocol
#create the file
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp' FROM t1;
--enable_cursor_protocol
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
show global variables like 'secure_file_priv';
@@ -52,6 +53,7 @@ eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
--error ER_OPTION_PREVENTS_STATEMENT
eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1;
--disable_cursor_protocol
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
--error ER_OPTION_PREVENTS_STATEMENT
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp' FROM t1;
@@ -67,6 +69,7 @@ eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp' FROM t1;
--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp' FROM t1;
--enable_cursor_protocol
--error 0,1
--remove_file $MYSQL_TMP_DIR/B11764517.tmp;

View File

@@ -1,5 +1,5 @@
--- mysql-test/main/select.result 2023-01-31 09:30:58.151377805 +0100
+++ mysql-test/main/select.reject 2023-02-01 13:44:11.026958614 +0100
--- mysql-test/main/select.result
+++ mysql-test/main/select.reject
@@ -5661,6 +5661,8 @@
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1

View File

@@ -1,5 +1,5 @@
--- mysql-test/main/select_jcl6.result 2023-01-31 09:30:58.151377805 +0100
+++ mysql-test/main/select_jcl6.reject 2023-02-01 13:44:10.722958771 +0100
--- mysql-test/main/select_jcl6.result
+++ mysql-test/main/select_jcl6.reject
@@ -5672,6 +5672,8 @@
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1

View File

@@ -1,5 +1,5 @@
--- mysql-test/main/select_pkeycache.result 2023-01-31 09:30:58.151377805 +0100
+++ mysql-test/main/select_pkeycache.reject 2023-02-01 13:43:21.742985365 +0100
--- mysql-test/main/select_pkeycache.result
+++ mysql-test/main/select_pkeycache.reject
@@ -5661,6 +5661,8 @@
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1

View File

@@ -30,6 +30,25 @@ Socket
/tmp/1234567890_1234567890_1234567890_1234567890_1234567890_1234567890.sock
DROP SERVER s1;
#
# MDEV-33783 CREATE SERVER segfaults on wrong mysql.servers
#
create server s1 foreign data wrapper foo options(user 'a');
alter server s1 options(host 'server.example.org');
rename table mysql.servers to mysql.servers_save;
create table mysql.servers (x int);
alter server s1 options(host 'server.example.org');
ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: s1
create server s2 foreign data wrapper foo options(user 'a');
ERROR HY000: Can't read record in system table
drop table mysql.servers;
rename table mysql.servers_save to mysql.servers;
drop server s1;
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET '/tmp/1234567890_1234567890_1234567890_1234567890_1234567890_1234567890.sock');
SELECT Socket FROM mysql.servers where Server_name = 's1';
Socket
/tmp/1234567890_1234567890_1234567890_1234567890_1234567890_1234567890.sock
DROP SERVER s1;
#
# MDEV-34716 - Arbitrary OPTIONS for CREATE SERVER
# MDEV-15696 - SHOW CREATE SERVER
#

View File

@@ -27,6 +27,25 @@ CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET '/tmp/1234567890_1234
SELECT Socket FROM mysql.servers where Server_name = 's1';
DROP SERVER s1;
--echo #
--echo # MDEV-33783 CREATE SERVER segfaults on wrong mysql.servers
--echo #
create server s1 foreign data wrapper foo options(user 'a');
alter server s1 options(host 'server.example.org');
rename table mysql.servers to mysql.servers_save;
create table mysql.servers (x int);
--error ER_FOREIGN_SERVER_DOESNT_EXIST
alter server s1 options(host 'server.example.org');
--error ER_CANT_FIND_SYSTEM_REC
create server s2 foreign data wrapper foo options(user 'a');
drop table mysql.servers;
rename table mysql.servers_save to mysql.servers;
drop server s1;
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET '/tmp/1234567890_1234567890_1234567890_1234567890_1234567890_1234567890.sock');
SELECT Socket FROM mysql.servers where Server_name = 's1';
DROP SERVER s1;
--echo #
--echo # MDEV-34716 - Arbitrary OPTIONS for CREATE SERVER
--echo # MDEV-15696 - SHOW CREATE SERVER

View File

@@ -1177,10 +1177,8 @@ select 1 union all select 2 union all select 3 union select 4;
3
4
# test with limited resource
set @@max_heap_table_size= 1024;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '1024'
set @@tmp_table_size= 1024;
set @@max_heap_table_size= 16384;
set @@tmp_table_size= 16384;
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(0,0);
insert into t1 select * from t1;

View File

@@ -458,8 +458,8 @@ select 1 union all select 2 union all select 3 union select 4;
--echo # test with limited resource
set @@max_heap_table_size= 1024;
set @@tmp_table_size= 1024;
set @@max_heap_table_size= 16384;
set @@tmp_table_size= 16384;
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(0,0);

View File

@@ -68,3 +68,6 @@ disconnect ssl_con;
connection default;
call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
FOUND 2 /TLSv1.0 and TLSv1.1 are insecure/ in mysqld.1.err
# restart: --ssl-cipher=ECDHE-ECDSA-AES128-GCM-SHA256
Variable_name Value
Ssl_version

View File

@@ -112,3 +112,20 @@ call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= TLSv1.0 and TLSv1.1 are insecure
--source include/search_pattern_in_file.inc
#
# Server is configured with ciphers that are not compatible with the server certificate (std_data/cacert.pem is RSA)
#
let $restart_parameters=--ssl-cipher=ECDHE-ECDSA-AES128-GCM-SHA256;
source include/restart_mysqld.inc;
# Connections are rejected as client attempts tls by default
--error 1
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'ssl_version'"
# Connections are rejected if client explicitly specifies tls
--error 1
--exec $MYSQL --host=localhost --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_version'"
# Connections can be made with --skip-ssl
--exec $MYSQL --host=localhost --skip-ssl -e "SHOW STATUS LIKE 'ssl_version'"

View File

@@ -188,7 +188,7 @@ INSERT INTO t1 VALUES ('this'),('is'),('just'),('a'),('filling'),('for'),(REPEAT
set @@global.max_tmp_total_space_usage=2*1024*1024;
SET max_tmp_session_space_usage= 1024*1024, max_heap_table_size= 4*1024*1024;
SELECT DISTINCT a, seq FROM t1 JOIN seq_1_to_600;
ERROR HY000: Got error 200 "Local temporary space limit reached" when merging index
ERROR HY000: Got error 201 "Local temporary space limit reached" when merging index
DROP TABLE t1;
connection default;
disconnect c1;

View File

@@ -48,7 +48,7 @@ set @@tmp_memory_table_size=32*1024;
--echo # The following queries should fail because of tmp_space_usage
--error 41
select * from t1 order by a,v;
--error 200
--error 201
select v,count(*) from t1 group by v limit 2;
--error 41
update t1 set v=right(v,2);
@@ -56,7 +56,7 @@ update t1 set v=right(v,2);
set @@binlog_format="statement";
set @@max_tmp_session_space_usage=65536;
set @@tmp_memory_table_size=0;
--error 200
--error 201
update t1,t2 set t1.c=t2.a, t2.b=1 where t1.a=t2.a;
set @@binlog_format="row";
set @@max_tmp_session_space_usage=default;
@@ -205,7 +205,7 @@ DROP TABLE t1;
--echo #
set max_tmp_session_space_usage = 1024*1024;
--error 201
--error 202
select count(distinct concat(seq,repeat('x',1000))) from seq_1_to_1000;
--echo #
@@ -226,7 +226,7 @@ set @@max_heap_table_size=16777216;
CREATE TABLE t1 (a CHAR(255),b INT,INDEX (b));
INSERT INTO t1 SELECT SEQ,SEQ FROM seq_1_to_100000;
set @@max_tmp_session_space_usage=1179648;
--error 200
--error 201
SELECT * FROM t1 UNION SELECT * FROM t1;
DROP TABLE t1;
@@ -258,7 +258,7 @@ set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
--echo # "temporary space limit reached" error
SET max_tmp_session_space_usage= 64*1024;
--error 200
--error 201
SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
--echo #
@@ -275,7 +275,7 @@ BEGIN;
INSERT INTO t1 SELECT NOW() FROM seq_1_to_6000;
SET max_tmp_session_space_usage = 64*1024;
--error 200
--error 201
SELECT * FROM information_schema.ALL_PLUGINS LIMIT 2;
ROLLBACK;
drop table t1;
@@ -290,7 +290,7 @@ disconnect c1;
SET MAX_TMP_SESSION_SPACE_USAGE = 128*1024, MAX_HEAP_TABLE_SIZE= 16*1024*1024;
CREATE TABLE t1 (a varchar(1024)) DEFAULT CHARACTER SET utf8mb3;
INSERT INTO t1 SELECT 'x' FROM seq_1_to_50;
--error 200
--error 201
SELECT * FROM t1 JOIN seq_1_to_200 INTERSECT ALL SELECT * FROM t1 JOIN seq_1_to_200;
drop table t1;
@@ -300,7 +300,7 @@ drop table t1;
--echo #
SET MAX_TMP_SESSION_SPACE_USAGE = 400*1024;
--error 200
--error 201
SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_VARIABLES JOIN seq_1_to_100
INTERSECT ALL
SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_VARIABLES JOIN seq_1_to_100;

View File

@@ -880,7 +880,7 @@ insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
set local tmp_table_size=1024;
set local tmp_table_size=16384;
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
count(*)
21

View File

@@ -505,7 +505,7 @@ insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
set local tmp_table_size=1024;
set local tmp_table_size=16384;
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
select count(*) from t1;
select count(*) from t2;

View File

@@ -492,7 +492,9 @@ a quux
DROP TABLE t1;
connect con1,localhost,root,,test;
connection con1;
set tmp_table_size=1024;
set tmp_table_size=2048;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '2048'
create table t1 (id int, a int, key idx(a));
create table t2 (id int unsigned not null auto_increment primary key, a int);
insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);

View File

@@ -399,7 +399,7 @@ DROP TABLE t1;
connect (con1,localhost,root,,test);
connection con1;
set tmp_table_size=1024;
set tmp_table_size=2048;
# Create the test tables
create table t1 (id int, a int, key idx(a));

View File

@@ -299,8 +299,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value
query_alloc_block_size 16384
query_prealloc_size 24576
query_alloc_block_size 32768
query_prealloc_size 32768
range_alloc_block_size 4096
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
@@ -310,8 +310,8 @@ WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 16384
QUERY_PREALLOC_SIZE 24576
QUERY_ALLOC_BLOCK_SIZE 32768
QUERY_PREALLOC_SIZE 32768
RANGE_ALLOC_BLOCK_SIZE 4096
TRANSACTION_ALLOC_BLOCK_SIZE 8192
TRANSACTION_PREALLOC_SIZE 4096
@@ -392,8 +392,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value
query_alloc_block_size 16384
query_prealloc_size 24576
query_alloc_block_size 32768
query_prealloc_size 32768
range_alloc_block_size 4096
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
@@ -547,7 +547,7 @@ set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=1024;
set tmp_table_size=16384;
set transaction_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;

View File

@@ -340,7 +340,7 @@ set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=1024;
set tmp_table_size=16384;
set transaction_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;

View File

@@ -1511,8 +1511,6 @@ execute stmt1 using @a;
set @a= 301;
execute stmt1 using @a;
deallocate prepare stmt1;
insert into v3(a) select sum(302);
insert into v3(a) select sum(303) over ();
select * from v3;
a b
100 0
@@ -1531,14 +1529,6 @@ a b
301 10
301 1000
301 2000
302 0
302 10
302 1000
302 2000
303 0
303 10
303 1000
303 2000
drop view v3;
drop tables t1,t2;
create table t1(f1 int);

View File

@@ -1338,8 +1338,6 @@ execute stmt1 using @a;
set @a= 301;
execute stmt1 using @a;
deallocate prepare stmt1;
insert into v3(a) select sum(302);
insert into v3(a) select sum(303) over ();
--sorted_result
select * from v3;

View File

@@ -2,13 +2,16 @@
# WL#1756
#
-- source include/have_innodb.inc
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--disable_warnings
drop table if exists t1, t2;

View File

@@ -4537,7 +4537,7 @@ sub extract_warning_lines ($$) {
qr|InnoDB: liburing disabled|,
qr/InnoDB: Failed to set O_DIRECT on file/,
qr|setrlimit could not change the size of core files to 'infinity';|,
qr|feedback plugin: failed to retrieve the MAC address|,
qr|failed to retrieve the MAC address|,
qr|Plugin 'FEEDBACK' init function returned error|,
qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|,
qr|'log-bin-use-v1-row-events' is MySQL .* compatible option|,

Binary file not shown.

View File

@@ -4,4 +4,3 @@ call mtr.add_suppression("Can't generate a unique log-filename");
RESET MASTER;
FLUSH LOGS;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

View File

@@ -16,7 +16,6 @@ master-bin.2147483647 # Gtid # # GTID #-#-#
master-bin.2147483647 # Query # # CREATE DATABASE db1
RESET MASTER TO 2147483648;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
FOUND 1 /Turning logging off for the whole duration of the MariaDB server process/ in mysqld.1.err
"Following CREATE DATABSE db2 command will not be present in binary log"
"as binary log got closed due to ER_NO_UNIQUE_LOGFILE error."

View File

@@ -11,5 +11,4 @@ UPDATE t1 SET c1=repeat('b',255);
INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
SHOW BINLOG EVENTS FROM POS;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Invalid pos specified. Requested from pos:POS is greater than actual file size:MAX_POS
DROP TABLE t1;

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