Commit c154aafe authored by Sergei Golubchik's avatar Sergei Golubchik

Merge remote-tracking branch '11.3' into 11.4

parents aed9c656 63fb478f

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -32,7 +32,8 @@ Without automated tests, future regressions in the expected behavior can't be au
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
<!--
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.3)
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct.
see [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/-/CODING_STANDARDS.md) for the latest versions.
-->
## Basing the PR against the correct MariaDB version
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*
......@@ -43,5 +44,5 @@ Tick one of the following boxes [x] to help us understand if the base branch for
Maintainers are happy to point out inconsistencies but in order to speed up the review and merge process we ask you to check the CODING standards.
-->
## PR quality check
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/11.0/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/-/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
......@@ -37,14 +37,21 @@ The commit messages are typically rendered in [Markdown format](https://docs.git
When updating your code, please make sure you perform a rebase, not a merge with the latest branch.
Pull requests should be a simple fast-forward of the branch they are intended to land on.
The correct way to rebase (if working on top of 10.3 branch):
The correct way to rebase (if working on top of 10.11 branch):
```sh
git fetch upstream/10.3 # This assumes upstream is github.com/MariaDB/server
git rebase upstream/10.3
git fetch upstream/10.11 # This assumes upstream is github.com/MariaDB/server
git rebase upstream/10.11
git push --force my_branch
```
### Target branch
Pull requests should be based against the correct MariaDB version.
New features should be based against the latest MariaDB development branch, which is the current GitHub default branch: https://github.com/MariaDB/server/blob/-/VERSION
Bug fixes should be based against the earliest maintained branch in which the bug can be reproduced.
The earliest maintained branch is found at https://mariadb.org/about/#maintenance-policy.
## Coding Style (C / C++ files)
Everyone has a preferred coding style, there is no real correct style for all projects around the world.
......
......@@ -1166,6 +1166,8 @@ static int install_used_plugin_data_types(void)
DYNAMIC_STRING ds_result;
const char *query = "SELECT table_comment FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown data type: %'";
if (opt_systables_only)
return 0;
if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory");
run_query(query, &ds_result, TRUE);
......@@ -1482,7 +1484,12 @@ int main(int argc, char **argv)
open_mysql_upgrade_file();
if (opt_check_upgrade)
exit(upgrade_already_done(0) == 0);
{
int upgrade_needed = upgrade_already_done(0);
free_used_memory();
my_end(my_end_arg);
exit(upgrade_needed == 0);
}
/* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mariadb-check.exe", "mariadb-check"), self_name);
......
......@@ -17,7 +17,7 @@
/* maintenance of mysql databases */
#define VER "9.1"
#define VER "10.0"
#include "client_priv.h"
#include <signal.h>
#include <my_pthread.h> /* because of signal() */
......@@ -36,12 +36,12 @@ char *host= NULL, *user= 0, *opt_password= 0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
ulonglong last_values[MAX_MYSQL_VAR+100];
static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0,
opt_compress= 0, opt_local= 0, opt_relative= 0, opt_verbose= 0,
tty_password= 0, opt_nobeep, opt_shutdown_wait_for_slaves= 0;
static my_bool option_force=0,interrupted=0,new_line=0, opt_compress= 0,
opt_local= 0, opt_relative= 0, tty_password= 0, opt_nobeep,
opt_shutdown_wait_for_slaves= 0, opt_not_used;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
static uint opt_count_iterations= 0, my_end_arg;
static uint opt_count_iterations= 0, my_end_arg, opt_verbose= 0;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static char * unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
......@@ -187,8 +187,10 @@ static struct my_option my_long_options[] =
{"user", 'u', "User for login if not current user.", &user,
&user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v', "Write more information.", &opt_verbose,
&opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Write more information."
"Using it will print more information for 'processlist."
"Using it 2 times will print even more information for 'processlist'.",
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
......@@ -277,6 +279,11 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'I': /* Info */
usage();
exit(0);
case 'v': /* --verbose */
opt_verbose++;
if (argument == disabled_my_option)
opt_verbose= 0;
break;
case OPT_CHARSETS_DIR:
#if MYSQL_VERSION_ID > 32300
charsets_dir = argument;
......@@ -441,6 +448,7 @@ int main(int argc,char *argv[])
if (error > 0)
break;
error= -error; /* don't exit with negative error codes */
/*
Command was well-formed, but failed on the server. Might succeed
on retry (if conditions on server change etc.), but needs --force
......@@ -806,10 +814,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
MYSQL_RES *result;
MYSQL_ROW row;
const char *query;
if (mysql_query(mysql, (opt_verbose ? "show full processlist" :
"show processlist")) ||
!(result = mysql_store_result(mysql)))
if (!opt_verbose)
query= "show processlist";
else if (opt_verbose == 1)
query= "show full processlist";
else
query= "select * from information_schema.processlist where id != connection_id()";
if (mysql_query(mysql, query) ||
!(result = mysql_store_result(mysql)))
{
my_printf_error(0, "process list failed; error: '%s'", error_flags,
mysql_error(mysql));
......@@ -1129,24 +1144,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
else
if (mysql_query(mysql,buff))
{
if (mysql_errno(mysql)!=1290)
{
my_printf_error(0,"unable to change password; error: '%s'",
error_flags, mysql_error(mysql));
}
else
{
/*
We don't try to execute 'update mysql.user set..'
because we can't perfectly find out the host
*/
my_printf_error(0,"\n"
"You cannot use 'password' command as mariadbd runs\n"
" with grant tables disabled (was started with"
" --skip-grant-tables).\n"
"Use: \"mysqladmin flush-privileges password '*'\""
" instead", error_flags);
}
my_printf_error(0,"unable to change password; error: '%s'",
error_flags, mysql_error(mysql));
ret = -1;
}
password_done:
......
......@@ -3422,8 +3422,13 @@ int main(int argc, char** argv)
if (tmpdir.list)
free_tmpdir(&tmpdir);
if (result_file && result_file != stdout)
my_fclose(result_file, MYF(0));
if (result_file)
{
if (result_file != stdout)
my_fclose(result_file, MYF(0));
else
fflush(result_file);
}
/*
Ensure the GTID state is correct. If not, end in error.
......
......@@ -1912,8 +1912,13 @@ static FILE* open_sql_file_for_table(const char* table, int flags)
static void free_resources()
{
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
if (md_result_file)
{
if (md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
else
fflush(md_result_file);
}
if (get_table_name_result)
mysql_free_result(get_table_name_result);
if (routine_res)
......
This diff is collapsed.
......@@ -90,7 +90,7 @@ IF(NOT CPACK_PACKAGE_FILE_NAME)
ENDIF()
SET_IF_UNSET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-${VERSION}")
SET_IF_UNSET(CPACK_PACKAGE_CONTACT "MariaDB Developers <maria-developers@lists.launchpad.net>")
SET_IF_UNSET(CPACK_PACKAGE_CONTACT "MariaDB Developers <developers@lists.mariadb.org>")
SET_IF_UNSET(CPACK_PACKAGE_VENDOR "MariaDB Foundation")
SET_IF_UNSET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
......
......@@ -121,10 +121,6 @@ in
# there is intentionally no customizations whatsoever.
;;
# Ubuntu
"bionic")
remove_rocksdb_tools
[ "$architecture" != amd64 ] && disable_pmem
;&
"focal")
replace_uring_with_aio
disable_libfmt
......
Source: mariadb
Section: database
Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
Maintainer: MariaDB Developers <developers@lists.mariadb.org>
Build-Depends: bison,
cmake,
cracklib-runtime <!nocheck>,
......
......@@ -2,12 +2,11 @@
== MariaDB ==
The Debian package of MySQL was first debianzed on 1997-04-12 by Christian
Schwarz <schwarz@debian.org> and ist maintained since 1999-04-20 by
Schwarz <schwarz@debian.org> and is maintained since 1999-04-20 by
Christian Hammers <ch@debian.org>.
The MariaDB packages were initially made by http://ourdelta.org/, and
are now managed by the MariaDB development team,
maria-developers@lists.launchpad.net
are now managed by the MariaDB development team, developers@lists.mariadb.org
MariaDB can be downloaded from https://downloads.mariadb.org/
......
libmariadb.so.3 libmariadb3 #MINVER#
* Build-Depends-Package: libmariadb-dev
libmariadb_3@libmariadb_3 3.0.0
libmariadb_3_3_5@libmariadb_3_3_5 3.3.5
libmariadbclient_18@libmariadbclient_18 3.0.0
libmysqlclient_18@libmysqlclient_18 3.0.0
ma_pvio_register_callback@libmariadb_3 3.0.0
......@@ -8,6 +9,7 @@ libmariadb.so.3 libmariadb3 #MINVER#
mariadb_connection@libmariadb_3 3.0.0
mariadb_convert_string@libmariadb_3 3.0.0
mariadb_deinitialize_ssl@libmariadb_3 3.0.0
mariadb_field_attr@libmariadb_3 3.3.1
mariadb_free_rpl_event@libmariadb_3 3.1.0
mariadb_get_charset_by_name@libmariadb_3 3.0.0
mariadb_get_charset_by_nr@libmariadb_3 3.0.0
......@@ -15,8 +17,12 @@ libmariadb.so.3 libmariadb3 #MINVER#
mariadb_get_infov@libmariadb_3 3.0.0
mariadb_reconnect@libmariadb_3 3.0.0
mariadb_rpl_close@libmariadb_3 3.1.0
mariadb_rpl_errno@libmariadb_3_3_5 3.3.2
mariadb_rpl_error@libmariadb_3_3_5 3.3.2
mariadb_rpl_extract_rows@libmariadb_3_3_5 3.3.2
mariadb_rpl_fetch@libmariadb_3 3.1.0
mariadb_rpl_get_optionsv@libmariadb_3 3.1.0
mariadb_rpl_init_ex@libmariadb_3 3.3.0
mariadb_rpl_open@libmariadb_3 3.1.0
mariadb_rpl_optionsv@libmariadb_3 3.1.0
mariadb_stmt_execute_direct@libmariadb_3 3.0.0
......
......@@ -28,6 +28,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <winioctl.h>
#endif
#ifdef HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
#include <linux/falloc.h>
#endif
typedef struct {
File fd;
my_bool init_ibd_done;
......@@ -160,9 +164,18 @@ static int write_compressed(File fd, uchar *data, size_t len, size_t pagesize)
if (datasize < n_bytes) {
/* This punches a "hole" in the file. */
size_t hole_bytes = n_bytes - datasize;
if (my_seek(fd, hole_bytes, MY_SEEK_CUR, MYF(MY_WME | MY_NABP))
== MY_FILEPOS_ERROR)
return 1;
my_off_t off = my_seek(fd, hole_bytes, MY_SEEK_CUR, MYF(MY_WME | MY_NABP));
if (off == MY_FILEPOS_ERROR)
return 1;
#ifdef HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
/* punch holes harder for filesystems (like XFS) that
heuristically decide whether leave a hole after the
above or not based on the current access pattern
(which is sequential write and not at all typical for
what InnoDB will be doing with the file later */
fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
off - hole_bytes, hole_bytes);
#endif
}
written += n_bytes;
ptr += n_bytes;
......
......@@ -127,7 +127,8 @@ int sd_notifyf() { return 0; }
int sys_var_init();
/* === xtrabackup specific options === */
char xtrabackup_real_target_dir[FN_REFLEN] = "./mariadb_backup_files/";
#define DEFAULT_TARGET_DIR "./mariadb_backup_files/"
char xtrabackup_real_target_dir[FN_REFLEN] = DEFAULT_TARGET_DIR;
char *xtrabackup_target_dir= xtrabackup_real_target_dir;
static my_bool xtrabackup_version;
static my_bool verbose;
......@@ -410,6 +411,9 @@ uint opt_safe_slave_backup_timeout = 0;
const char *opt_history = NULL;
/* Whether xtrabackup_binlog_info should be created on recovery */
static bool recover_binlog_info;
char mariabackup_exe[FN_REFLEN];
char orig_argv1[FN_REFLEN];
......@@ -1269,22 +1273,25 @@ struct my_option xb_client_options[]= {
{"compress", OPT_XTRA_COMPRESS,
"Compress individual backup files using the "
"specified compression algorithm. Currently the only supported algorithm "
"is 'quicklz'. It is also the default algorithm, i.e. the one used when "
"--compress is used without an argument.",
"specified compression algorithm. It uses no longer maintained QuickLZ "
"library hence this option was deprecated with MariaDB 10.1.31 and 10.2.13.",
(G_PTR *) &xtrabackup_compress_alg, (G_PTR *) &xtrabackup_compress_alg, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"compress-threads", OPT_XTRA_COMPRESS_THREADS,
"Number of threads for parallel data compression. The default value is "
"1.",
"1. "
"This option was deprecated as it relies on the no longer "
"maintained QuickLZ library.",
(G_PTR *) &xtrabackup_compress_threads,
(G_PTR *) &xtrabackup_compress_threads, 0, GET_UINT, REQUIRED_ARG, 1, 1,
UINT_MAX, 0, 0, 0},
{"compress-chunk-size", OPT_XTRA_COMPRESS_CHUNK_SIZE,
"Size of working buffer(s) for compression threads in bytes. The default "
"value is 64K.",
"value is 64K. "
"This option was deprecated as it relies on the no longer "
"maintained QuickLZ library.",
(G_PTR *) &xtrabackup_compress_chunk_size,
(G_PTR *) &xtrabackup_compress_chunk_size, 0, GET_ULL, REQUIRED_ARG,
(1 << 16), 1024, ULONGLONG_MAX, 0, 0, 0},
......@@ -1405,7 +1412,9 @@ struct my_option xb_client_options[]= {
{"decompress", OPT_DECOMPRESS,
"Decompresses all files with the .qp "
"extension in a backup previously made with the --compress option.",
"extension in a backup previously made with the --compress option. "
"This option was deprecated as it relies on the no longer "
"maintained QuickLZ library.",
(uchar *) &opt_decompress, (uchar *) &opt_decompress, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
......@@ -1699,8 +1708,11 @@ struct my_option xb_server_options[] =
"Path to InnoDB log files.", &srv_log_group_home_dir,
&srv_log_group_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
"Percentage of dirty pages allowed in bufferpool.", (G_PTR*) &srv_max_buf_pool_modified_pct,
(G_PTR*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
"Percentage of dirty pages allowed in bufferpool.",
(G_PTR*) &srv_max_buf_pool_modified_pct,
(G_PTR*) &srv_max_buf_pool_modified_pct, 0, GET_DOUBLE, REQUIRED_ARG,
(longlong)getopt_double2ulonglong(90), (longlong)getopt_double2ulonglong(0),
getopt_double2ulonglong(100), 0, 0, 0},
{"innodb_use_native_aio", OPT_INNODB_USE_NATIVE_AIO,
"Use native AIO if supported on this platform.",
(G_PTR*) &srv_use_native_aio,
......@@ -1886,7 +1898,7 @@ static int prepare_export()
IF_WIN("\"","") "\"%s\" --mysqld \"%s\""
" --defaults-extra-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
" --innodb-buffer-pool-size=%llu"
" --console --skip-log-error --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
......@@ -1900,7 +1912,7 @@ static int prepare_export()
IF_WIN("\"","") "\"%s\" --mysqld"
" --defaults-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
" --innodb-buffer-pool-size=%llu"
" --console --log-error= --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
......@@ -2448,6 +2460,7 @@ xtrabackup_read_metadata(char *filename)
{
FILE *fp;
my_bool r = TRUE;
int t;
fp = fopen(filename,"r");
if(!fp) {
......@@ -2478,6 +2491,9 @@ xtrabackup_read_metadata(char *filename)
}
/* Optional fields */
if (fscanf(fp, "recover_binlog_info = %d\n", &t) == 1) {
recover_binlog_info = (t == 1);
}
end:
fclose(fp);
......@@ -2527,11 +2543,13 @@ xtrabackup_print_metadata(char *buf, size_t buf_len)
"backup_type = %s\n"
"from_lsn = " UINT64PF "\n"
"to_lsn = " UINT64PF "\n"
"last_lsn = " UINT64PF "\n",
"last_lsn = " UINT64PF "\n"
"recover_binlog_info = %d\n",
metadata_type,
metadata_from_lsn,
metadata_to_lsn,
metadata_last_lsn);
metadata_last_lsn,
MY_TEST(opt_binlog_info == BINLOG_INFO_LOCKLESS));
}
/***********************************************************************
......@@ -5966,6 +5984,26 @@ static ibool prepare_handle_del_files(const char *datadir, const char *db, const
return TRUE;
}
/**************************************************************************
Store the current binary log coordinates in a specified file.
@return 'false' on error. */
static bool
store_binlog_info(const char *filename, const char* name, ulonglong pos)
{
FILE *fp = fopen(filename, "w");
if (!fp) {
msg("mariabackup: failed to open '%s'\n", filename);
return(false);
}
fprintf(fp, "%s\t%llu\n", name, pos);
fclose(fp);
return(true);
}
/** Implement --prepare
@return whether the operation succeeded */
static bool xtrabackup_prepare_func(char** argv)
......@@ -6151,6 +6189,20 @@ static bool xtrabackup_prepare_func(char** argv)
msg("Last binlog file %s, position %lld",
trx_sys.recovered_binlog_filename,
longlong(trx_sys.recovered_binlog_offset));
/* output to xtrabackup_binlog_pos_innodb and (if
backup_safe_binlog_info was available on the server) to
xtrabackup_binlog_info. In the latter case
xtrabackup_binlog_pos_innodb becomes redundant and is created
only for compatibility. */
ok = store_binlog_info(
"xtrabackup_binlog_pos_innodb",
trx_sys.recovered_binlog_filename,
trx_sys.recovered_binlog_offset)
&& (!recover_binlog_info || store_binlog_info(
XTRABACKUP_BINLOG_INFO,
trx_sys.recovered_binlog_filename,
trx_sys.recovered_binlog_offset));
}
/* Check whether the log is applied enough or not. */
......@@ -6352,7 +6404,7 @@ static bool check_all_privileges()
}
/* KILL ... */
if (!opt_no_lock && (opt_kill_long_queries_timeout || opt_kill_long_query_type)) {
if (!opt_no_lock && opt_kill_long_queries_timeout) {
check_result |= check_privilege(
granted_privileges,
"CONNECTION ADMIN", "*", "*",
......@@ -6373,7 +6425,7 @@ static bool check_all_privileges()
if (opt_galera_info || opt_slave_info
|| opt_safe_slave_backup) {
check_result |= check_privilege(granted_privileges,
"SLAVE MONITOR", "*", "*",
"REPLICA MONITOR", "*", "*",
PRIVILEGE_WARNING);
}
......@@ -6586,9 +6638,10 @@ void handle_options(int argc, char **argv, char ***argv_server,
server_default_groups.push_back(NULL);
snprintf(conf_file, sizeof(conf_file), "my");
if (prepare && target_dir) {
if (prepare) {
snprintf(conf_file, sizeof(conf_file),
"%s/backup-my.cnf", target_dir);
"%s/backup-my.cnf", target_dir ? target_dir:
DEFAULT_TARGET_DIR);
if (!strncmp(argv[1], "--defaults-file=", 16)) {
/* Remove defaults-file*/
for (int i = 2; ; i++) {
......
......@@ -171,7 +171,7 @@ extern uint opt_safe_slave_backup_timeout;
extern const char *opt_history;
enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_ON,
enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_LOCKLESS, BINLOG_INFO_ON,
BINLOG_INFO_AUTO};
extern ulong opt_binlog_info;
......
......@@ -170,6 +170,7 @@ int main(int argc, char **argv)
if ((error= load_defaults(config_file, (const char **) load_default_groups,
&count, &arguments)))
{
my_free(load_default_groups);
my_end(0);
if (error == 4)
return 0;
......
......@@ -83,7 +83,7 @@ static inline ulonglong uint6korr(const void *p)
#define HAVE_mi_uint5korr
#define HAVE_mi_uint6korr
#define HAVE_mi_uint7korr
#define HAVE_mi_uint78orr
#define HAVE_mi_uint8korr
/* Read numbers stored in high-bytes-first order */
......
......@@ -448,7 +448,8 @@ enum my_lex_states
MY_LEX_IDENT_OR_KEYWORD,
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
MY_LEX_STRING_OR_DELIMITER, MY_LEX_MINUS_OR_COMMENT, MY_LEX_PLACEHOLDER,
MY_LEX_COMMA
MY_LEX_COMMA,
MY_LEX_IDENT_OR_QUALIFIED_SPECIAL_FUNC
};
struct charset_info_st;
......@@ -1866,6 +1867,9 @@ my_well_formed_length(CHARSET_INFO *cs, const char *b, const char *e,
#include "t_ctype.h"
#endif
int my_wc_mb_utf8mb4_bmp_only(CHARSET_INFO *cs, my_wc_t wc, uchar *r,
uchar *e);
#ifdef __cplusplus
}
#endif
......
......@@ -25,6 +25,8 @@
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
#define ROOT_FLAG_READ_ONLY 4
#ifdef __cplusplus
extern "C" {
#endif
......@@ -53,10 +55,6 @@ typedef struct st_mem_root
unsigned short first_block_usage;
unsigned short flags;
#ifdef PROTECT_STATEMENT_MEMROOT
int read_only;
#endif
void (*error_handler)(void);
PSI_memory_key psi_key;
......
......@@ -110,8 +110,135 @@ static inline void set_rec_bits(uint16 bits, uchar *ptr, uchar ofs, uint len)
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
extern int ha_compare_text(CHARSET_INFO *, const uchar *, size_t,
const uchar *, size_t , my_bool);
/*
Compare two VARCHAR values.
@param charset_info - The character set and collation
@param a - The pointer to the first string
@param a_length - The length of the first string
@param b - The pointer to the second string
@param b_length - The length of the second string
@param b_is_prefix - Whether "b" is a prefix of "a",
e.g. in a prefix key (partial length key).
@returns - The result of comparison
- If "b_is_prefix" is FALSE, then the two strings are compared
taking into account the PAD SPACE/NO PAD attribute of the collation.
- If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
This is done e.g. when we compare a column value to its prefix key value
(the value of "a" to the value of "key_a"):
CREATE TABLE t1 (a VARCHAR(10), KEY(key_a(5));
*/
static inline int ha_compare_char_varying(CHARSET_INFO *charset_info,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
if (!b_is_prefix)
return charset_info->coll->strnncollsp(charset_info, a, a_length,
b, b_length);
return charset_info->coll->strnncoll(charset_info,
a, a_length,
b, b_length, TRUE/*prefix*/);
}
/*
Compare two CHAR values of the same declared character length,
e.g. CHAR(5) to CHAR(5).
@param charset_info - The character set and collation
@param a - The pointer to the first string
@param a_length - The length of the first string
@param b - The pointer to the second string
@param b_length - The length of the second string
@param nchars - The declared length (in characters)
@param b_is_prefix - Whether "b" is a prefix of "a",
e.g. in a prefix key (partial length key).
@returns - The result of comparison
- If "b_is_prefix" is FALSE, then the two strings are compared
taking into account the PAD SPACE/NO PAD attribute of the collation.
Additionally, this function assumes that the underlying storage could
optionally apply trailing space compression, so values can come into this
comparison function in different states:
- all trailing spaces removed
- some trailing spaced removed
- no trailing spaces removed (exactly "nchars" characters on the two sides)
This function virtually reconstructs trailing spaces up to the defined
length specified in "nchars".
If either of the sides have more than "nchar" characters,
then only leftmost "nchar" characters are compared.
- If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
This is done e.g. when we compare a column value to its prefix key value
(the value of "a" to the value of "key_a"):
CREATE TABLE t1 (a CHAR(10), KEY(key_a(5));
*/
static inline int ha_compare_char_fixed(CHARSET_INFO *charset_info,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
size_t nchars,
my_bool b_is_prefix)
{
if (!b_is_prefix)
return charset_info->coll->strnncollsp_nchars(charset_info,
a, a_length,
b, b_length,
nchars,
MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
return charset_info->coll->strnncoll(charset_info,
a, a_length,
b, b_length, TRUE/*prefix*/);
}
/*
A function to compare words of a text.
This is a common operation in full-text search:
SELECT MATCH (title) AGAINST ('word') FROM t1;
*/
static inline int ha_compare_word(CHARSET_INFO *charset_info,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length)
{
return charset_info->coll->strnncollsp(charset_info,
a, a_length,
b, b_length);
}
/*
A function to compare a word of a text to a word prefix.
This is a common operation in full-text search:
SELECT MATCH (title) AGAINST ('wor*' IN BOOLEAN MODE) FROM t1;
*/
static inline int ha_compare_word_prefix(CHARSET_INFO *charset_info,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length)
{
return charset_info->coll->strnncoll(charset_info,
a, a_length,
b, b_length,
TRUE/*b_is_prefix*/);
}
/*
Compare words (full match or prefix match), e.g. for full-text search.
*/
static inline int ha_compare_word_or_prefix(CHARSET_INFO *charset_info,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
if (!b_is_prefix)
return ha_compare_word(charset_info, a, a_length, b, b_length);
return ha_compare_word_prefix(charset_info, a, a_length, b, b_length);
}
extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
const uchar *b, uint key_length, uint nextflag,
uint *diff_pos);
......
......@@ -666,15 +666,19 @@ extern void my_mutex_end(void);
We need to have at least 256K stack to handle calls to myisamchk_init()
with the current number of keys and key parts.
*/
#if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
#ifndef DBUG_OFF
#define DEFAULT_THREAD_STACK (1024*1024L)
#else
#define DEFAULT_THREAD_STACK (383*1024L) /* 392192 */
#endif
#else
#define DEFAULT_THREAD_STACK (292*1024L) /* 299008 */
#endif
# if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
/*
Optimized WITH_ASAN=ON executables produced
by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6
would fail ./mtr main.1st when the stack size is 5 MiB.
The minimum is more than 6 MiB for CMAKE_BUILD_TYPE=RelWithDebInfo and
more than 8 MiB for CMAKE_BUILD_TYPE=Debug.
Let us add some safety margin.
*/
# define DEFAULT_THREAD_STACK (10L<<20)
# else
# define DEFAULT_THREAD_STACK (292*1024L) /* 299008 */
# endif
#endif
#define MY_PTHREAD_LOCK_READ 0
......
......@@ -898,6 +898,7 @@ extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void move_root(MEM_ROOT *to, MEM_ROOT *from);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
size_t prealloc_size);
......
......@@ -112,6 +112,7 @@ typedef struct st_handler_check_param
uint progress_counter; /* How often to call _report_progress() */
ulonglong progress, max_progress;
void (*init_fix_record)(void *);
int (*fix_record)(struct st_myisam_info *info, uchar *record, int keynum);
mysql_mutex_t print_msg_mutex;
......
......@@ -268,7 +268,6 @@ typedef struct st_mysql
char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
char *info, *db;
const struct charset_info_st *charset;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
my_ulonglong affected_rows;
my_ulonglong insert_id; /* id if insert on table with NEXTNR */
......@@ -290,7 +289,8 @@ typedef struct st_mysql
/* session-wide random string */
char scramble[SCRAMBLE_LENGTH+1];
my_bool auto_local_infile;
void *unused2, *unused3, *unused4, *unused5;
void *unused2, *unused3, *unused4;
MYSQL_FIELD *fields;
LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods;
......
......@@ -121,5 +121,3 @@ MYSQL *mysql_real_connect_local(MYSQL *mysql);
#endif
#endif /*MYSQL_SERVICE_SQL */
Subproject commit c0ddc2c8cff30aebbedc5ae175e435c2c6fec646
Subproject commit 458a4396b443dcefedcf464067560078aa09d8b4
......@@ -51,6 +51,7 @@ ENDIF()
SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
libmysql.c ../sql-common/errmsg.c
../sql-common/client.c
../sql/cset_narrowing.cc
../sql-common/my_user.c ../sql-common/pack.c
../sql-common/client_plugin.c
../sql/password.c ../sql/discover.cc ../sql/derror.cc
......
......@@ -459,6 +459,7 @@ static int emb_read_change_user_result(MYSQL *mysql)
return mysql_errno(mysql) ? (int)packet_error : 1 /* length of the OK packet */;
}
static void emb_on_close_free(MYSQL *mysql)
{
my_free(mysql->info_buffer);
......@@ -470,6 +471,7 @@ static void emb_on_close_free(MYSQL *mysql)
}
}
MYSQL_METHODS embedded_methods=
{
emb_read_query_result,
......@@ -705,8 +707,7 @@ void *create_embedded_thd(ulong client_flag)
if (thd->variables.max_join_size == HA_POS_ERROR)
thd->variables.option_bits |= OPTION_BIG_SELECTS;
thd->proc_info=0; // Remove 'login'
thd->set_command(COM_SLEEP);
thd->mark_connection_idle();
thd->set_time();
thd->init_for_queries();
thd->client_capabilities= client_flag | MARIADB_CLIENT_EXTENDED_METADATA;
......@@ -1446,4 +1447,3 @@ int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
}
return 0;
}
......@@ -34,7 +34,7 @@ CHECK TABLE
to check tables within the tablespace\&.
.PP
If checksum mismatches are found, you would normally restore the tablespace from backup or start the server and attempt to use
\fBmysqldump\fR
\fBmariadb-dump\fR
to make a backup of the tables within the tablespace\&.
.PP
Invoke
......@@ -75,9 +75,9 @@ Displays help and exits\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-c, --count\fR
\fB\-a \fR\fB\fInum\fB, --allow-mismatches=#\fR
.sp
Print a count of the number of pages in the file\&.
Maximum checksum mismatch allowed before innochecksum terminates. Defaults to 0, which terminates on the first mismatch\&.
.RE
.sp
.RS 4
......@@ -88,9 +88,9 @@ Print a count of the number of pages in the file\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-d, --debug\fR
\fB\-c, --count\fR
.sp
Debug mode; prints checksums for each page\&.
Print a count of the number of pages in the file\&.
.RE
.sp
.RS 4
......@@ -140,7 +140,7 @@ Synonym for \fB--help\fR\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-l, --leaf\fR
\fB\-f, --leaf\fR
.sp
Examine leaf index pages\&.
.RE
......@@ -153,6 +153,19 @@ Examine leaf index pages\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-l \fR\fB\fIfn\fB, --log=fn\fR\fR
.sp
Log output to the specified filename, fn\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-m \fR\fB\fInum\fB, --merge=#\fR\fR
.sp
Leaf page count if merge given number of consecutive pages\&.
......@@ -166,6 +179,19 @@ Leaf page count if merge given number of consecutive pages\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-n, --no-check\fR\fR
.sp
Ignore the checksum verification. Until MariaDB 10.6, must be used with the --write option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-p \fR\fB\fInum\fB, --page-num=#\fR\fR
.sp
Check only this page number\&.
......@@ -179,6 +205,32 @@ Check only this page number\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-D \fR\fB\fIname\fB, --page-type-dump=name\fR\fR
.sp
Dump the page type info for each page in a tablespace\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-S, --page-type-summary\fR\fR
.sp
Display a count of each page type in a tablespace\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-s \fR\fB\fInum\fB, --start-page\fR\fR
.sp
Start at this page number\&.
......@@ -205,6 +257,32 @@ Skip corrupt pages\&.
.sp -1
.IP \(bu 2.3
.\}
\fB\-C \fR\fB\fIname\fB, --strict-check=name\fR\fR
.sp
Specify the strict checksum algorithm. One of: crc32, innodb, none. If not specified, validates against innodb, crc32 and none. Removed in MariaDB 10.6\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-w \fR\fB\fIname\fB, --write=name\fR\fR
.sp
Rewrite the checksum algorithm. One of crc32, innodb, none. An exclusive lock is obtained during use. Use in conjunction with the -no-check option to rewrite an invalid checksum. Removed in MariaDB 10.6\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-v, --verbose\fR
.sp
Verbose mode; print a progress indicator every five seconds\&.
......@@ -225,7 +303,7 @@ Displays version information and exits\&.
.SH "COPYRIGHT"
.br
.PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2023 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
......
......@@ -84,8 +84,8 @@ edit the test result to the correct results so that we can verify that
the bug is corrected in future releases.
If you want to submit your test case you can send it
to maria-developers@lists.launchpad.net or attach it to a bug report on
https://mariadb.org/jira/.
to developers@lists.mariadb.org or attach it to a bug report on
http://mariadb.org/jira/.
If the test case is really big or if it contains 'not public' data,
then put your .test file and .result file(s) into a tar.gz archive,
......
......@@ -58,11 +58,6 @@ DROP TABLE t1;
# CHAR
# MyISAM is buggy on CHAR+BTREE+UNIQUE+PREFIX (see MDEV-30048), disable for now
# Other engines work fine
if (`SELECT UPPER(@@storage_engine) != 'MYISAM'`)
{
EXECUTE IMMEDIATE REPLACE(
'CREATE TABLE t1 ( '
' a CHAR(20) COLLATE <COLLATION>,'
......@@ -72,7 +67,6 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss ');
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
DROP TABLE t1;
}
EXECUTE IMMEDIATE REPLACE(
'CREATE TABLE t1 ( '
......
--echo #
--echo # MDEV-30048 Prefix keys for CHAR work differently for MyISAM vs InnoDB
--echo #
SET NAMES utf8mb3;
#
# Engines have different conditions based on the column size
# determining when to use trailing space compressions in key values,
# so let's test different column sizes for better coverage.
#
#
# CHAR(10)
#
CREATE TABLE t1 (a CHAR(10) COLLATE utf8mb3_unicode_nopad_ci, UNIQUE KEY(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss'),('ß');
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) COLLATE utf8mb3_unicode_nopad_ci, UNIQUE KEY(a(2)));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss'),('ß');
DROP TABLE t1;
#
# CHAR(120)
#
CREATE TABLE t1 (a CHAR(120) COLLATE utf8mb3_unicode_nopad_ci, UNIQUE KEY(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss'),('ß');
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(120) COLLATE utf8mb3_unicode_nopad_ci, UNIQUE KEY(a(100)));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss'),('ß');
DROP TABLE t1;
--echo #
--echo # MDEV-30050 Inconsistent results of DISTINCT with NOPAD
--echo #
CREATE TABLE t1 (c CHAR(100) COLLATE utf8mb3_unicode_nopad_ci);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('ss'),('ß');
SET big_tables=0;
SELECT DISTINCT c FROM t1;
SET big_tables=1;
SELECT DISTINCT c FROM t1;
DROP TABLE t1;
SET big_tables=DEFAULT;
# Remove anonymous users added by add_anonymous_users.inc
disable_warnings;
disable_query_log;
DELETE FROM mysql.user where host='localhost' and user='';
DELETE FROM mysql.global_priv where host='localhost' and user='';
FLUSH PRIVILEGES;
enable_query_log;
enable_warnings;
SET SESSION character_set_connection=latin2;
SET SESSION character_set_client=cp1250;
--disable_service_connection
--echo #
--echo # Test litteral
--echo #
......@@ -129,3 +131,5 @@ EXPLAIN EXTENDED SELECT '';
EXPLAIN EXTENDED SELECT _latin1'';
EXPLAIN EXTENDED SELECT N'';
EXPLAIN EXTENDED SELECT '' '';
--enable_service_connection
......@@ -310,6 +310,19 @@ INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
--source include/explain_utils.inc
DROP TABLE t1;
--echo #30a
--echo #
--echo # MDEV-32957 Unusable key notes report wrong predicates for > and >=
--echo #
CREATE TABLE t1(a INT, i CHAR(2), INDEX(i(1)));
INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),
(30),(31),(32),(33),(34),(35);
--let $query = DELETE FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5
--let $select = SELECT * FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5
--source include/explain_utils.inc
DROP TABLE t1;
--echo #31
CREATE TABLE t1 (i INT);
INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
......
......@@ -162,7 +162,7 @@ INSERT INTO t1 VALUES
--echo
--echo # Execute select with invalid timestamp, desc ordering
SELECT *
FROM t1
FROM t1 FORCE INDEX(PRIMARY)
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
......@@ -171,7 +171,7 @@ LIMIT 2;
--echo # Should use index condition
EXPLAIN
SELECT *
FROM t1
FROM t1 FORCE INDEX(PRIMARY)
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
......@@ -458,6 +458,7 @@ INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
INSERT INTO t2 VALUES (15,4);
analyze table t1,t2 persistent for all;
set @save_optimizer_switch= @@optimizer_switch;
set optimizer_switch='semijoin=off';
......@@ -729,6 +730,7 @@ INSERT INTO t2 VALUES
('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w');
insert into t2 select seq from seq_1_to_100;
analyze table t1,t2 persistent for all;
SET SESSION optimizer_switch='index_condition_pushdown=off';
--replace_column 9 #
EXPLAIN
......
#
# Include this file in your .test file if your testcase uses InnoDB tables
# requiring stable query plans, which likely requires that InnoDB produces
# stable estimates for #records in tables.
#
# How it works:
# Unstable InnoDB estimates are caused by InnoDB's background statistics
# collection. When you include this file, MTR will use server options from
# include/innodb_stable_estimates.opt, which disables background statistics
# collection.
# (and no, InnoDB team objects to using this configuration for all MTR tests)
#
--innodb_stats_auto_recalc=0
......@@ -11,6 +11,7 @@
connection default;
let $default_db=`select database()`;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $pid_file=`select @@pid_file`;
#it will used at end of test for wait_for_status_var.inc primitive
#let $status_var= Threads_connected;
......@@ -23,6 +24,7 @@ wait-maria_empty_logs.inc
EOF
--source include/mysqladmin_shutdown.inc
--source include/wait_until_no_pidfile.inc
--disable_warnings
if (!$mel_keep_control_file)
......
......@@ -59,7 +59,7 @@ let $_wfsie_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
if ($slave_io_errno == '') {
--echo !!!ERROR IN TEST: you must set \$slave_io_errno before you source
--echo !!!wait_for_slave_sql_error.inc. The error we got this time was '$_wfsie_errno',
--echo !!!wait_for_slave_io_error.inc. The error we got this time was '$_wfsie_errno',
--echo !!!so you probably want to add the following line to your test case:
--echo !!! --let \$slave_io_errno= $_wfsie_errno
--die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
......
......@@ -21,6 +21,17 @@
# $slave_timeout
# See include/wait_for_slave_param.inc.
#
# $rpl_allow_error
# By default, this file fails if there is an error in the IO
# thread. However, if an error in the IO thread is possible and allowed,
# setting $rpl_allow_error=1 will prevent this file from failing if
# there is an error in the IO thread.
# (If an error is _always_ expected, a better alternative might be to
# use wait_for_slave_io_error.inc instead of this file).
# Note: This is currently always enabled, since a simple STOP SLAVE
# IO_THREAD can cause an error if it interrupts the slave's initial
# communication with the master (MDEV-32892).
#
# $rpl_debug
# See include/rpl_init.inc
......@@ -31,9 +42,15 @@
--let $slave_param= Slave_IO_Running
--let $slave_param_value= No
--let $slave_error_param= Last_IO_Errno
--let $_io_stop_save_allow_error= $slave_error_param
# Disabled, as IO errors are left behind when a normal STOP SLAVE interrupts
# the initial communication between the IO thread and the master (MDEV-32892).
#if (!$rpl_allow_error)
#{
# --let $slave_error_param= Last_IO_Errno
#}
--source include/wait_for_slave_param.inc
--let $slave_error_param=
--let $slave_error_param= $_io_stop_save_allow_error
--let $include_filename= wait_for_slave_io_to_stop.inc
......
......@@ -35,7 +35,7 @@
# $slave_error_param
# If set, this script will check if the column of the output from
# SHOW SLAVE STATUS named $slave_error_param is nonzero. If it is,
# this script will faile immediately. Typically, this should be set
# this script will fail immediately. Typically, this should be set
# to Last_IO_Errno or Last_SQL_Errno.
#
# $rpl_debug
......@@ -56,11 +56,6 @@ if (!$_slave_timeout)
}
}
if ($slave_error_param == '')
{
--let $slave_error_param= 1
}
let $_slave_param_comparison= $slave_param_comparison;
if (!$_slave_param_comparison)
{
......@@ -90,7 +85,7 @@ while ($_slave_continue)
--let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1)
# Check if an error condition is reached.
if (!$slave_error_param)
if ($slave_error_param)
{
--let $_show_slave_status_error_value= query_get_value("SHOW SLAVE STATUS", $slave_error_param, 1)
if ($_show_slave_status_error_value)
......
......@@ -21,6 +21,14 @@
# $slave_timeout
# See include/wait_for_slave_param.inc
#
# $rpl_allow_error
# By default, this file fails if there is an error in the SQL
# thread. However, if an error in the SQL thread is possible and allowed,
# setting $rpl_allow_error=1 will prevent this file from failing if
# there is an error in the SQL thread.
# (If an error is _always_ expected, a better alternative might be to
# use wait_for_slave_sql_error.inc instead of this file).
#
# $rpl_debug
# See include/rpl_init.inc
......@@ -31,7 +39,10 @@
--let $slave_param= Slave_SQL_Running
--let $slave_param_value= No
--let $slave_error_param= Last_SQL_Errno
if (!$rpl_allow_error)
{
--let $slave_error_param= Last_SQL_Errno
}
--source include/wait_for_slave_param.inc
--let $slave_error_param=
......
# Include this script after a shutdown to wait until the pid file,
# stored in $pid_file, has disappered.
#--echo $pid_file
--disable_result_log
--disable_query_log
# Wait one minute
let $counter= 600;
while ($counter)
{
--error 0,1
--file_exists $pid_file
if (!$errno)
{
dec $counter;
--real_sleep 0.1
}
if ($errno)
{
let $counter= 0;
}
}
if (!$errno)
{
--die Pid file "$pid_file" failed to disappear
}
--enable_query_log
--enable_result_log
......@@ -154,7 +154,17 @@ sub collect_test_cases ($$$$) {
{
push (@$cases, @this_case);
}
else
elsif ($::opt_skip_not_found)
{
push @$cases, My::Test->new
(
name => "$sname.$tname",
shortname => $tname,
skip => 1,
comment => 'not found',
);
}
else
{
mtr_error("Could not find '$tname' in '$sname' suite");
}
......@@ -614,7 +624,7 @@ sub make_combinations($$@)
{
my ($test, $test_combs, @combinations) = @_;
return ($test) if $test->{'skip'} or not @combinations;
return ($test) unless @combinations;
if ($combinations[0]->{skip}) {
$test->{skip} = 1;
$test->{comment} = $combinations[0]->{skip} unless $test->{comment};
......@@ -647,6 +657,8 @@ sub make_combinations($$@)
}
}
return ($test) if $test->{'skip'};
my @cases;
foreach my $comb (@combinations)
{
......
......@@ -76,6 +76,30 @@ if (-t STDOUT) {
}
}
# On Windows, stdio does not support line buffering
# This can make MTR output from multiple forked processes interleaved, messed up.
# Below is DYI stdout line buffering.
my $out_line="";
# Flush buffered line
sub flush_out {
print $out_line;
$out_line = "";
}
# Print to stdout
sub print_out {
if(IS_WIN32PERL) {
$out_line .= $_[0];
# Flush buffered output on new lines.
if (rindex($_[0], "\n") != -1) {
flush_out();
}
} else {
print($_[0]);
}
}
sub titlebar_stat($) {
sub time_format($) {
......@@ -116,10 +140,10 @@ sub _mtr_report_test_name ($) {
return unless defined $verbose;
print _name(). _timestamp();
printf "%-40s ", $tname;
print_out _name(). _timestamp();
print_out (sprintf "%-40s ", $tname);
my $worker = $tinfo->{worker};
print "w$worker " if defined $worker;
print_out "w$worker " if defined $worker;
return $tname;
}
......@@ -661,14 +685,14 @@ sub mtr_report (@) {
{
my @s = split /\[ (\S+) \]/, _name() . "@_\n";
if (@s > 1) {
print $s[0];
print_out $s[0];
&$set_color($s[1]);
print "[ $s[1] ]";
print_out "[ $s[1] ]";
&$set_color('reset');
print $s[2];
print_out $s[2];
titlebar_stat($s[1]) if $set_titlebar;
} else {
print $s[0];
print_out $s[0];
}
}
}
......@@ -676,6 +700,7 @@ sub mtr_report (@) {
# Print warning to screen
sub mtr_warning (@) {
flush_out();
print STDERR _name(). _timestamp().
"mysql-test-run: WARNING: ". join(" ", @_). "\n";
}
......@@ -683,7 +708,7 @@ sub mtr_warning (@) {
# Print error to screen and then exit
sub mtr_error (@) {
IO::Handle::flush(\*STDOUT) if IS_WINDOWS;
flush_out();
print STDERR _name(). _timestamp().
"mysql-test-run: *** ERROR: ". join(" ", @_). "\n";
if (IS_WINDOWS)
......
#remove this include after fix MDEV-27871
--source include/no_view_protocol.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
......@@ -248,7 +246,9 @@ SET sql_mode=DEFAULT;
--echo # in Item::print_item_w_name on SELECT w/ optimizer_trace enabled
--echo #
--disable_view_protocol
SELECT '' LIMIT 0;
--enable_view_protocol
--error ER_WRONG_COLUMN_NAME
CREATE TABLE t1 AS SELECT '';
......@@ -320,7 +320,9 @@ create or replace table t2 (b int);
insert into t1 values(111111111),(-2147483648);
insert into t2 values(1),(2);
--enable_metadata
--disable_view_protocol
select t1.a as a1 from t1 as t1,t2 order by t2.b,t1.a;
--enable_view_protocol
--disable_metadata
drop table t1,t2;
......
......@@ -1973,8 +1973,7 @@ ALTER TABLE ti1 DROP FOREIGN KEY fi1;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tm1 DROP FOREIGN KEY fm1;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
ERROR 42000: Can't DROP FOREIGN KEY `fm1`; check that it exists
ALTER TABLE ti1 RENAME TO ti3;
affected rows: 0
ALTER TABLE tm1 RENAME TO tm3;
......
......@@ -1688,6 +1688,7 @@ ALTER TABLE ti1 DROP PRIMARY KEY;
ALTER TABLE tm1 DROP PRIMARY KEY;
ALTER TABLE ti1 DROP FOREIGN KEY fi1;
--error ER_CANT_DROP_FIELD_OR_KEY
ALTER TABLE tm1 DROP FOREIGN KEY fm1;
ALTER TABLE ti1 RENAME TO ti3;
......
......@@ -417,5 +417,41 @@ test t1 B 1 NULL
test t1 B 2 NULL
drop table t1;
#
# Crash inis_eits_usable()
#
CREATE TABLE t1 (a int) ENGINE=MyISAM;
CREATE TABLE t2 (b int) ENGINE=MyISAM;
INSERT INTO t1 (a) VALUES (4), (6);
INSERT INTO t2 (b) VALUES (0), (8);
set @save_join_cache_level=@@join_cache_level;
set @save_optimizer_switch=@@optimizer_switch;
SET join_cache_level=3;
SET optimizer_switch='join_cache_hashed=on';
SET optimizer_switch='join_cache_bka=on';
set optimizer_switch='hash_join_cardinality=on';
EXPLAIN
SELECT * FROM t1, t2 WHERE b=a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
SELECT * FROM t1, t2 WHERE b=a;
a b
DROP TABLE t1,t2;
set @@optimizer_switch=@save_optimizer_switch;
set @@join_cache_level=@save_join_cache_level;
#
# MDEV-32531 MSAN / Valgrind errors in Item_func_like::get_mm_leaf with
# temporal field
#
CREATE TABLE t1 (f DATE);
INSERT INTO t1 VALUES ('1978-08-27'),('1906-04-30');
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
SELECT * FROM t1 WHERE f LIKE '2023%';
f
DROP TABLE t1;
#
# End of 10.6 tests
#
......@@ -269,6 +269,43 @@ alter ignore table t1 rename key `b` to `B`, LOCK=shared;
select * from mysql.index_stats where table_name= "t1";
drop table t1;
--echo #
--echo # Crash inis_eits_usable()
--echo #
CREATE TABLE t1 (a int) ENGINE=MyISAM;
CREATE TABLE t2 (b int) ENGINE=MyISAM;
INSERT INTO t1 (a) VALUES (4), (6);
INSERT INTO t2 (b) VALUES (0), (8);
set @save_join_cache_level=@@join_cache_level;
set @save_optimizer_switch=@@optimizer_switch;
SET join_cache_level=3;
SET optimizer_switch='join_cache_hashed=on';
SET optimizer_switch='join_cache_bka=on';
set optimizer_switch='hash_join_cardinality=on';
EXPLAIN
SELECT * FROM t1, t2 WHERE b=a;
SELECT * FROM t1, t2 WHERE b=a;
DROP TABLE t1,t2;
set @@optimizer_switch=@save_optimizer_switch;
set @@join_cache_level=@save_join_cache_level;
--echo #
--echo # MDEV-32531 MSAN / Valgrind errors in Item_func_like::get_mm_leaf with
--echo # temporal field
--echo #
CREATE TABLE t1 (f DATE);
INSERT INTO t1 VALUES ('1978-08-27'),('1906-04-30');
ANALYZE TABLE t1 PERSISTENT FOR ALL;
SELECT * FROM t1 WHERE f LIKE '2023%';
DROP TABLE t1;
--echo #
--echo # End of 10.6 tests
--echo #
......@@ -95,7 +95,7 @@ drop table t1;
#
# BACKUP STAGE performs implicit commits
#
create table t1(a int) engine=InnoDB;
create table t1(a int) stats_persistent=0, engine=InnoDB;
begin;
insert into t1 values(1);
select lock_mode from information_schema.metadata_lock_info where thread_id>0;
......@@ -197,8 +197,9 @@ drop table t1;
# CHECK: RO transaction under BACKUP STAGE is a potential deadlock
# OTOH we most probably allow them under FTWRL as well
#
CREATE TABLE t1 (col1 INT) ENGINE = InnoDB;
CREATE TABLE t1 (col1 INT)stats_persistent=0, ENGINE = InnoDB;
insert into t1 values (1);
InnoDB 0 transactions not purged
backup stage start;
backup stage block_commit;
begin;
......
......@@ -120,7 +120,7 @@ drop table t1;
--echo # BACKUP STAGE performs implicit commits
--echo #
--disable_view_protocol
create table t1(a int) engine=InnoDB;
create table t1(a int) stats_persistent=0, engine=InnoDB;
begin;
insert into t1 values(1);
select lock_mode from information_schema.metadata_lock_info where thread_id>0;
......@@ -221,8 +221,9 @@ drop table t1;
--echo # OTOH we most probably allow them under FTWRL as well
--echo #
--disable_view_protocol
CREATE TABLE t1 (col1 INT) ENGINE = InnoDB;
CREATE TABLE t1 (col1 INT)stats_persistent=0, ENGINE = InnoDB;
insert into t1 values (1);
--source ../suite/innodb/include/wait_all_purged.inc
backup stage start;
backup stage block_commit;
begin;
......
#
# Testing which locks we get from all stages
#
InnoDB 0 transactions not purged
BACKUP STAGE START;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info
WHERE TABLE_NAME NOT LIKE 'innodb_%_stats';
......@@ -34,7 +35,8 @@ connection default;
#
# testing if BACKUP STAGE FLUSH causes deadlocks with ALTER TABLE
#
create table t1 (a int) engine=innodb;
create table t1 (a int) stats_persistent= 0, engine=innodb;
InnoDB 0 transactions not purged
connection con2;
backup stage start;
connection default;
......@@ -104,7 +106,8 @@ drop table t1;
#
# testing if BACKUP STAGE FLUSH causes deadlocks with DROP TABLE
#
create table t1 (a int) engine=innodb;
create table t1 (a int)stats_persistent=0, engine=innodb;
InnoDB 0 transactions not purged
start transaction;
insert into t1 values (1);
connection con1;
......@@ -132,6 +135,7 @@ connection default;
# Check if backup stage block_dll + concurrent drop table blocks select
#
create table t1 (a int) engine=innodb;
InnoDB 0 transactions not purged
backup stage start;
backup stage block_ddl;
connection con1;
......
......@@ -15,6 +15,8 @@
let $mdl= LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info
WHERE TABLE_NAME NOT LIKE 'innodb_%_stats';
--source ../suite/innodb/include/wait_all_purged.inc
BACKUP STAGE START;
eval SELECT $mdl;
BACKUP STAGE FLUSH;
......@@ -39,7 +41,8 @@ connection default;
--echo # testing if BACKUP STAGE FLUSH causes deadlocks with ALTER TABLE
--echo #
create table t1 (a int) engine=innodb;
create table t1 (a int) stats_persistent= 0, engine=innodb;
--source ../suite/innodb/include/wait_all_purged.inc
connection con2;
backup stage start;
......@@ -129,7 +132,8 @@ drop table t1;
--echo # testing if BACKUP STAGE FLUSH causes deadlocks with DROP TABLE
--echo #
create table t1 (a int) engine=innodb;
create table t1 (a int)stats_persistent=0, engine=innodb;
--source ../suite/innodb/include/wait_all_purged.inc
start transaction;
# Acquires MDL lock
insert into t1 values (1);
......@@ -165,6 +169,7 @@ connection default;
--echo #
create table t1 (a int) engine=innodb;
--source ../suite/innodb/include/wait_all_purged.inc
backup stage start;
backup stage block_ddl;
connection con1;
......
......@@ -23,7 +23,7 @@ BACKUP UNLOCK;
#
connect con1,localhost,root,,;
connection default;
create table t1 (a int) engine=innodb;
create table t1 (a int) stats_persistent=0,engine=innodb;
insert into t1 values (1);
backup lock t1;
select * from t1;
......@@ -184,5 +184,82 @@ ERROR HY000: Can't execute the query because you have a conflicting read lock
BACKUP UNLOCK;
DROP TABLE t3;
#
# MDEV-28367: BACKUP LOCKS on table to be accessible to those
# with database LOCK TABLES privileges
#
create database db1;
create table db1.t1(t int);
create user user1@localhost;
select user,host from mysql.user where user='user1';
User Host
user1 localhost
connect(localhost,user1,,db1,MASTER_PORT,MASTER_SOCKET);
connect con1, localhost, user1, ,db1;
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1'
grant reload on *.* to user1@localhost;
grant select on db1.* to user1@localhost;
show grants for user1@localhost;
Grants for user1@localhost
GRANT RELOAD ON *.* TO `user1`@`localhost`
GRANT SELECT ON `db1`.* TO `user1`@`localhost`
connect con1, localhost, user1, ,db1;
BACKUP UNLOCK;
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock db1 t1
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
connection default;
disconnect con1;
grant lock tables on db1.* to user1@localhost;
show grants for user1@localhost;
Grants for user1@localhost
GRANT RELOAD ON *.* TO `user1`@`localhost`
GRANT SELECT, LOCK TABLES ON `db1`.* TO `user1`@`localhost`
connect con1, localhost, user1, ,db1;
BACKUP UNLOCK;
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock db1 t1
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
connection default;
disconnect con1;
revoke reload on *.* from user1@localhost;
show grants for user1@localhost;
Grants for user1@localhost
GRANT USAGE ON *.* TO `user1`@`localhost`
GRANT SELECT, LOCK TABLES ON `db1`.* TO `user1`@`localhost`
connect con1, localhost, user1, ,db1;
BACKUP UNLOCK;
ERROR 42000: Access denied; you need (at least one of) the RELOAD, LOCK TABLES privilege(s) for this operation
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock db1 t1
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
connection default;
disconnect con1;
revoke lock tables on db1.* from user1@localhost;
show grants for user1@localhost;
Grants for user1@localhost
GRANT USAGE ON *.* TO `user1`@`localhost`
GRANT SELECT ON `db1`.* TO `user1`@`localhost`
connect con1, localhost, user1, ,db1;
BACKUP LOCK db1.t1;
ERROR 42000: Access denied; you need (at least one of) the RELOAD, LOCK TABLES privilege(s) for this operation
BACKUP UNLOCK;
ERROR 42000: Access denied; you need (at least one of) the RELOAD, LOCK TABLES privilege(s) for this operation
connection default;
disconnect con1;
drop database db1;
drop user user1@localhost;
#
# End of MariaDB 10.4 tests
#
......@@ -29,7 +29,7 @@ BACKUP UNLOCK;
connect (con1,localhost,root,,);
connection default;
create table t1 (a int) engine=innodb;
create table t1 (a int) stats_persistent=0,engine=innodb;
insert into t1 values (1);
backup lock t1;
select * from t1;
......@@ -214,7 +214,78 @@ LOCK TABLES t3 AS a2 WRITE, t3 AS a1 READ LOCAL;
DROP TABLE t3;
BACKUP UNLOCK;
DROP TABLE t3;
--echo #
--echo # MDEV-28367: BACKUP LOCKS on table to be accessible to those
--echo # with database LOCK TABLES privileges
--echo #
--source include/have_metadata_lock_info.inc
create database db1;
create table db1.t1(t int);
create user user1@localhost;
select user,host from mysql.user where user='user1';
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_DBACCESS_DENIED_ERROR
--connect (con1, localhost, user1, ,db1)
grant reload on *.* to user1@localhost;
# To access DB one need select privileges
grant select on db1.* to user1@localhost;
show grants for user1@localhost;
--connect (con1, localhost, user1, ,db1)
# This should work we have RELOAD privilege
BACKUP UNLOCK;
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
# Add LOCK TABLES DB privileges (all privileges for BACKUP LOCK are there)
connection default;
disconnect con1;
grant lock tables on db1.* to user1@localhost;
show grants for user1@localhost;
--connect (con1, localhost, user1, ,db1)
# This should work we have RELOAD & LOCK privilege
BACKUP UNLOCK;
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
# Remove reload privilege, leave only LOCK TABLES privilege
connection default;
disconnect con1;
revoke reload on *.* from user1@localhost;
show grants for user1@localhost;
--connect (con1, localhost, user1, ,db1)
# There is no reload priv needed for unlock and there is no mdl_backup_lock taken
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP UNLOCK;
# BACKUP LOCK should work, since we have LOCK privilege
BACKUP LOCK db1.t1;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
# This works since there was taken mdl_backup_lock before
BACKUP UNLOCK;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
# Remove LOCK TABLES privilege
connection default;
disconnect con1;
revoke lock tables on db1.* from user1@localhost;
show grants for user1@localhost;
--connect (con1, localhost, user1, ,db1)
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP LOCK db1.t1;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP UNLOCK;
connection default;
disconnect con1;
drop database db1;
drop user user1@localhost;
--echo #
--echo # End of MariaDB 10.4 tests
--echo #
......@@ -17,6 +17,7 @@ FROM information_schema.processlist WHERE id = @con1_id;
ID USER COMMAND STATE INFO STAGE MAX_STAGE INFO_BINARY
<con1_id> root Query Waiting for backup lock BACKUP STAGE START 0 0 BACKUP STAGE START
BACKUP STAGE END;
InnoDB 0 transactions not purged
connection con1;
# The connection default has removed the backup lock.
# And so the current connection con1 can reap for its BACKUP STAGE START
......
......@@ -50,6 +50,7 @@ FROM information_schema.processlist WHERE id = @con1_id;
# con1 uses @@global.lock_wait_timeout
BACKUP STAGE END;
--source ../suite/innodb/include/wait_all_purged.inc
--connection con1
--echo # The connection default has removed the backup lock.
......
drop table if exists t1, t2;
select CASE "b" when "a" then 1 when "b" then 2 END;
CASE "b" when "a" then 1 when "b" then 2 END
select CASE "b" when "a" then 1 when "b" then 2 END as exp;
exp
2
select CASE "c" when "a" then 1 when "b" then 2 END;
CASE "c" when "a" then 1 when "b" then 2 END
select CASE "c" when "a" then 1 when "b" then 2 END as exp;
exp
NULL
select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END;
CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END
select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END as exp;
exp
3
select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END;
CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END
select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END as exp;
exp
ok
select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END;
CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END
select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END as exp;
exp
ok
select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end;
CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end
select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end as exp;
exp
a
select CASE when 1=0 then "true" else "false" END;
CASE when 1=0 then "true" else "false" END
select CASE when 1=0 then "true" else "false" END as exp;
exp
false
select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END
select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END as exp;
exp
one
explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END as exp;
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
Warnings:
Note 1003 select case 1 when 1 then 'one' when 2 then 'two' else 'more' end AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END`
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END
Note 1003 select case 1 when 1 then 'one' when 2 then 'two' else 'more' end AS `exp`
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END as exp;
exp
two
select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0;
(CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0
select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0 as exp;
exp
2
select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0;
(CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0
select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0 as exp;
exp
2.00
select case 1/0 when "a" then "true" else "false" END;
case 1/0 when "a" then "true" else "false" END
select case 1/0 when "a" then "true" else "false" END as exp;
exp
false
Warnings:
Warning 1365 Division by 0
select case 1/0 when "a" then "true" END;
case 1/0 when "a" then "true" END
select case 1/0 when "a" then "true" END as exp;
exp
NULL
Warnings:
Warning 1365 Division by 0
select (case 1/0 when "a" then "true" END) | 0;
(case 1/0 when "a" then "true" END) | 0
select (case 1/0 when "a" then "true" END) | 0 as exp;
exp
NULL
Warnings:
Warning 1365 Division by 0
select (case 1/0 when "a" then "true" END) + 0.0;
(case 1/0 when "a" then "true" END) + 0.0
select (case 1/0 when "a" then "true" END) + 0.0 as exp;
exp
NULL
Warnings:
Warning 1365 Division by 0
select case when 1>0 then "TRUE" else "FALSE" END;
case when 1>0 then "TRUE" else "FALSE" END
select case when 1>0 then "TRUE" else "FALSE" END as exp;
exp
TRUE
select case when 1<0 then "TRUE" else "FALSE" END;
case when 1<0 then "TRUE" else "FALSE" END
select case when 1<0 then "TRUE" else "FALSE" END as exp;
exp
FALSE
create table t1 (a int);
insert into t1 values(1),(2),(3),(4);
......@@ -133,12 +133,12 @@ WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2
END;
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_danish_ci,EXPLICIT), (latin1_swedish_ci,EXPLICIT) for operation 'case'
SELECT
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END as e1,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END as e2,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END as e3,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END as e4
;
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
e1 e2 e3 e4
1 2 1 2
CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a');
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'coalesce'
......@@ -403,8 +403,8 @@ DROP TABLE t1;
#
# End of 10.1 test
#
select case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end;
case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end
select case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end as exp;
exp
ok
Warnings:
Warning 1292 Truncated incorrect time value: 'foo'
......@@ -434,8 +434,8 @@ Warning 1292 Truncated incorrect time value: 'foo'
Warning 1292 Truncated incorrect time value: 'foo'
Warning 1292 Truncated incorrect time value: 'foo'
drop table t1;
select case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end;
case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end
select case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end as exp;
exp
ok
#
# End of 10.2 test
......
......@@ -2,31 +2,29 @@
# Testing of CASE
#
#remove this include after fix MDEV-27871
--source include/no_view_protocol.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
select CASE "b" when "a" then 1 when "b" then 2 END;
select CASE "c" when "a" then 1 when "b" then 2 END;
select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END;
select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END;
select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END;
select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end;
select CASE when 1=0 then "true" else "false" END;
select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0;
select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0;
select case 1/0 when "a" then "true" else "false" END;
select case 1/0 when "a" then "true" END;
select (case 1/0 when "a" then "true" END) | 0;
select (case 1/0 when "a" then "true" END) + 0.0;
select case when 1>0 then "TRUE" else "FALSE" END;
select case when 1<0 then "TRUE" else "FALSE" END;
select CASE "b" when "a" then 1 when "b" then 2 END as exp;
select CASE "c" when "a" then 1 when "b" then 2 END as exp;
select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END as exp;
select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END as exp;
select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END as exp;
select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end as exp;
select CASE when 1=0 then "true" else "false" END as exp;
select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END as exp;
explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END as exp;
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END as exp;
select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0 as exp;
select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0 as exp;
select case 1/0 when "a" then "true" else "false" END as exp;
select case 1/0 when "a" then "true" END as exp;
select (case 1/0 when "a" then "true" END) | 0 as exp;
select (case 1/0 when "a" then "true" END) + 0.0 as exp;
select case when 1>0 then "TRUE" else "FALSE" END as exp;
select case when 1<0 then "TRUE" else "FALSE" END as exp;
#
# Test bug when using GROUP BY on CASE
......@@ -83,10 +81,10 @@ SELECT CASE _latin1'a' COLLATE latin1_general_ci
END;
SELECT
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END as e1,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END as e2,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END as e3,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END as e4
;
#
......@@ -297,7 +295,7 @@ DROP TABLE t1;
#
# should not convert all values to time
select case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end;
select case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end as exp;
select 'foo' in (time'10:00:00','0');
create table t1 (a time);
......@@ -308,7 +306,7 @@ select 'foo' in (a,'0') from t1;
drop table t1;
# first comparison should be as date, second as time
select case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end;
select case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end as exp;
--echo #
--echo # End of 10.2 test
......
No preview for this file type
......@@ -2,10 +2,6 @@
# Test of cast function
#
#remove this include after fix MDEV-27871
# discuss what to do with "set names binary"
--source include/no_view_protocol.inc
# For TIME->DATETIME conversion
SET timestamp=unix_timestamp('2001-02-03 10:20:30');
......@@ -27,41 +23,41 @@ select cast(null as double(5,2));
select cast(12.444 as double);
select cast(cast("20:01:01" as time) as datetime);
select cast(cast("8:46:06.23434" AS time) as decimal(32,10));
select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as decimal(32,6));
select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as decimal(32,6)) as exp;
--echo #
--echo # Check handling of cast with microseconds
--echo #
select cast(cast(20010203101112.121314 as double) as datetime);
select cast(cast(010203101112.12 as double) as datetime);
select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime);
select cast(20010203101112.121314 as datetime);
select cast(110203101112.121314 as datetime);
select cast(cast(010203101112.12 as double) as datetime);
select cast("2011-02-03 10:11:12.123456" as datetime);
select cast("2011-02-03 10:11:12.123456" as datetime(0));
select cast("2011-02-03 10:11:12.123456" as datetime(5));
select cast("2011-02-03 10:11:12.123456" as datetime(6));
select cast("2011-02-03 10:11:12" as datetime(6));
select cast(cast(20010203101112.5 as double) as datetime(1));
select cast(cast(010203101112.12 as double) as datetime(2));
select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime(6));
select cast(20010203101112.121314 as datetime(6));
select cast(110203101112.121314 as datetime(6));
select cast(cast(010203101112.12 as double) as datetime(6));
select cast("2011-02-03 10:11:12.123456" as time);
select cast("2011-02-03 10:11:12.123456" as time(6));
select cast("10:11:12.123456" as time);
select cast("10:11:12.123456" as time(0));
select cast("10:11:12.123456" as time(5));
select cast("10:11:12.123456" as time(6));
select cast("10:11:12" as time(6));
select cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time);
select cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time(6));
select cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time);
select cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time(6));
select cast(cast(20010203101112.121314 as double) as datetime) as exp;
select cast(cast(010203101112.12 as double) as datetime) as exp;
select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime) as exp;
select cast(20010203101112.121314 as datetime) as exp;
select cast(110203101112.121314 as datetime) as exp;
select cast(cast(010203101112.12 as double) as datetime) as exp;
select cast("2011-02-03 10:11:12.123456" as datetime) as exp;
select cast("2011-02-03 10:11:12.123456" as datetime(0)) as exp;
select cast("2011-02-03 10:11:12.123456" as datetime(5)) as exp;
select cast("2011-02-03 10:11:12.123456" as datetime(6)) as exp;
select cast("2011-02-03 10:11:12" as datetime(6)) as exp;
select cast(cast(20010203101112.5 as double) as datetime(1)) as exp;
select cast(cast(010203101112.12 as double) as datetime(2)) as exp;
select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime(6)) as exp;
select cast(20010203101112.121314 as datetime(6)) as exp;
select cast(110203101112.121314 as datetime(6)) as exp;
select cast(cast(010203101112.12 as double) as datetime(6)) as exp;
select cast("2011-02-03 10:11:12.123456" as time) as exp;
select cast("2011-02-03 10:11:12.123456" as time(6)) as exp;
select cast("10:11:12.123456" as time) as exp;
select cast("10:11:12.123456" as time(0)) as exp;
select cast("10:11:12.123456" as time(5)) as exp;
select cast("10:11:12.123456" as time(6)) as exp;
select cast("10:11:12" as time(6)) as exp;
select cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time) as exp;
select cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time(6)) as exp;
select cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time) as exp;
select cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time(6)) as exp;
#
# Bug #28250: Run-Time Check Failure #3 - The variable 'value' is being used
......@@ -162,7 +158,9 @@ select cast(1 as double(64,63));
#
set names binary;
select cast(_latin1'test' as char character set latin2);
--disable_service_connection
select cast(_koi8r'' as char character set cp1251);
--enable_service_connection
create table t1 select cast(_koi8r'' as char character set cp1251) as t;
show create table t1;
drop table t1;
......@@ -170,6 +168,7 @@ drop table t1;
#
# CAST to CHAR with/without length
#
--disable_service_connection
select
cast(_latin1'ab' AS char) as c1,
cast(_latin1'a ' AS char) as c2,
......@@ -177,6 +176,7 @@ select
cast(_latin1'a ' AS char(2)) as c4,
hex(cast(_latin1'a' AS char(2))) as c5;
select cast(1000 as CHAR(3));
--enable_service_connection
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 select
......@@ -237,12 +237,14 @@ select cast("1:2:3" as TIME) = "1:02:03";
#
CREATE TABLE t1 (a enum ('aac','aab','aaa') not null);
INSERT INTO t1 VALUES ('aaa'),('aab'),('aac');
--disable_service_connection
# these two should be in enum order
SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ;
SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a;
# these two should be in alphabetic order
SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ;
SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a;
--enable_service_connection
DROP TABLE t1;
#
......@@ -344,9 +346,11 @@ select cast(NULL as decimal(6)) as t1;
# Bug #17903: cast to char results in binary
#
set names latin1;
--disable_service_connection
select hex(cast('a' as char(2) binary));
select hex(cast('a' as binary(2)));
select hex(cast('a' as char(2) binary));
--enable_service_connection
#
# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
......@@ -476,11 +480,13 @@ drop table t1;
#
# CAST (... BINARY)
#
--disable_service_connection
select collation(cast("a" as char(10) binary));
select collation(cast("a" as char(10) charset utf8 binary));
select collation(cast("a" as char(10) ascii binary));
select collation(cast("a" as char(10) binary charset utf8));
select collation(cast("a" as char(10) binary ascii));
--enable_service_connection
--echo #
--echo # MDEV-11030 Assertion `precision > 0' failed in decimal_bin_size
......@@ -762,11 +768,14 @@ INSERT INTO t1 VALUES (-1.0);
SELECT * FROM t1;
DROP TABLE t1;
#enable after MDEV-32645 is fixed
--disable_view_protocol
SELECT CAST(-1e0 AS UNSIGNED);
CREATE TABLE t1 (a BIGINT UNSIGNED);
INSERT INTO t1 VALUES (-1e0);
SELECT * FROM t1;
DROP TABLE t1;
--enable_view_protocol
SELECT CAST(-1e308 AS UNSIGNED);
CREATE TABLE t1 (a BIGINT UNSIGNED);
......
set global secure_auth=0;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
create user test_nopw;
grant select on test.* to test_nopw;
create user test_oldpw identified by password "09301740536db389";
......@@ -90,6 +92,8 @@ NULL
FLUSH STATUS;
Value of com_select did not change
set global secure_auth=default;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
set timestamp=unix_timestamp('2010-10-10 10:10:10');
select now();
now()
......
......@@ -308,6 +308,19 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
#
# MDEV-32586 incorrect error about cyclic reference about JSON type virtual column
#
create table t1 (a int, b json as (a));
drop table t1;
create table t1 (a int, b int as (a) check (b > 0));
insert t1 (a) values (1);
insert t1 (a) values (-1);
ERROR 23000: CONSTRAINT `t1.b` failed for `test`.`t1`
drop table t1;
#
# End of 10.4 tests
#
#
# MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
#
CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
......
......@@ -231,6 +231,23 @@ alter table t1 force;
show create table t1;
drop table t1;
--echo #
--echo # MDEV-32586 incorrect error about cyclic reference about JSON type virtual column
--echo #
create table t1 (a int, b json as (a));
drop table t1;
create table t1 (a int, b int as (a) check (b > 0));
insert t1 (a) values (1);
--error ER_CONSTRAINT_FAILED
insert t1 (a) values (-1);
drop table t1;
--echo #
--echo # End of 10.4 tests
--echo #
--echo #
--echo # MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
--echo #
......
SET global secure_auth=0;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
connect con1,localhost,root,,mysql;
show tables;
Tables_in_mysql
......@@ -412,6 +414,8 @@ test
test
drop procedure p1;
SET global secure_auth=default;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
#
# MDEV-19282: Log more specific warning with log_warnings=2 if
# connection is aborted prior to authentication
......
......@@ -260,6 +260,7 @@ Note 1051 Unknown table 'test.t1,mysqltest2.t2'
create table test.t1 (i int) engine=myisam;
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
InnoDB 0 transactions not purged
select * from information_schema.metadata_lock_info;
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
......
......@@ -216,6 +216,7 @@ drop table if exists test.t1,mysqltest2.t2;
create table test.t1 (i int) engine=myisam;
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
--source ../suite/innodb/include/wait_all_purged.inc
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
......
This diff is collapsed.
#
# Test character set narrowing
#
--source include/have_utf8mb4.inc
--source include/have_sequence.inc
--source include/not_embedded.inc
set
@tmp_csetn_os= @@optimizer_switch,
optimizer_switch='cset_narrowing=on';
set names utf8mb4;
create table t1 (
mb3name varchar(32),
mb3 varchar(32) collate utf8mb3_general_ci,
key(mb3)
);
insert into t1 select seq, seq from seq_1_to_10000;
insert into t1 values ('mb3-question-mark', '?');
insert into t1 values ('mb3-replacement-char', _utf8mb3 0xEFBFBD);
create table t10 (
pk int auto_increment primary key,
mb4name varchar(32),
mb4 varchar(32) character set utf8mb4 collate utf8mb4_general_ci
);
insert into t10 (mb4name, mb4) values
('mb4-question-mark','?'),
('mb4-replacement-char', _utf8mb4 0xEFBFBD),
('mb4-smiley', _utf8mb4 0xF09F988A),
('1', '1');
analyze table t1,t10 persistent for all;
--echo #
--echo # Check that constants are already handled: the following should use
--echo # ref/range, because constants are converted into utf8mb3.
--echo #
select collation('abc');
explain select * from t1 force index (mb3) where t1.mb3='abc';
explain select * from t1 force index (mb3) where t1.mb3 in ('abc','cde','xyz');
explain select * from t1 force index (mb3) where t1.mb3 between 'abc' and 'acc';
explain select * from t1 force index (mb3) where t1.mb3 <'000';
--echo # If a constant can't be represented in utf8mb3, an error is produced:
--error ER_CANT_AGGREGATE_2COLLATIONS
explain select * from t1 force index (mb3) where t1.mb3='😊';
--echo #
--echo # Check ref access on mb3_field=mb4_field
--echo #
--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t10.mb4=t1.mb3;
select * from t10,t1 where t10.mb4=t1.mb3;
select * from t10,t1 use index() where t10.mb4=t1.mb3;
--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t10.mb4<=>t1.mb3;
select * from t10,t1 where t10.mb4<=>t1.mb3;
--source include/explain-no-costs.inc
set statement optimizer_switch='cset_narrowing=off', join_cache_level=0 for
explain format=json
select * from t10,t1 where t10.mb4=t1.mb3;
--echo #
--echo # Check ref access on mb3_field=mb4_expr
--echo #
--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t1.mb3=concat('',t10.mb4);
select * from t10,t1 where t1.mb3=concat('',t10.mb4);
select * from t10,t1 use index() where t1.mb3=concat('',t10.mb4);
--echo # Check that ref optimizer gets the right constant.
--echo # We need a const table for that, because key=const is handled by
--echo # coercing the constant.
--echo #
--echo # So, we take the smiley:
select * from t10 where t10.pk=3;
set optimizer_trace=1;
--echo # And see that we've got the Replacement Character in the ranges:
explain
select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3;
--source include/explain-no-costs.inc
select
json_detailed(json_extract(trace, '$**.range_scan_alternatives')) as JS
from
information_schema.optimizer_trace;
select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3;
--echo #
--echo # Will range optimizer handle t1.mb3>t10.mb4? No...
--echo #
--source include/explain-no-costs.inc
explain format=json
select * from t10, t1 where (t1.mb3=t10.mb4 or t1.mb3='hello') and t10.pk=3;
--source include/explain-no-costs.inc
explain format=json
select * from t10, t1 where t1.mb3>t10.mb4 and t10.pk=3;
--echo # For comparison, it will handle it when collations match:
create table t2 (
mb4name varchar(32),
mb4 varchar(32) collate utf8mb4_general_ci,
key(mb4)
);
insert into t2 select * from t1;
--source include/explain-no-costs.inc
explain format=json
select * from t10, t2 where t2.mb4>t10.mb4 and t10.pk=3;
--echo #
--echo # Check multiple equalities
--echo #
--echo # - ref acccess lookup keys do use equality substitution,
--echo # - concat() arguments don't
--source include/explain-no-costs.inc
explain format=json
select straight_join * from t10,t1 force index(mb3),t2
where
t1.mb3=t2.mb4 and t2.mb4=t10.mb4 and concat(t1.mb3, t2.mb4, t10.mb4)<>'Bebebe';
select json_detailed(json_extract(trace, '$**.condition_processing')) as JS
from information_schema.optimizer_trace;
select straight_join * from t10,t1 force index(mb3),t2
where
t1.mb3=t2.mb4 and t2.mb4=t10.mb4 and concat(t1.mb3, t2.mb4, t10.mb4)<>'Bebebe';
--echo # Equality substitution doesn't happen for constants, for both narrowing
--echo # and non-narrowing comparisons:
--source include/explain-no-costs.inc
explain format=json
select * from t10,t1,t2
where
t1.mb3=t2.mb4 and t2.mb4=t10.mb4 and t10.mb4='hello' and
concat(t1.mb3, t2.mb4, t10.mb4)<>'Bebebe';
select json_detailed(json_extract(trace, '$**.condition_processing')) as JS
from information_schema.optimizer_trace;
drop table t2;
drop table t1, t10;
set optimizer_switch=@tmp_csetn_os;
This diff is collapsed.
......@@ -1796,4 +1796,187 @@ with data as (select 1 as id)
select id into @myid from data;
set sql_mode= @save_sql_mode;
--echo #
--echo # MDEV-31995 Bogus error executing PS for query using CTE with renaming of columns
--echo #
create table t1 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2);
create table t2 (a int, b int);
insert into t2 values (3,1),(3,2),(3,3),(4,1),(4,2);
let $q=
with cte (c1,c2) as
(select a as col1, sum(b) as col2 from t1 group by col1)
select * from cte;
eval $q;
eval prepare st from "$q";
execute st;
execute st;
drop prepare st;
eval create procedure sp() $q;
call sp();
call sp();
drop procedure sp;
let $q=
with cte (c1,c2) as
(select a as col1, sum(b) as col2 from t1 order by col1)
select * from cte;
eval $q;
eval prepare st from "$q";
execute st;
execute st;
drop prepare st;
eval create procedure sp() $q;
call sp();
call sp();
drop procedure sp;
let $q=
with cte (c1,c2) as
(select a as col1, sum(b) as col2 from t1 where a > 1 group by col1
union select a as col3, sum(b) as col4 from t2 where b > 2 group by col3),
cte2 (c3, c4) as
(select a as col5, sum(b) as col6 from t1 where a <= 1 group by col5
union select a as col7, sum(b) as col8 from t2 where b <= 2 group by col7)
select * from cte where c1=1 union select * from cte2 where c3=3;
eval $q;
eval prepare st from "$q";
execute st;
execute st;
drop prepare st;
eval create procedure sp() $q;
call sp();
call sp();
drop procedure sp;
let $q=
with cte (c1,c2) as (select * from t1)
select cte.c1+1 as col1 , cte.c2 as col2 from cte where cte.c1 > 1
union
select cte.c1 as col3, cte.c2+1 as col4 from cte where cte.c1 < 0;
eval $q;
eval prepare st from "$q";
execute st;
execute st;
--echo save this to the end to test errors >drop prepare st;
eval create procedure sp() $q;
call sp();
call sp();
drop procedure sp;
insert into t1 select * from t2;
let $q=
with cte (c1, c2)
as (select a, sum(b) from t1 where b > 1 group by a having sum(b) < 5)
select * from cte where c1 < 4 and c2 > 1;
eval $q;
--echo # Check pushdown conditions in JSON output
--source include/analyze-format.inc
eval explain format=json $q;
alter table t1 add column c int;
--error ER_WITH_COL_WRONG_LIST
execute st;
drop prepare st;
drop table t1,t2;
--echo Test out recursive CTEs
create table distances (src char(1), dest char(1), distance int);
create table city_population (city char(1), population int);
INSERT INTO `distances` VALUES ('A','A',0),('B','A',593),('C','A',800),
('D','A',221),('E','A',707),('F','A',869),('G','A',225),('H','A',519),
('A','B',919),('B','B',0),('C','B',440),('D','B',79),('E','B',79),
('F','B',154),('G','B',537),('H','B',220),('A','C',491),('B','C',794),
('C','C',0),('D','C',100),('E','C',350),('F','C',748),('G','C',712),
('H','C',315),('A','D',440),('B','D',256),('C','D',958),('D','D',0),
('E','D',255),('F','D',161),('G','D',63),('H','D',831),('A','E',968),
('B','E',345),('C','E',823),('D','E',81),('E','E',0),('F','E',436),
('G','E',373),('H','E',558),('A','F',670),('B','F',677),('C','F',375),
('D','F',843),('E','F',90),('F','F',0),('G','F',328),('H','F',881),
('A','G',422),('B','G',467),('C','G',67),('D','G',936),('E','G',480),
('F','G',592),('G','G',0),('H','G',819),('A','H',537),('B','H',229),
('C','H',534),('D','H',984),('E','H',319),('F','H',643),('G','H',257),
('H','H',0);
insert into city_population values ('A', 5000), ('B', 6000), ('C', 100000),
('D', 80000), ('E', 7000), ('F', 1000), ('G', 100), ('H', -80000);
--echo #find the biggest city within 300 kellikams of 'E'
let $q=
with recursive travel (src, path, dest, distance, population) as (
select city, cast('' as varchar(10)), city,
0, population
from city_population where city='E'
union all
select src.src, concat(src.path, dst.dest), dst.dest,
src.distance + dst.distance, dstc.population
from travel src
join distances dst on src.dest != dst.dest
join city_population dstc on dst.dest = dstc.city
where dst.src = src.dest and src.distance + dst.distance < 300
and length(path) < 10
)
select * from travel where dest != 'E' order by population desc, distance
limit 1;
eval $q;
eval prepare st from "$q";
execute st;
execute st;
drop prepare st;
eval create procedure sp() $q;
call sp();
call sp();
drop procedure sp;
drop table distances, city_population;
--echo #
--echo # MDEV-28615: Multi-table UPDATE over derived table containing
--echo # row that uses subquery with hanging CTE
--echo #
CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (3), (7), (1);
--error ER_OPERAND_COLUMNS
UPDATE
(SELECT (5, (WITH cte AS (SELECT 1) SELECT a FROM t1))) dt
JOIN t1 t
ON t.a=dt.a
SET t.a = 1;
UPDATE
(SELECT a FROM t1
WHERE (5, (WITH cte AS (SELECT 1) SELECT a FROM t1 WHERE a > 4)) <=
(5,a)) dt
JOIN t1 t
ON t.a=dt.a
SET t.a = 1;
SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.4 tests
......@@ -3383,6 +3383,50 @@ INSERT INTO t VALUES (0,0);
DELETE FROM t WHERE c2<c1;
DROP TABLE t;
#
# MDEV-28835 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32 on INSERT
#
SET NAMES latin1,character_set_connection=binary;
# Binary format, binary result
SELECT DATE_FORMAT('2004-02-02','%W');
DATE_FORMAT('2004-02-02','%W')
Monday
SELECT HEX(DATE_FORMAT('2004-02-02','%W'));
HEX(DATE_FORMAT('2004-02-02','%W'))
4D6F6E646179
SELECT DATE_FORMAT(TIME'-01:01:01','%h');
DATE_FORMAT(TIME'-01:01:01','%h')
-01
SELECT HEX(DATE_FORMAT(TIME'-01:01:01','%h'));
HEX(DATE_FORMAT(TIME'-01:01:01','%h'))
2D3031
# latin1 format, binary result
SELECT DATE_FORMAT('2004-02-02',_latin1'%W');
DATE_FORMAT('2004-02-02',_latin1'%W')
Monday
SELECT HEX(DATE_FORMAT('2004-02-02',_latin1'%W'));
HEX(DATE_FORMAT('2004-02-02',_latin1'%W'))
4D6F6E646179
SELECT DATE_FORMAT(TIME'-01:01:01',_latin1'%h');
DATE_FORMAT(TIME'-01:01:01',_latin1'%h')
-01
SELECT HEX(DATE_FORMAT(TIME'-01:01:01',_latin1'%h'));
HEX(DATE_FORMAT(TIME'-01:01:01',_latin1'%h'))
2D3031
# Binary format, latin1 result
SET NAMES latin1;
SELECT DATE_FORMAT('2004-02-02',_binary'%W');
DATE_FORMAT('2004-02-02',_binary'%W')
Monday
SELECT HEX(DATE_FORMAT('2004-02-02',_binary'%W'));
HEX(DATE_FORMAT('2004-02-02',_binary'%W'))
4D6F6E646179
SELECT DATE_FORMAT(TIME'-01:01:01',_binary'%h');
DATE_FORMAT(TIME'-01:01:01',_binary'%h')
-01
SELECT HEX(DATE_FORMAT(TIME'-01:01:01',_binary'%h'));
HEX(DATE_FORMAT(TIME'-01:01:01',_binary'%h'))
2D3031
#
# End of 10.4 tests
#
#
......
......@@ -225,6 +225,31 @@ INSERT INTO t VALUES (0,0);
DELETE FROM t WHERE c2<c1;
DROP TABLE t;
--echo #
--echo # MDEV-28835 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32 on INSERT
--echo #
SET NAMES latin1,character_set_connection=binary;
--echo # Binary format, binary result
SELECT DATE_FORMAT('2004-02-02','%W');
SELECT HEX(DATE_FORMAT('2004-02-02','%W'));
SELECT DATE_FORMAT(TIME'-01:01:01','%h');
SELECT HEX(DATE_FORMAT(TIME'-01:01:01','%h'));
--echo # latin1 format, binary result
SELECT DATE_FORMAT('2004-02-02',_latin1'%W');
SELECT HEX(DATE_FORMAT('2004-02-02',_latin1'%W'));
SELECT DATE_FORMAT(TIME'-01:01:01',_latin1'%h');
SELECT HEX(DATE_FORMAT(TIME'-01:01:01',_latin1'%h'));
--echo # Binary format, latin1 result
SET NAMES latin1;
SELECT DATE_FORMAT('2004-02-02',_binary'%W');
SELECT HEX(DATE_FORMAT('2004-02-02',_binary'%W'));
SELECT DATE_FORMAT(TIME'-01:01:01',_binary'%h');
SELECT HEX(DATE_FORMAT(TIME'-01:01:01',_binary'%h'));
--echo #
--echo # End of 10.4 tests
--echo #
......
This diff is collapsed.
#remove this include after fix MDEV-27871
--source include/no_view_protocol.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
......@@ -248,16 +246,16 @@ drop table t1;
#
# Bug#41627 Illegal mix of collations in LEAST / GREATEST / CASE
#
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
create table t1
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
show create table t1;
drop table t1;
select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
latin5_turkish_ci then 2 else 3 end;
latin5_turkish_ci then 2 else 3 end as exp;
select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as exp;
--echo #
......
This diff is collapsed.
# remove this include in 10.6 version,
# if MDEV-27871 will be fix
--source include/no_view_protocol.inc
-- source include/have_eucjpms.inc
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment