mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge remote-tracking branch 'origin/11.2' into 11.4
This commit is contained in:
19
README.md
19
README.md
@@ -1,5 +1,4 @@
|
||||
Code status:
|
||||
------------
|
||||
# Code status:
|
||||
|
||||
* [](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com
|
||||
|
||||
@@ -33,20 +32,19 @@ https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/
|
||||
|
||||
https://mariadb.com/kb/en/new-and-old-releases/
|
||||
|
||||
Getting the code, building it and testing it
|
||||
---------------------------------------------------------------
|
||||
# Getting the code, building it and testing it
|
||||
|
||||
Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/ which outlines how to correctly build the source code and run the MariaDB testing framework.
|
||||
Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/
|
||||
which outlines how to build the source code correctly and run the MariaDB testing framework,
|
||||
as well as which branch to target for your contributions.
|
||||
|
||||
Help
|
||||
-----
|
||||
# Help
|
||||
|
||||
More help is available from the Maria Discuss mailing list
|
||||
https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/ and MariaDB's Zulip
|
||||
instance, https://mariadb.zulipchat.com/
|
||||
|
||||
Licensing
|
||||
---------
|
||||
# Licensing
|
||||
|
||||
***************************************************************************
|
||||
|
||||
@@ -60,8 +58,7 @@ license information can be found in the THIRDPARTY file.
|
||||
|
||||
***************************************************************************
|
||||
|
||||
Bug Reports
|
||||
------------
|
||||
# Bug Reports
|
||||
|
||||
Bug and/or error reports regarding MariaDB should be submitted at:
|
||||
https://jira.mariadb.org
|
||||
|
10
appveyor.yml
10
appveyor.yml
@@ -31,4 +31,14 @@ test_script:
|
||||
- set /A parallel=4*%NUMBER_OF_PROCESSORS%
|
||||
- perl mysql-test-run.pl --force --max-test-fail=10 --retry=2 --parallel=%parallel% --testcase-timeout=4 --suite=main --skip-test-list=%APPVEYOR_BUILD_FOLDER%\win\appveyor_skip_tests.txt --mysqld=--loose-innodb-flush-log-at-trx-commit=2
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- debian/
|
||||
- '**/*.sh'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- /bb-/
|
||||
- /\d+\.\d+$/
|
||||
|
||||
image: Visual Studio 2022
|
||||
|
@@ -248,7 +248,8 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
|
||||
default_pager_set= 0, opt_sigint_ignore= 0,
|
||||
auto_vertical_output= 0, show_query_cost= 0,
|
||||
show_warnings= 0, executing_query= 0,
|
||||
ignore_spaces= 0, opt_binhex= 0, opt_progress_reports;
|
||||
ignore_spaces= 0, opt_binhex= 0, opt_progress_reports,
|
||||
opt_print_query_on_error;
|
||||
static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error;
|
||||
static my_bool column_types_flag;
|
||||
static my_bool preserve_comments= 0;
|
||||
@@ -326,6 +327,7 @@ static int com_quit(String *str,char*),
|
||||
com_prompt(String *str, char*), com_delimiter(String *str, char*),
|
||||
com_warnings(String *str, char*), com_nowarnings(String *str, char*),
|
||||
com_sandbox(String *str, char*);
|
||||
static void print_query_to_stderr(String *buffer);
|
||||
static int com_query_cost(String *str, char*);
|
||||
|
||||
#ifdef USE_POPEN
|
||||
@@ -1210,6 +1212,8 @@ inline int get_command_index(char cmd_char)
|
||||
|
||||
static int delimiter_index= -1;
|
||||
static int charset_index= -1;
|
||||
static int sandbox_index= -1;
|
||||
|
||||
static bool real_binary_mode= FALSE;
|
||||
|
||||
|
||||
@@ -1221,6 +1225,7 @@ int main(int argc,char *argv[])
|
||||
DBUG_ENTER("main");
|
||||
DBUG_PROCESS(argv[0]);
|
||||
|
||||
sandbox_index= get_command_index('-');
|
||||
charset_index= get_command_index('C');
|
||||
delimiter_index= get_command_index('d');
|
||||
delimiter_str= delimiter;
|
||||
@@ -1798,6 +1803,10 @@ static struct my_option my_long_options[] =
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", &opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"print-query-on-error", 0,
|
||||
"Print the query if there was an error. Is only enabled in --batch mode if verbose is not set (as then the query would be printed anyway)",
|
||||
&opt_print_query_on_error, &opt_print_query_on_error, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"progress-reports", 0,
|
||||
"Get progress reports for long running commands (like ALTER TABLE)",
|
||||
&opt_progress_reports, &opt_progress_reports, 0, GET_BOOL, NO_ARG, 1, 0,
|
||||
@@ -2375,8 +2384,9 @@ static int read_and_execute(bool interactive)
|
||||
|
||||
/**
|
||||
It checks if the input is a short form command. It returns the command's
|
||||
pointer if a command is found, else return NULL. Note that if binary-mode
|
||||
is set, then only \C is searched for.
|
||||
pointer if a command is found, else return NULL.
|
||||
|
||||
Note that if binary-mode is set, then only \C and \- are searched for.
|
||||
|
||||
@param cmd_char A character of one byte.
|
||||
|
||||
@@ -2391,13 +2401,23 @@ static COMMANDS *find_command(char cmd_char)
|
||||
int index= -1;
|
||||
|
||||
/*
|
||||
In binary-mode, we disallow all mysql commands except '\C'
|
||||
and DELIMITER.
|
||||
In binary-mode, we disallow all client commands except '\C',
|
||||
DELIMITER (see long comand finding find_command(char *))
|
||||
and '\-' (sandbox, see following comment).
|
||||
*/
|
||||
if (real_binary_mode)
|
||||
{
|
||||
if (cmd_char == 'C')
|
||||
index= charset_index;
|
||||
/*
|
||||
binary-mode enforces stricter controls compared to sandbox mode.
|
||||
Whether sandbox mode is enabled or not is irrelevant when
|
||||
binary-mode is active.
|
||||
The only purpose of processing sandbox mode here is to avoid error
|
||||
messages on files made by mysqldump.
|
||||
*/
|
||||
else if (cmd_char == '-')
|
||||
index= sandbox_index;
|
||||
}
|
||||
else
|
||||
index= get_command_index(cmd_char);
|
||||
@@ -2453,6 +2473,12 @@ static COMMANDS *find_command(char *name)
|
||||
len= (uint) strlen(name);
|
||||
|
||||
int index= -1;
|
||||
/*
|
||||
In binary-mode, we disallow all client commands except DELIMITER
|
||||
and short commands '\C' and '\-' (see short command finding
|
||||
find_command(char)).
|
||||
*/
|
||||
|
||||
if (real_binary_mode)
|
||||
{
|
||||
if (is_delimiter_command(name, len))
|
||||
@@ -3208,6 +3234,11 @@ int mysql_real_query_for_lazy(const char *buf, size_t length)
|
||||
int error;
|
||||
if (!mysql_real_query(&mysql,buf,(ulong)length))
|
||||
return 0;
|
||||
if (opt_print_query_on_error)
|
||||
{
|
||||
String query(buf, length, charset_info);
|
||||
(void) print_query_to_stderr(&query);
|
||||
}
|
||||
error= put_error(&mysql);
|
||||
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
|
||||
!opt_reconnect)
|
||||
@@ -3430,7 +3461,6 @@ static int com_charset(String *, char *line)
|
||||
1 if fatal error
|
||||
*/
|
||||
|
||||
|
||||
static int com_go(String *buffer, char *)
|
||||
{
|
||||
char buff[200]; /* about 110 chars used so far */
|
||||
@@ -3503,6 +3533,8 @@ static int com_go(String *buffer, char *)
|
||||
{
|
||||
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
|
||||
{
|
||||
if (opt_print_query_on_error)
|
||||
print_query_to_stderr(buffer);
|
||||
error= put_error(&mysql);
|
||||
goto end;
|
||||
}
|
||||
@@ -3556,7 +3588,11 @@ static int com_go(String *buffer, char *)
|
||||
(long) mysql_num_rows(result) == 1 ? "row" : "rows");
|
||||
end_pager();
|
||||
if (mysql_errno(&mysql))
|
||||
{
|
||||
if (opt_print_query_on_error)
|
||||
print_query_to_stderr(buffer);
|
||||
error= put_error(&mysql);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mysql_affected_rows(&mysql) == ~(ulonglong) 0)
|
||||
@@ -3583,13 +3619,21 @@ static int com_go(String *buffer, char *)
|
||||
put_info("",INFO_RESULT); // Empty row
|
||||
|
||||
if (result && !mysql_eof(result)) /* Something wrong when using quick */
|
||||
{
|
||||
if (opt_print_query_on_error)
|
||||
print_query_to_stderr(buffer);
|
||||
error= put_error(&mysql);
|
||||
}
|
||||
else if (unbuffered)
|
||||
fflush(stdout);
|
||||
mysql_free_result(result);
|
||||
} while (!(err= mysql_next_result(&mysql)));
|
||||
if (err >= 1)
|
||||
{
|
||||
if (opt_print_query_on_error)
|
||||
print_query_to_stderr(buffer);
|
||||
error= put_error(&mysql);
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
@@ -4547,14 +4591,35 @@ static int com_shell(String *, char *line)
|
||||
#endif
|
||||
|
||||
|
||||
static void print_query(String *buffer, FILE *file)
|
||||
{
|
||||
tee_puts("--------------", file);
|
||||
(void) tee_fputs(buffer->c_ptr(), file);
|
||||
if (!buffer->length() || (*buffer)[buffer->length()-1] != '\n')
|
||||
tee_putc('\n', file);
|
||||
tee_puts("--------------\n", file);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Print query to stderr in batch mode if verbose is not set
|
||||
*/
|
||||
|
||||
static void print_query_to_stderr(String *buffer)
|
||||
{
|
||||
if ((status.batch || in_com_source) && !verbose)
|
||||
{
|
||||
fflush(stdout);
|
||||
print_query(buffer, stderr);
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int com_print(String *buffer,char *)
|
||||
{
|
||||
tee_puts("--------------", stdout);
|
||||
(void) tee_fputs(buffer->c_ptr(), stdout);
|
||||
if (!buffer->length() || (*buffer)[buffer->length()-1] != '\n')
|
||||
tee_putc('\n', stdout);
|
||||
tee_puts("--------------\n", stdout);
|
||||
return 0; /* If empty buffer */
|
||||
print_query(buffer, stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5309,8 +5374,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
|
||||
|
||||
static int put_error(MYSQL *con)
|
||||
{
|
||||
return put_info(mysql_error(con), INFO_ERROR, mysql_errno(con),
|
||||
mysql_sqlstate(con));
|
||||
DBUG_ENTER("put_error");
|
||||
DBUG_RETURN(put_info(mysql_error(con), INFO_ERROR,
|
||||
mysql_errno(con), mysql_sqlstate(con)));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -683,7 +683,7 @@ static int load_plugin_data(char *plugin_name, char *config_file)
|
||||
if (i == -1) /* if first pass, read this line as so_name */
|
||||
{
|
||||
/* Add proper file extension for soname */
|
||||
if (safe_strcpy(line + line_len - 1, sizeof(line), FN_SOEXT))
|
||||
if (safe_strcpy_truncated(line + line_len - 1, sizeof line, FN_SOEXT))
|
||||
{
|
||||
reason= "Plugin name too long.";
|
||||
fclose(file_ptr);
|
||||
@@ -746,7 +746,7 @@ static int check_options(int argc, char **argv, char *operation)
|
||||
const char *plugin_dir_prefix = "--plugin_dir=";
|
||||
size_t plugin_dir_len= strlen(plugin_dir_prefix);
|
||||
|
||||
strcpy(plugin_name, "");
|
||||
*plugin_name= '\0';
|
||||
for (i = 0; i < argc && num_found < 5; i++)
|
||||
{
|
||||
|
||||
@@ -784,8 +784,8 @@ static int check_options(int argc, char **argv, char *operation)
|
||||
/* read the plugin config file and check for match against argument */
|
||||
else
|
||||
{
|
||||
if (safe_strcpy(plugin_name, sizeof(plugin_name), argv[i]) ||
|
||||
safe_strcpy(config_file, sizeof(config_file), argv[i]) ||
|
||||
if (safe_strcpy_truncated(plugin_name, sizeof plugin_name, argv[i]) ||
|
||||
safe_strcpy_truncated(config_file, sizeof config_file, argv[i]) ||
|
||||
safe_strcat(config_file, sizeof(config_file), ".ini"))
|
||||
{
|
||||
fprintf(stderr, "ERROR: argument is too long.\n");
|
||||
|
@@ -626,7 +626,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
{
|
||||
my_close(fd, MYF(MY_WME));
|
||||
my_delete(query_file_path, MYF(0));
|
||||
die("Failed to write to '%s'", query_file_path);
|
||||
die("Failed to write query to '%s'", query_file_path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
{
|
||||
my_close(fd, MYF(MY_WME));
|
||||
my_delete(query_file_path, MYF(0));
|
||||
die("Failed to write to '%s'", query_file_path);
|
||||
die("Failed to write query to '%s'", query_file_path);
|
||||
}
|
||||
|
||||
ret= run_tool(mysql_path,
|
||||
@@ -645,6 +645,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
"--batch", /* Turns off pager etc. */
|
||||
force ? "--force": "--skip-force",
|
||||
opt_verbose >= 5 ? "--verbose" : "",
|
||||
"--print-query-on-error",
|
||||
ds_res || opt_silent ? "--silent": "",
|
||||
"<",
|
||||
query_file_path,
|
||||
@@ -1092,18 +1093,6 @@ static char* get_line(char* line)
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
/* Print the current line to stderr */
|
||||
static void print_line(char* line)
|
||||
{
|
||||
while (*line && *line != '\n')
|
||||
{
|
||||
fputc(*line, stderr);
|
||||
line++;
|
||||
}
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
static my_bool from_before_10_1()
|
||||
{
|
||||
my_bool ret= TRUE;
|
||||
@@ -1322,16 +1311,21 @@ static int check_slave_repositories(void)
|
||||
|
||||
static int run_sql_fix_privilege_tables(void)
|
||||
{
|
||||
int found_real_errors= 0;
|
||||
int found_real_errors= 0, query_started= 0;
|
||||
const char **query_ptr;
|
||||
const char *end;
|
||||
DYNAMIC_STRING ds_script;
|
||||
DYNAMIC_STRING ds_result;
|
||||
DYNAMIC_STRING ds_query;
|
||||
DBUG_ENTER("run_sql_fix_privilege_tables");
|
||||
|
||||
if (init_dynamic_string(&ds_script, "", 65536, 1024))
|
||||
if (init_dynamic_string(&ds_script, "", 96*1024, 8196))
|
||||
die("Out of memory");
|
||||
|
||||
if (init_dynamic_string(&ds_result, "", 512, 512))
|
||||
if (init_dynamic_string(&ds_result, "", 1024, 1024))
|
||||
die("Out of memory");
|
||||
|
||||
if (init_dynamic_string(&ds_query, "", 1024, 1024))
|
||||
die("Out of memory");
|
||||
|
||||
verbose("Phase %d/%d: Running 'mysql_fix_privilege_tables'",
|
||||
@@ -1360,22 +1354,46 @@ static int run_sql_fix_privilege_tables(void)
|
||||
"Unknown column" and "Duplicate key name" since they just
|
||||
indicate the system tables are already up to date
|
||||
*/
|
||||
char *line= ds_result.str;
|
||||
const char *line= ds_result.str;
|
||||
do
|
||||
{
|
||||
size_t length;
|
||||
end= strchr(line, '\n');
|
||||
if (!end)
|
||||
end= strend(line);
|
||||
else
|
||||
end++; /* Include end \n */
|
||||
length= (size_t) (end - line);
|
||||
|
||||
if (!is_expected_error(line))
|
||||
{
|
||||
/* Something unexpected failed, dump error line to screen */
|
||||
found_real_errors++;
|
||||
print_line(line);
|
||||
if (ds_query.length)
|
||||
fwrite(ds_query.str, sizeof(char), ds_query.length, stderr);
|
||||
fwrite(line, sizeof(char), length, stderr);
|
||||
query_started= 0;
|
||||
}
|
||||
else if (strncmp(line, "WARNING", 7) == 0)
|
||||
{
|
||||
print_line(line);
|
||||
fwrite(line, sizeof(char), length, stderr);
|
||||
query_started= 0;
|
||||
}
|
||||
} while ((line= get_line(line)) && *line);
|
||||
else if (!strncmp(line, "--------------\n", 16))
|
||||
{
|
||||
/* mariadb separates query from the error with a line of '-' */
|
||||
if (!query_started++)
|
||||
ds_query.length= 0; /* Truncate */
|
||||
else
|
||||
query_started= 0; /* End of query */
|
||||
}
|
||||
else if (query_started)
|
||||
{
|
||||
dynstr_append_mem(&ds_query, line, length);
|
||||
}
|
||||
} while (*(line= end));
|
||||
}
|
||||
|
||||
dynstr_free(&ds_query);
|
||||
dynstr_free(&ds_result);
|
||||
dynstr_free(&ds_script);
|
||||
DBUG_RETURN(found_real_errors);
|
||||
|
@@ -421,7 +421,7 @@ int main(int argc,char *argv[])
|
||||
is given a t!=0, we get an endless loop, or n iterations if --count=n
|
||||
was given an n!=0. If --sleep wasn't given, we get one iteration.
|
||||
|
||||
To wit, --wait loops the connection-attempts, while --sleep loops
|
||||
To wait, --wait loops the connection-attempts, while --sleep loops
|
||||
the command execution (endlessly if no --count is given).
|
||||
*/
|
||||
|
||||
|
@@ -3027,7 +3027,7 @@ static void get_sequence_structure(const char *seq, const char *db)
|
||||
row= mysql_fetch_row(result);
|
||||
if (row[0])
|
||||
{
|
||||
fprintf(sql_file, "SELECT SETVAL(%s, %s, 0);\n", result_seq, row[0]);
|
||||
fprintf(sql_file, "DO SETVAL(%s, %s, 0);\n", result_seq, row[0]);
|
||||
}
|
||||
// Sequences will not use inserts, so no need for REPLACE and LOCKS
|
||||
mysql_free_result(result);
|
||||
@@ -6037,7 +6037,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
free_root(&glob_root, MYF(0));
|
||||
}
|
||||
maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names);
|
||||
/* We shall countinue here, if --force was given */
|
||||
/* We shall continue here, if --force was given */
|
||||
}
|
||||
}
|
||||
end= pos;
|
||||
@@ -6058,7 +6058,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
free_root(&glob_root, MYF(0));
|
||||
}
|
||||
DB_error(mysql, "when doing LOCK TABLES");
|
||||
/* We shall countinue here, if --force was given */
|
||||
/* We shall continue here, if --force was given */
|
||||
}
|
||||
}
|
||||
dynstr_free(&lock_tables_query);
|
||||
@@ -6070,7 +6070,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
free_root(&glob_root, MYF(0));
|
||||
DB_error(mysql, "when doing refresh");
|
||||
}
|
||||
/* We shall countinue here, if --force was given */
|
||||
/* We shall continue here, if --force was given */
|
||||
else
|
||||
verbose_msg("-- dump_selected_tables : logs flushed successfully!\n");
|
||||
}
|
||||
|
@@ -430,7 +430,7 @@ static void lock_table(MYSQL *mysql, int tablecount, char **raw_tablename)
|
||||
dynstr_append(&query, " WRITE,");
|
||||
}
|
||||
if (mysql_real_query(mysql, query.str, (ulong)query.length-1))
|
||||
db_error(mysql); /* We shall countinue here, if --force was given */
|
||||
db_error(mysql); /* We shall continue here, if --force was given */
|
||||
}
|
||||
|
||||
|
||||
@@ -621,7 +621,7 @@ pthread_handler_t worker_thread(void *arg)
|
||||
|
||||
if (mysql_query(mysql, "/*!40101 set @@character_set_database=binary */;"))
|
||||
{
|
||||
db_error(mysql); /* We shall countinue here, if --force was given */
|
||||
db_error(mysql); /* We shall continue here, if --force was given */
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -749,12 +749,12 @@ int main(int argc, char **argv)
|
||||
if (!(mysql= db_connect(current_host,current_db,current_user,opt_password)))
|
||||
{
|
||||
free_defaults(argv_to_free);
|
||||
return(1); /* purecov: deadcode */
|
||||
return(1); /* purecov: dead code */
|
||||
}
|
||||
|
||||
if (mysql_query(mysql, "/*!40101 set @@character_set_database=binary */;"))
|
||||
{
|
||||
db_error(mysql); /* We shall countinue here, if --force was given */
|
||||
db_error(mysql); /* We shall continue here, if --force was given */
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
@@ -6013,14 +6013,20 @@ int connect_n_handle_errors(struct st_command *command,
|
||||
stay clear of trying to work out which exact user-limit was
|
||||
exceeded.
|
||||
*/
|
||||
auto my_err= mysql_errno(con);
|
||||
if(my_err == 0)
|
||||
{
|
||||
/* Workaround client library bug, not indicating connection error. */
|
||||
my_err= CR_SERVER_LOST;
|
||||
}
|
||||
|
||||
if (((mysql_errno(con) == ER_TOO_MANY_USER_CONNECTIONS) ||
|
||||
(mysql_errno(con) == ER_USER_LIMIT_REACHED)) &&
|
||||
if (((my_err == ER_TOO_MANY_USER_CONNECTIONS) ||
|
||||
(my_err == ER_USER_LIMIT_REACHED)) &&
|
||||
(failed_attempts++ < opt_max_connect_retries))
|
||||
{
|
||||
int i;
|
||||
|
||||
i= match_expected_error(command, mysql_errno(con), mysql_sqlstate(con));
|
||||
i= match_expected_error(command, my_err, mysql_sqlstate(con));
|
||||
|
||||
if (i >= 0)
|
||||
goto do_handle_error; /* expected error, handle */
|
||||
@@ -6030,9 +6036,9 @@ int connect_n_handle_errors(struct st_command *command,
|
||||
}
|
||||
|
||||
do_handle_error:
|
||||
var_set_errno(mysql_errno(con));
|
||||
handle_error(command, mysql_errno(con), mysql_error(con),
|
||||
mysql_sqlstate(con), ds);
|
||||
var_set_errno(my_err);
|
||||
handle_error(command, my_err, mysql_error(con),
|
||||
mysql_sqlstate(con), ds);
|
||||
return 0; /* Not connected */
|
||||
}
|
||||
|
||||
@@ -6370,7 +6376,7 @@ int do_done(struct st_command *command)
|
||||
if (*cur_block->delim)
|
||||
{
|
||||
/* Restore "old" delimiter after false if block */
|
||||
if (safe_strcpy(delimiter, sizeof(delimiter), cur_block->delim))
|
||||
if (safe_strcpy_truncated(delimiter, sizeof delimiter, cur_block->delim))
|
||||
die("Delimiter too long, truncated");
|
||||
|
||||
delimiter_length= strlen(delimiter);
|
||||
@@ -6658,7 +6664,8 @@ void do_block(enum block_cmd cmd, struct st_command* command)
|
||||
else
|
||||
{
|
||||
/* Remember "old" delimiter if entering a false if block */
|
||||
if (safe_strcpy(cur_block->delim, sizeof(cur_block->delim), delimiter))
|
||||
if (safe_strcpy_truncated(cur_block->delim, sizeof cur_block->delim,
|
||||
delimiter))
|
||||
die("Delimiter too long, truncated");
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@ FOREACH(F ${MY_WARNING_FLAGS})
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG(${F} DEBUG RELWITHDEBINFO)
|
||||
ENDFOREACH()
|
||||
|
||||
SET(MY_ERROR_FLAGS -Werror)
|
||||
SET(MY_ERROR_FLAGS -Werror -fno-operator-names)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
|
||||
SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=maybe-uninitialized)
|
||||
|
9
debian/autobake-deb.sh
vendored
9
debian/autobake-deb.sh
vendored
@@ -58,6 +58,7 @@ disable_libfmt()
|
||||
}
|
||||
|
||||
architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
|
||||
uname_machine=$(uname -m)
|
||||
|
||||
# Parse release name and number from Linux standard base release
|
||||
# Example:
|
||||
@@ -188,6 +189,14 @@ then
|
||||
BUILDPACKAGE_DPKGCMD+=("eatmydata")
|
||||
fi
|
||||
|
||||
# If running autobake-debs.sh inside docker/podman host machine which
|
||||
# has 64 bits cpu but container image is 32 bit make sure that we set
|
||||
# correct arch with linux32 for 32 bit enviroment
|
||||
if [ "$architecture" = "i386" ] && [ "$uname_machine" = "x86_64" ]
|
||||
then
|
||||
BUILDPACKAGE_DPKGCMD+=("linux32")
|
||||
fi
|
||||
|
||||
BUILDPACKAGE_DPKGCMD+=("dpkg-buildpackage")
|
||||
|
||||
# Using dpkg-buildpackage args
|
||||
|
2
debian/mariadb-server.postrm
vendored
2
debian/mariadb-server.postrm
vendored
@@ -12,8 +12,6 @@ fi
|
||||
|
||||
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
#
|
||||
# - Purge logs and data only if they are ours (#307473)
|
||||
# - Remove the mysql user only after all his owned files are purged.
|
||||
|
@@ -901,14 +901,14 @@ bool is_system_table(const char *dbname, const char *tablename)
|
||||
DBUG_ASSERT(dbname);
|
||||
DBUG_ASSERT(tablename);
|
||||
|
||||
LEX_CSTRING lex_dbname;
|
||||
LEX_CSTRING lex_tablename;
|
||||
Lex_ident_db lex_dbname;
|
||||
Lex_ident_table lex_tablename;
|
||||
lex_dbname.str = dbname;
|
||||
lex_dbname.length = strlen(dbname);
|
||||
lex_tablename.str = tablename;
|
||||
lex_tablename.length = strlen(tablename);
|
||||
|
||||
TABLE_CATEGORY tg = get_table_category(&lex_dbname, &lex_tablename);
|
||||
TABLE_CATEGORY tg = get_table_category(lex_dbname, lex_tablename);
|
||||
|
||||
return (tg == TABLE_CATEGORY_LOG) || (tg == TABLE_CATEGORY_SYSTEM);
|
||||
}
|
||||
|
@@ -1600,11 +1600,11 @@ struct my_option xb_client_options[]= {
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
||||
{"rsync", OPT_RSYNC,
|
||||
"Obsolete depricated option",
|
||||
"Obsolete, deprecated option",
|
||||
&ignored_option, &ignored_option, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
||||
{"no-backup-locks", OPT_NO_BACKUP_LOCKS,
|
||||
"Obsolete depricated option",
|
||||
"Obsolete, deprecated option",
|
||||
&ignored_option, &ignored_option, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
||||
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRS,
|
||||
@@ -6996,7 +6996,7 @@ static bool check_all_privileges()
|
||||
if (opt_galera_info || opt_slave_info
|
||||
|| opt_safe_slave_backup) {
|
||||
check_result |= check_privilege(granted_privileges,
|
||||
"REPLICA MONITOR", "*", "*",
|
||||
"SLAVE MONITOR", "*", "*",
|
||||
PRIVILEGE_WARNING);
|
||||
}
|
||||
|
||||
|
@@ -240,15 +240,14 @@ static inline void lex_string_set3(LEX_CSTRING *lex_str, const char *c_str,
|
||||
lex_str->length= len;
|
||||
}
|
||||
|
||||
/*
|
||||
Copies src into dst and ensures dst is a NULL terminated C string.
|
||||
/**
|
||||
Copies a string.
|
||||
|
||||
Returns 1 if the src string was truncated due to too small size of dst.
|
||||
Returns 0 if src completely fit within dst. Pads the remaining dst with '\0'
|
||||
|
||||
Note: dst_size must be > 0
|
||||
@param dst destination buffer, will be NUL padded.
|
||||
@param dst_size size of dst buffer, must be > 0
|
||||
@param src NUL terminated source string
|
||||
*/
|
||||
static inline int safe_strcpy(char *dst, size_t dst_size, const char *src)
|
||||
static inline void safe_strcpy(char *dst, size_t dst_size, const char *src)
|
||||
{
|
||||
DBUG_ASSERT(dst_size > 0);
|
||||
|
||||
@@ -257,45 +256,49 @@ static inline int safe_strcpy(char *dst, size_t dst_size, const char *src)
|
||||
*
|
||||
* 2) IF there is no 0 byte in the first dst_size bytes of src, strncpy will
|
||||
* copy dst_size bytes, and the final byte won't be 0.
|
||||
*
|
||||
* In GCC 8+, the `-Wstringop-truncation` warning will object to strncpy()
|
||||
* being used in this way, so we need to disable this warning for this
|
||||
* single statement.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
strncpy(dst, src, dst_size);
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
dst[dst_size - 1]= 0;
|
||||
}
|
||||
|
||||
if (dst[dst_size-1])
|
||||
/**
|
||||
Copies a string, checking for truncation.
|
||||
|
||||
@param dst destination buffer, will be NUL padded.
|
||||
@param dst_size size of dst buffer, must be > 0
|
||||
@param src NUL terminated source string
|
||||
|
||||
@retval 1 if the src string was truncated due to too small size of dst.
|
||||
@retval 0 if src completely fit within dst,
|
||||
*/
|
||||
static inline int safe_strcpy_truncated(char *dst, size_t dst_size,
|
||||
const char *src)
|
||||
{
|
||||
DBUG_ASSERT(dst_size > 0);
|
||||
|
||||
strncpy(dst, src, dst_size);
|
||||
if (dst[dst_size - 1])
|
||||
{
|
||||
/* Only possible in case (2), meaning src was truncated. */
|
||||
dst[dst_size-1]= 0;
|
||||
dst[dst_size - 1]= 0;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Appends src to dst and ensures dst is a NULL terminated C string.
|
||||
/**
|
||||
Appends src to dst and ensures dst is a NUL terminated C string.
|
||||
|
||||
Returns 1 if the src string was truncated due to too small size of dst.
|
||||
Returns 0 if src completely fit within the remaining dst space. Pads the
|
||||
remaining dst with '\0'.
|
||||
|
||||
Note: dst_size must be > 0
|
||||
@retval 1 if the src string was truncated due to too small size of dst.
|
||||
@retval 0 if src completely fit within the remaining dst space,
|
||||
including NUL termination.
|
||||
*/
|
||||
static inline int safe_strcat(char *dst, size_t dst_size, const char *src)
|
||||
{
|
||||
size_t init_len= strlen(dst);
|
||||
if (init_len >= dst_size - 1)
|
||||
if (init_len > dst_size)
|
||||
return 1;
|
||||
return safe_strcpy(dst + init_len, dst_size - init_len, src);
|
||||
return safe_strcpy_truncated(dst + init_len, dst_size - init_len, src);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -242,6 +242,18 @@ static inline ulonglong my_timer_cycles(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MY_TIMER_ROUTINE_CYCLES == 0
|
||||
static inline size_t my_pseudo_random(void)
|
||||
{
|
||||
/* In some platforms, pthread_self() might return a structure
|
||||
that cannot be converted to a number like this. Possible alternatives
|
||||
could include gettid() or sched_getcpu(). */
|
||||
return ((size_t) pthread_self()) / 16;
|
||||
}
|
||||
#else
|
||||
# define my_pseudo_random my_timer_cycles
|
||||
#endif
|
||||
|
||||
/**
|
||||
A nanosecond timer.
|
||||
@return the current timer value, in nanoseconds.
|
||||
|
@@ -409,7 +409,7 @@ shell> \fBmysqladmin password "my new password"\fR
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -167,7 +167,7 @@ option is given\&.
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
@@ -424,7 +424,7 @@ USE\&. (In particular, no cross\-database updates should be used\&.)
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
@@ -1337,7 +1337,7 @@ capability enabled\&.
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
@@ -1985,7 +1985,7 @@ shell> \fBmysqlbinlog \-v \-\-base64\-output=DECODE\-ROWS \fR\fB\fIlog_file\fR\f
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -101,7 +101,7 @@ with partitioned tables is not supported\&.
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -2358,7 +2358,7 @@ file that contains its data\&. The option value is the directory in which to wri
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -36,7 +36,7 @@ performs a table check\&. If any problems are found, a table repair is attempted
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
@@ -54,7 +54,7 @@ with administrator privileges\&. You can do this by running a Command Prompt as
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -733,7 +733,7 @@ If none of these options is given, the default is
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
@@ -38,7 +38,7 @@ with partitioned tables is not supported\&.
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
@@ -168,7 +168,7 @@ the section called \(lqMYISAMCHK MEMORY USAGE\(rq\&.
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.it 1
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
|
4
mysql-test/include/log_bin.combinations
Normal file
4
mysql-test/include/log_bin.combinations
Normal file
@@ -0,0 +1,4 @@
|
||||
[binlogoff]
|
||||
|
||||
[binlogon]
|
||||
log-bin
|
3
mysql-test/include/log_bin.inc
Normal file
3
mysql-test/include/log_bin.inc
Normal file
@@ -0,0 +1,3 @@
|
||||
# include file for test files that can be run with and without log-bin
|
||||
# (see include/log_bin.combinations)
|
||||
|
@@ -23,7 +23,7 @@ use File::Path;
|
||||
use Carp;
|
||||
|
||||
use base qw(Exporter);
|
||||
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
|
||||
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC IS_FREEBSD
|
||||
native_path posix_path mixed_path
|
||||
check_socket_path_length process_alive open_for_append);
|
||||
|
||||
@@ -79,6 +79,15 @@ BEGIN {
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
if ($^O eq "freebsd") {
|
||||
eval 'sub IS_FREEBSD { 1 }';
|
||||
}
|
||||
else {
|
||||
eval 'sub IS_FREEBSD { 0 }';
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# native_path
|
||||
# Convert from path format used by perl to the underlying
|
||||
|
@@ -398,7 +398,8 @@ sub collect_suite_name($$)
|
||||
{
|
||||
my @dirs = my_find_dir(dirname($::glob_mysql_test_dir),
|
||||
["mariadb-test/suite", "mysql-test/suite", @plugin_suitedirs ],
|
||||
$suitename);
|
||||
$suitename,
|
||||
$::opt_skip_not_found ? NOT_REQUIRED : undef);
|
||||
#
|
||||
# if $suitename contained wildcards, we'll have many suites and
|
||||
# their overlays here. Let's group them appropriately.
|
||||
|
1
mysql-test/main/analyze_engine_stats2.opt
Normal file
1
mysql-test/main/analyze_engine_stats2.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb_buffer_pool_dump_at_shutdown=off --innodb_buffer_pool_load_at_startup=off --innodb-stats-persistent=1 --innodb-stats-auto-recalc=off
|
68
mysql-test/main/analyze_engine_stats2.result
Normal file
68
mysql-test/main/analyze_engine_stats2.result
Normal file
@@ -0,0 +1,68 @@
|
||||
#
|
||||
# MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale
|
||||
#
|
||||
create table t1 (
|
||||
a varchar(255),
|
||||
b varchar(255),
|
||||
c varchar(255),
|
||||
d varchar(255),
|
||||
primary key(a,b,c,d)
|
||||
) engine=innodb;
|
||||
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
|
||||
insert into t1 select
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7)
|
||||
from seq_1_to_16384;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
# restart
|
||||
set log_slow_verbosity='engine';
|
||||
set long_query_time=0.0;
|
||||
set @js='$analyze_output';
|
||||
select @js;
|
||||
@js
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": 0.011647987,
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "index",
|
||||
"key": "PRIMARY",
|
||||
"key_length": "1028",
|
||||
"used_key_parts": ["a", "b", "c", "d"],
|
||||
"loops": 1,
|
||||
"r_loops": 1,
|
||||
"rows": 1,
|
||||
"r_rows": 16384,
|
||||
"cost": 0.0110178,
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"r_engine_stats": {
|
||||
"pages_accessed": "REPLACED",
|
||||
"pages_read_count": "REPLACED",
|
||||
"pages_read_time_ms": "REPLACED"
|
||||
},
|
||||
"filtered": 100,
|
||||
"r_filtered": 100
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
set @pages_read_time_ms=
|
||||
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms'));
|
||||
|
||||
|
||||
OK: pages_read_time is same in slow log and ANALYZE
|
||||
|
||||
set long_query_time=default;
|
||||
drop table t1;
|
75
mysql-test/main/analyze_engine_stats2.test
Normal file
75
mysql-test/main/analyze_engine_stats2.test
Normal file
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# r_engine_stats tests that require slow query log.
|
||||
#
|
||||
--source include/analyze-format.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale
|
||||
--echo #
|
||||
|
||||
# Each row is 1K.
|
||||
create table t1 (
|
||||
a varchar(255),
|
||||
b varchar(255),
|
||||
c varchar(255),
|
||||
d varchar(255),
|
||||
primary key(a,b,c,d)
|
||||
) engine=innodb;
|
||||
|
||||
# The data size is 160K * 1K = 160M
|
||||
# 16M / (page_size=16K) = 1K pages.
|
||||
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
|
||||
insert into t1 select
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7),
|
||||
repeat(uuid(), 7)
|
||||
from seq_1_to_16384;
|
||||
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
source include/restart_mysqld.inc;
|
||||
set log_slow_verbosity='engine';
|
||||
set long_query_time=0.0;
|
||||
|
||||
let $analyze_output= `analyze format=json
|
||||
select * from t1 force index (PRIMARY) order by a desc, b desc, c desc, d desc`;
|
||||
evalp set @js='$analyze_output';
|
||||
|
||||
# Print it out for user-friendlines
|
||||
--replace_regex /("(r_[a-z_]*_time_ms|pages[^"]*)": )[^, \n]*/\1"REPLACED"/
|
||||
select @js;
|
||||
|
||||
set @pages_read_time_ms=
|
||||
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms'));
|
||||
|
||||
let ANALYZE_PAGES=`select @pages_read_time_ms`;
|
||||
let SLOW_LOG_FILE= `select @@slow_query_log_file`;
|
||||
|
||||
perl;
|
||||
my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set";
|
||||
my $analyze_pages=$ENV{'ANALYZE_PAGES'};
|
||||
open(FILE, $slow_log_file) or die "Failed to open $slow_log_file";
|
||||
# We didn't run any queries touching a storage engine after the query of
|
||||
# interest, so we will be fine here if we just get the last occurrence of
|
||||
# Pages_read_time: NNNN in the file
|
||||
while(<FILE>) {
|
||||
$slow_log_pages=$1 if (/Pages_read_time: ([0-9.]+)/);
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
if ( $slow_log_pages > $analyze_pages * 0.95 &&
|
||||
$slow_log_pages < $analyze_pages * 1.05) {
|
||||
print "\n\n OK: pages_read_time is same in slow log and ANALYZE\n\n";
|
||||
} else {
|
||||
print "\n\n FAIL: $slow_log_pages not equal to $analyze_pages\n";
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
set long_query_time=default;
|
||||
drop table t1;
|
||||
|
||||
|
9
mysql-test/main/connect-no-db.result
Normal file
9
mysql-test/main/connect-no-db.result
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations
|
||||
#
|
||||
connect con1,localhost,root,,"*NO-ONE*";
|
||||
SELECT database();
|
||||
database()
|
||||
NULL
|
||||
disconnect con1;
|
||||
connection default;
|
10
mysql-test/main/connect-no-db.test
Normal file
10
mysql-test/main/connect-no-db.test
Normal file
@@ -0,0 +1,10 @@
|
||||
--echo #
|
||||
--echo # MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations
|
||||
--echo #
|
||||
|
||||
# Connect without a database
|
||||
|
||||
connect (con1,localhost,root,,"*NO-ONE*");
|
||||
SELECT database();
|
||||
disconnect con1;
|
||||
connection default;
|
@@ -2060,4 +2060,11 @@ DROP TABLE t1;
|
||||
#
|
||||
CREATE TABLE t1 (id1 INT, id2 INT, primary key (id1), unique index (id2) visible);
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-32376 SHOW CREATE DATABASE statement crashes the server when db name contains some unicode characters, ASAN stack-buffer-overflow
|
||||
#
|
||||
SET NAMES utf8mb3;
|
||||
SHOW CREATE DATABASE `#testone#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■`;
|
||||
ERROR 42000: Incorrect database name '#testone#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■...'
|
||||
SET NAMES DEFAULT;
|
||||
# End of 10.5 Test
|
||||
|
@@ -1935,4 +1935,13 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (id1 INT, id2 INT, primary key (id1), unique index (id2) visible);
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32376 SHOW CREATE DATABASE statement crashes the server when db name contains some unicode characters, ASAN stack-buffer-overflow
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb3;
|
||||
--error ER_WRONG_DB_NAME
|
||||
SHOW CREATE DATABASE `#testone#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■`;
|
||||
SET NAMES DEFAULT;
|
||||
|
||||
--echo # End of 10.5 Test
|
||||
|
@@ -9,3 +9,48 @@ DROP TABLE t1;
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.11 tests
|
||||
#
|
||||
#
|
||||
# MDEV-34288 SET NAMES DEFAULT crashes `mariadbd --collation-server=utf8mb4_unicode_ci`
|
||||
#
|
||||
SET NAMES DEFAULT COLLATE latin1_bin;
|
||||
ERROR 42000: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4'
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
latin1 latin1_swedish_ci latin1
|
||||
SET NAMES DEFAULT COLLATE utf8mb4_bin;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb4 utf8mb4_bin utf8mb4
|
||||
SET NAMES DEFAULT COLLATE uca1400_ai_ci;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb4 utf8mb4_uca1400_ai_ci utf8mb4
|
||||
SET @@global.character_set_client=latin1;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
latin1 latin1_swedish_ci latin1
|
||||
SET @@global.character_set_client=utf8mb3;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb3 utf8mb3_general_ci utf8mb3
|
||||
SET @@global.character_set_client=DEFAULT;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb4 utf8mb4_general_ci utf8mb4
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb4 utf8mb4_general_ci utf8mb4
|
||||
SET NAMES DEFAULT COLLATE DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
@@character_set_connection @@collation_connection @@character_set_results
|
||||
utf8mb4 utf8mb4_general_ci utf8mb4
|
||||
#
|
||||
# End of 10.11 tests
|
||||
#
|
||||
|
@@ -13,3 +13,45 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.11 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34288 SET NAMES DEFAULT crashes `mariadbd --collation-server=utf8mb4_unicode_ci`
|
||||
--echo #
|
||||
|
||||
--error ER_COLLATION_CHARSET_MISMATCH
|
||||
SET NAMES DEFAULT COLLATE latin1_bin;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET NAMES DEFAULT COLLATE utf8mb4_bin;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET NAMES DEFAULT COLLATE uca1400_ai_ci;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET @@global.character_set_client=latin1;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET @@global.character_set_client=utf8mb3;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET @@global.character_set_client=DEFAULT;
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET NAMES DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
SET NAMES DEFAULT COLLATE DEFAULT;
|
||||
SELECT @@character_set_connection, @@collation_connection, @@character_set_results;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.11 tests
|
||||
--echo #
|
||||
|
@@ -258,3 +258,8 @@ drop database mysqltest;
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
|
||||
set @@session.sql_if_exists=0;
|
||||
#
|
||||
# MDEV-34205 ASAN stack-buffer-overflow in strxnmov | frm_file_exists
|
||||
#
|
||||
DROP TABLE `##################################################_long`.`#################################################_long`;
|
||||
ERROR 42S02: Unknown table '##################################################_long.#########################################...'
|
||||
|
@@ -361,3 +361,9 @@ drop table mysqltest.does_not_exists;
|
||||
drop database mysqltest;
|
||||
drop database mysqltest;
|
||||
set @@session.sql_if_exists=0;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34205 ASAN stack-buffer-overflow in strxnmov | frm_file_exists
|
||||
--echo #
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
DROP TABLE `##################################################_long`.`#################################################_long`;
|
||||
|
@@ -1950,12 +1950,6 @@ ex
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol
|
||||
#
|
||||
SELECT hex(column_create(1,'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)) AS ex;
|
||||
@@ -1967,5 +1961,16 @@ SELECT hex(column_add(column_create(
|
||||
ex
|
||||
00020001000302001353612162
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
# MDEV-31566 Fix buffer overrun of column_json function
|
||||
#
|
||||
create table t1 (
|
||||
c1 varchar(32) primary key,
|
||||
d1 blob
|
||||
);
|
||||
insert into t1 values ('var', 0x0402000A0000000300030023076A736E7375626A6563742E0005006C0027000200290002002B0002002D0002002F0002000C31000C3B000C4B000C51000F62006631663266336634663509E5A79AE8BF9CE6B48B0FE8819AE9809AE98791E6A1A5E5BA970537343530301031313634332F393634352F31313630300C080000000000EFBFBDEFBFBD192E), ('zzz', 0x0402000900000003000300740C6A736E766F6C756D652E000900EFBFBD004300020045000200470003004A0004004E00050053000500580005005D000500620005000C67000C6A000C6D000C7000052C00051B00052C000CEFBFBD0007EFBFBD006638663966313070696332626F785F63626F785F67626F785F6B626F785F7666355F696402343402343402333241687474703A2F2F6F73732E68646238382E636F6D2F302F70686F746F2F30373865653765376336343634616236386130343833373333323636613532612E67696608302E303532323732244F1E00030180C106);
|
||||
select c1,column_json(d1) as not_crashing from t1 order by c1;
|
||||
c1 not_crashing
|
||||
var {"jsn":"\u0000\u0005\u0000l\u0000'\u0000\u0002\u0000)\u0000\u0002\u0000+\u0000\u0002\u0000-\u0000\u0002\u0000/\u0000\u0002\u0000\u000C1\u0000\u000C;\u0000\u000CK\u0000\u000CQ\u0000\u000Fb\u0000f1f2f3f4f5\u0009姚远洋\u000F聚通金桥店\u000574500\u001011643/9645/11600\u000C\u0008\u0000\u0000\u0000\u0000\u0000<30><30>\u0019","subject":""}
|
||||
zzz {"jsn":"\u0000\u0009\u0000<30>\u0000C\u0000\u0002\u0000E\u0000\u0002\u0000G\u0000\u0003\u0000J\u0000\u0004\u0000N\u0000\u0005\u0000S\u0000\u0005\u0000X\u0000\u0005\u0000]\u0000\u0005\u0000b\u0000\u0005\u0000\u000Cg\u0000\u000Cj\u0000\u000Cm\u0000\u000Cp\u0000\u0005,\u0000\u0005\u001B\u0000\u0005,\u0000\u000C<30>\u0000\u0007<30>\u0000f8f9f10pic2box_cbox_gbox_kbox_vf5_id\u000244\u000244\u000232Ahttp://oss.hdb88.com/0/photo/078ee7e7c6464ab68a0483733266a52a.gif\u00080.052272$O\u001E\u0000","volume":193.6}
|
||||
drop table t1;
|
||||
# End of 10.5 tests
|
||||
|
@@ -1001,14 +1001,6 @@ SELECT HEX(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL)) as ex;
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol
|
||||
--echo #
|
||||
@@ -1019,5 +1011,18 @@ SELECT hex(column_add(column_create(
|
||||
2, 'b' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci)) AS ex;
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo # MDEV-31566 Fix buffer overrun of column_json function
|
||||
--echo #
|
||||
|
||||
|
||||
create table t1 (
|
||||
c1 varchar(32) primary key,
|
||||
d1 blob
|
||||
);
|
||||
insert into t1 values ('var', 0x0402000A0000000300030023076A736E7375626A6563742E0005006C0027000200290002002B0002002D0002002F0002000C31000C3B000C4B000C51000F62006631663266336634663509E5A79AE8BF9CE6B48B0FE8819AE9809AE98791E6A1A5E5BA970537343530301031313634332F393634352F31313630300C080000000000EFBFBDEFBFBD192E), ('zzz', 0x0402000900000003000300740C6A736E766F6C756D652E000900EFBFBD004300020045000200470003004A0004004E00050053000500580005005D000500620005000C67000C6A000C6D000C7000052C00051B00052C000CEFBFBD0007EFBFBD006638663966313070696332626F785F63626F785F67626F785F6B626F785F7666355F696402343402343402333241687474703A2F2F6F73732E68646238382E636F6D2F302F70686F746F2F30373865653765376336343634616236386130343833373333323636613532612E67696608302E303532323732244F1E00030180C106);
|
||||
|
||||
select c1,column_json(d1) as not_crashing from t1 order by c1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
@@ -200,3 +200,34 @@ select 30 + (20010101 + interval 2 day), x from v1;
|
||||
20010133 20010133
|
||||
drop view v1;
|
||||
End of 10.2 tests
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-30931 UBSAN: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in get_interval_value on SELECT
|
||||
#
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL '9223372036854775808-02' WEEK);
|
||||
DATE_ADD('01-01-23',INTERVAL '9223372036854775808-02' WEEK)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '9223372036854775808-02'
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775807 WEEK);
|
||||
DATE_ADD('01-01-23',INTERVAL -9223372036854775807 WEEK)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775808 WEEK);
|
||||
DATE_ADD('01-01-23',INTERVAL -9223372036854775808 WEEK)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775809 WEEK);
|
||||
DATE_ADD('01-01-23',INTERVAL -9223372036854775809 WEEK)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1916 Got overflow when converting '-9223372036854775809' to INT. Value truncated
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
@@ -169,3 +169,20 @@ select 30 + (20010101 + interval 2 day), x from v1;
|
||||
drop view v1;
|
||||
|
||||
--echo End of 10.2 tests
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-30931 UBSAN: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in get_interval_value on SELECT
|
||||
--echo #
|
||||
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL '9223372036854775808-02' WEEK);
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775807 WEEK);
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775808 WEEK);
|
||||
SELECT DATE_ADD('01-01-23',INTERVAL -9223372036854775809 WEEK);
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
@@ -1717,6 +1717,17 @@ SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
|
||||
JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D')
|
||||
{"A": {"B": 1}}
|
||||
#
|
||||
# MDEV-34143: Server crashes when executing JSON_EXTRACT after setting non-default collation_connection
|
||||
#
|
||||
SET @save_collation_connection= @@collation_connection;
|
||||
SET collation_connection='utf16_bin';
|
||||
SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a');
|
||||
JSON_EXTRACT('{"a": 1,"b": 2}','$.a')
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 4036 Character disallowed in JSON in argument 1 to function 'json_extract' at position 2
|
||||
SET @@collation_connection= @save_collation_connection;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
#
|
||||
|
@@ -1152,6 +1152,20 @@ SELECT JSON_TYPE(json_value(JSON_OBJECT("id", 1, "name", 'Monty', "date", Cast('
|
||||
SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
|
||||
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34143: Server crashes when executing JSON_EXTRACT after setting non-default collation_connection
|
||||
--echo #
|
||||
|
||||
SET @save_collation_connection= @@collation_connection;
|
||||
|
||||
SET collation_connection='utf16_bin';
|
||||
--disable_service_connection
|
||||
SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a');
|
||||
--enable_service_connection
|
||||
|
||||
SET @@collation_connection= @save_collation_connection;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
@@ -5310,6 +5310,14 @@ NULL
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
#
|
||||
# MDEV-28387 UBSAN: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strtoll10 on SELECT
|
||||
#
|
||||
SET @a='-9223372036854775808';
|
||||
CREATE TABLE t (c1 INT,c2 CHAR);
|
||||
SELECT SUBSTR(0,@a) FROM t;
|
||||
SUBSTR(0,@a)
|
||||
DROP TABLE t;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
#
|
||||
|
@@ -1548,6 +1548,7 @@ CREATE TABLE t1 ( a TEXT );
|
||||
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/bug58165.txt
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -2351,6 +2352,15 @@ DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28387 UBSAN: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strtoll10 on SELECT
|
||||
--echo #
|
||||
|
||||
SET @a='-9223372036854775808'; # Quite specific value; considerably varying it will not work
|
||||
CREATE TABLE t (c1 INT,c2 CHAR);
|
||||
SELECT SUBSTR(0,@a) FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
@@ -409,6 +409,7 @@ show tables like 't%';
|
||||
Tables_in_test (t%)
|
||||
t1
|
||||
t2
|
||||
drop temporary table t2, T1;
|
||||
# End of 11.2 tests
|
||||
#
|
||||
# MDEV-32026 lowercase_table2.test failures in 11.3
|
||||
|
@@ -347,6 +347,7 @@ select table_name from information_schema.tables where table_schema='test'
|
||||
and table_name='T1';
|
||||
show tables like '_1';
|
||||
show tables like 't%';
|
||||
drop temporary table t2, T1;
|
||||
|
||||
--echo # End of 11.2 tests
|
||||
|
||||
|
@@ -47,3 +47,145 @@ DROP PROCEDURE SP;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-33084 LASTVAL(t1) and LASTVAL(T1) do not work well with lower-case-table-names=0
|
||||
#
|
||||
CREATE SEQUENCE t1;
|
||||
CREATE SEQUENCE T1;
|
||||
SELECT nextval(t1), lastval(t1);
|
||||
nextval(t1) lastval(t1)
|
||||
1 1
|
||||
SELECT nextval(T1), lastval(T1);
|
||||
nextval(T1) lastval(T1)
|
||||
1 1
|
||||
SELECT lastval(t1), lastval(T1) l2;
|
||||
lastval(t1) l2
|
||||
1 1
|
||||
DROP SEQUENCE t1, T1;
|
||||
#
|
||||
# MDEV-33086 SHOW OPEN TABLES IN DB1 -- is case insensitive with lower-case-table-names=0
|
||||
#
|
||||
CREATE DATABASE db1;
|
||||
CREATE TABLE db1.t1 (a INT);
|
||||
SELECT * FROM db1.t1;
|
||||
a
|
||||
SHOW OPEN TABLES IN DB1;
|
||||
Database Table In_use Name_locked
|
||||
SHOW OPEN TABLES IN db1;
|
||||
Database Table In_use Name_locked
|
||||
db1 t1 0 0
|
||||
DROP DATABASE db1;
|
||||
#
|
||||
# MDEV-33088 Cannot create triggers in the database `MYSQL`
|
||||
#
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE TABLE MYSQL.t1 (a INT);
|
||||
CREATE TABLE MYSQL.t2 (a INT);
|
||||
CREATE TRIGGER MYSQL.tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (new.a);
|
||||
INSERT INTO MYSQL.t1 VALUES (10);
|
||||
SELECT * FROM MYSQL.t1;
|
||||
a
|
||||
10
|
||||
SELECT * FROM MYSQL.t2;
|
||||
a
|
||||
10
|
||||
DROP DATABASE MYSQL;
|
||||
#
|
||||
# MDEV-33103 LOCK TABLE t1 AS t2 -- alias is not case sensitive with lower-case-table-names=0
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
LOCK TABLE t1 AS t2 READ;
|
||||
SELECT * FROM t1 AS t2;
|
||||
a
|
||||
1
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLE t1 AS t2 READ;
|
||||
SELECT * FROM t1 AS T2;
|
||||
ERROR HY000: Table 'T2' was not locked with LOCK TABLES
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-33108 TABLE_STATISTICS and INDEX_STATISTICS are case insensitive with lower-case-table-names=0
|
||||
#
|
||||
SET GLOBAL userstat=1;
|
||||
CREATE TABLE t1 (a INT, KEY(a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
CREATE TABLE T1 (a INT, KEY(a));
|
||||
INSERT INTO T1 VALUES (1),(2),(3),(4);
|
||||
SELECT * FROM T1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS ORDER BY BINARY TABLE_NAME;
|
||||
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
|
||||
test T1 4 4 4
|
||||
test t1 4 4 4
|
||||
SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS ORDER BY BINARY TABLE_NAME;
|
||||
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
|
||||
test T1 a 4
|
||||
test t1 a 4
|
||||
DROP TABLE t1;
|
||||
DROP TABLE T1;
|
||||
SET GLOBAL userstat=DEFAULT;
|
||||
#
|
||||
# MDEV-33109 DROP DATABASE MYSQL -- does not drop SP with lower-case-table-names=0
|
||||
#
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE FUNCTION MYSQL.f1() RETURNS INT RETURN 1;
|
||||
DROP DATABASE MYSQL;
|
||||
SELECT db, name, body FROM mysql.proc WHERE db=BINARY 'MYSQL' AND name='f1';
|
||||
db name body
|
||||
#
|
||||
# MDEV-33110 HANDLER commands are case insensitive with lower-case-table-names=0
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
a
|
||||
1
|
||||
CREATE OR REPLACE TABLE T1 (a INT);
|
||||
DROP TABLE T1;
|
||||
HANDLER t1 READ NEXT;
|
||||
a
|
||||
2
|
||||
HANDLER t1 CLOSE;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-33120 System log table names are case insensitive with lower-cast-table-names=0
|
||||
#
|
||||
CREATE TABLE mysql.GENERAL_log (a INT);
|
||||
INSERT INTO mysql.GENERAL_log VALUES (1),(2);
|
||||
DROP TABLE mysql.GENERAL_log;
|
||||
CREATE TABLE mysql.SLOW_log (a INT);
|
||||
INSERT INTO mysql.SLOW_log VALUES (1),(2);
|
||||
DROP TABLE mysql.SLOW_log;
|
||||
CREATE TABLE mysql.TRANSACTION_registry (a INT);
|
||||
INSERT INTO mysql.TRANSACTION_registry VALUES (1),(2);
|
||||
DROP TABLE mysql.TRANSACTION_registry;
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE TABLE MYSQL.general_log (a INT);
|
||||
INSERT INTO MYSQL.general_log VALUES (1),(2);
|
||||
DROP TABLE MYSQL.general_log;
|
||||
CREATE TABLE MYSQL.slow_log (a INT);
|
||||
INSERT INTO MYSQL.slow_log VALUES (1),(2);
|
||||
DROP TABLE MYSQL.slow_log;
|
||||
CREATE TABLE MYSQL.transaction_registry (a INT);
|
||||
INSERT INTO MYSQL.transaction_registry VALUES (1),(2);
|
||||
DROP TABLE MYSQL.transaction_registry;
|
||||
DROP DATABASE MYSQL;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
@@ -49,3 +49,141 @@ DROP PROCEDURE SP;
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33084 LASTVAL(t1) and LASTVAL(T1) do not work well with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE SEQUENCE t1;
|
||||
CREATE SEQUENCE T1;
|
||||
--disable_ps2_protocol
|
||||
SELECT nextval(t1), lastval(t1);
|
||||
SELECT nextval(T1), lastval(T1);
|
||||
SELECT lastval(t1), lastval(T1) l2;
|
||||
--enable_ps2_protocol
|
||||
DROP SEQUENCE t1, T1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33086 SHOW OPEN TABLES IN DB1 -- is case insensitive with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE DATABASE db1;
|
||||
CREATE TABLE db1.t1 (a INT);
|
||||
SELECT * FROM db1.t1;
|
||||
SHOW OPEN TABLES IN DB1;
|
||||
SHOW OPEN TABLES IN db1;
|
||||
DROP DATABASE db1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33088 Cannot create triggers in the database `MYSQL`
|
||||
--echo #
|
||||
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE TABLE MYSQL.t1 (a INT);
|
||||
CREATE TABLE MYSQL.t2 (a INT);
|
||||
CREATE TRIGGER MYSQL.tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (new.a);
|
||||
INSERT INTO MYSQL.t1 VALUES (10);
|
||||
SELECT * FROM MYSQL.t1;
|
||||
SELECT * FROM MYSQL.t2;
|
||||
DROP DATABASE MYSQL;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33103 LOCK TABLE t1 AS t2 -- alias is not case sensitive with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
--disable_view_protocol
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
LOCK TABLE t1 AS t2 READ;
|
||||
SELECT * FROM t1 AS t2;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLE t1 AS t2 READ;
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
SELECT * FROM t1 AS T2;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
--enable_view_protocol
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33108 TABLE_STATISTICS and INDEX_STATISTICS are case insensitive with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
SET GLOBAL userstat=1;
|
||||
CREATE TABLE t1 (a INT, KEY(a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
--disable_ps2_protocol
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
CREATE TABLE T1 (a INT, KEY(a));
|
||||
INSERT INTO T1 VALUES (1),(2),(3),(4);
|
||||
SELECT * FROM T1 ORDER BY a;
|
||||
--enable_ps2_protocol
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS ORDER BY BINARY TABLE_NAME;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS ORDER BY BINARY TABLE_NAME;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE T1;
|
||||
SET GLOBAL userstat=DEFAULT;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33109 DROP DATABASE MYSQL -- does not drop SP with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE FUNCTION MYSQL.f1() RETURNS INT RETURN 1;
|
||||
DROP DATABASE MYSQL;
|
||||
SELECT db, name, body FROM mysql.proc WHERE db=BINARY 'MYSQL' AND name='f1';
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33110 HANDLER commands are case insensitive with lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
CREATE OR REPLACE TABLE T1 (a INT);
|
||||
DROP TABLE T1;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 CLOSE;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33120 System log table names are case insensitive with lower-cast-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE TABLE mysql.GENERAL_log (a INT);
|
||||
INSERT INTO mysql.GENERAL_log VALUES (1),(2);
|
||||
DROP TABLE mysql.GENERAL_log;
|
||||
|
||||
CREATE TABLE mysql.SLOW_log (a INT);
|
||||
INSERT INTO mysql.SLOW_log VALUES (1),(2);
|
||||
DROP TABLE mysql.SLOW_log;
|
||||
|
||||
CREATE TABLE mysql.TRANSACTION_registry (a INT);
|
||||
INSERT INTO mysql.TRANSACTION_registry VALUES (1),(2);
|
||||
DROP TABLE mysql.TRANSACTION_registry;
|
||||
|
||||
CREATE DATABASE MYSQL;
|
||||
CREATE TABLE MYSQL.general_log (a INT);
|
||||
INSERT INTO MYSQL.general_log VALUES (1),(2);
|
||||
DROP TABLE MYSQL.general_log;
|
||||
|
||||
CREATE TABLE MYSQL.slow_log (a INT);
|
||||
INSERT INTO MYSQL.slow_log VALUES (1),(2);
|
||||
DROP TABLE MYSQL.slow_log;
|
||||
|
||||
CREATE TABLE MYSQL.transaction_registry (a INT);
|
||||
INSERT INTO MYSQL.transaction_registry VALUES (1),(2);
|
||||
DROP TABLE MYSQL.transaction_registry;
|
||||
DROP DATABASE MYSQL;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
@@ -137,6 +137,10 @@ c int(11) YES NULL
|
||||
drop table t1;
|
||||
1
|
||||
1
|
||||
--------------
|
||||
use
|
||||
--------------
|
||||
|
||||
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
|
||||
ERROR at line 1: USE must be followed by a database name
|
||||
1 +1
|
||||
@@ -166,6 +170,10 @@ count(*)
|
||||
drop table t17583;
|
||||
Test connect without db- or host-name => reconnect
|
||||
Test connect with dbname only => new dbname, old hostname
|
||||
--------------
|
||||
connecttest
|
||||
--------------
|
||||
|
||||
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'connecttest' at line 1
|
||||
Test connect with _invalid_ dbname only => new invalid dbname, old hostname
|
||||
ERROR 1049 (42000) at line 1: Unknown database 'invalid'
|
||||
@@ -662,6 +670,17 @@ tee
|
||||
source
|
||||
^^^
|
||||
3
|
||||
#
|
||||
# MDEV-34203: Sandbox mode \- is not compatible with --binary-mode
|
||||
#
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-30327 Client crashes in print_last_query_cost
|
||||
|
@@ -756,6 +756,22 @@ source $MYSQL_TMP_DIR/mysql_in;" $MYSQL_TMP_DIR/mysql_in2;
|
||||
--remove_file $MYSQL_TMP_DIR/mysql_in
|
||||
--remove_file $MYSQL_TMP_DIR/mysql_in2
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34203: Sandbox mode \- is not compatible with --binary-mode
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
|
||||
--exec $MYSQL_DUMP test t1 > $MYSQLTEST_VARDIR/tmp/MDEV-34203.sql
|
||||
|
||||
drop table t1;
|
||||
|
||||
--exec $MYSQL --binary-mode test 2>&1 < $MYSQLTEST_VARDIR/tmp/MDEV-34203.sql
|
||||
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/MDEV-34203.sql
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
|
@@ -6489,14 +6489,6 @@ Table Create Table
|
||||
s4 CREATE SEQUENCE `s4` start with 400 minvalue 400 maxvalue 1400 increment by 40 cache 1000 cycle ENGINE=MyISAM
|
||||
# Dump sequence without `--no-data`
|
||||
# Restore from mysqldump
|
||||
SETVAL(`s1`, 1101, 0)
|
||||
1101
|
||||
SETVAL(`s2`, 1201, 0)
|
||||
1201
|
||||
SETVAL(`s3`, 1301, 0)
|
||||
1301
|
||||
SETVAL(`s4`, 1401, 0)
|
||||
1401
|
||||
# Show create after restore
|
||||
show create sequence d.s1;
|
||||
Table Create Table
|
||||
@@ -6515,14 +6507,6 @@ NEXTVAL(d.s1) NEXTVAL(d.s2) NEXTVAL(d.s3) NEXTVAL(d.s4)
|
||||
100 200 300 400
|
||||
# Dump sequence with `--no-data`
|
||||
# Restore from mysqldump
|
||||
SETVAL(`s1`, 1101, 0)
|
||||
1101
|
||||
SETVAL(`s2`, 1201, 0)
|
||||
1201
|
||||
SETVAL(`s3`, 1301, 0)
|
||||
1301
|
||||
SETVAL(`s4`, 1401, 0)
|
||||
1401
|
||||
# Show create after restore `--no-data`
|
||||
show create sequence d.s1;
|
||||
Table Create Table
|
||||
@@ -6541,14 +6525,6 @@ NEXTVAL(d.s1) NEXTVAL(d.s2) NEXTVAL(d.s3) NEXTVAL(d.s4)
|
||||
100 200 300 400
|
||||
# Restore to different database than original
|
||||
create database d2;
|
||||
SETVAL(`s1`, 1101, 0)
|
||||
1101
|
||||
SETVAL(`s2`, 1201, 0)
|
||||
1201
|
||||
SETVAL(`s3`, 1301, 0)
|
||||
1301
|
||||
SETVAL(`s4`, 1401, 0)
|
||||
1401
|
||||
show create sequence d2.s1;
|
||||
Table Create Table
|
||||
s1 CREATE SEQUENCE `s1` start with 100 minvalue 100 maxvalue 1100 increment by 10 cache 1000 cycle ENGINE=MyISAM
|
||||
@@ -6576,9 +6552,15 @@ j integer
|
||||
INSERT INTO t VALUES (1,1),(2,2),(3,3),(4,4);
|
||||
# Dump database 1
|
||||
# Restore from database 1 to database 2
|
||||
--------------
|
||||
INSERT INTO `t` VALUES
|
||||
(1,1),
|
||||
(2,2),
|
||||
(3,3),
|
||||
(4,4)
|
||||
--------------
|
||||
|
||||
ERROR 1100 (HY000) at line 46: Table 'seq_t_i' was not locked with LOCK TABLES
|
||||
SETVAL(`seq_t_i`, 1, 0)
|
||||
1
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
#
|
||||
|
@@ -89,3 +89,32 @@ f
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
# MDEV-33769: Memory leak found in the test main.rownum run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT
|
||||
#
|
||||
CREATE OR REPLACE TABLE t1(a INT);
|
||||
PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE ROWNUM() < 2';
|
||||
EXECUTE stmt;
|
||||
1
|
||||
EXECUTE stmt;
|
||||
1
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
PREPARE stmt FROM 'SELECT * FROM t1 WHERE ROWNUM() < ?';
|
||||
# Expected output is two rows (1), (2)
|
||||
EXECUTE stmt USING 3;
|
||||
a
|
||||
1
|
||||
2
|
||||
# Expected output is one row (1)
|
||||
EXECUTE stmt USING 2;
|
||||
a
|
||||
1
|
||||
# Expected output is three rows (1), (2), (3)
|
||||
EXECUTE stmt USING 4;
|
||||
a
|
||||
1
|
||||
2
|
||||
# Clean up
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
# End of 10.6 tests
|
||||
|
@@ -110,3 +110,27 @@ DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.4 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33769: Memory leak found in the test main.rownum run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT
|
||||
--echo #
|
||||
CREATE OR REPLACE TABLE t1(a INT);
|
||||
PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE ROWNUM() < 2';
|
||||
EXECUTE stmt;
|
||||
EXECUTE stmt;
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
|
||||
PREPARE stmt FROM 'SELECT * FROM t1 WHERE ROWNUM() < ?';
|
||||
--echo # Expected output is two rows (1), (2)
|
||||
EXECUTE stmt USING 3;
|
||||
--echo # Expected output is one row (1)
|
||||
EXECUTE stmt USING 2;
|
||||
--echo # Expected output is three rows (1), (2), (3)
|
||||
EXECUTE stmt USING 4;
|
||||
|
||||
--echo # Clean up
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
@@ -1171,7 +1171,7 @@ SET j= 1 + i;
|
||||
END|
|
||||
CALL ctest();
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'string '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'string'
|
||||
DROP PROCEDURE ctest;
|
||||
CREATE PROCEDURE vctest()
|
||||
BEGIN
|
||||
|
40
mysql-test/main/type_char.result
Normal file
40
mysql-test/main/type_char.result
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-34295 CAST(char_col AS DOUBLE) prints redundant spaces in a warning
|
||||
#
|
||||
CREATE TABLE t1 (a CHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci);
|
||||
INSERT INTO t1 VALUES ('1x'), ('x');
|
||||
SELECT a, CAST(a AS DOUBLE) FROM t1 ORDER BY a;
|
||||
a CAST(a AS DOUBLE)
|
||||
1x 1
|
||||
x 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '1x'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'x'
|
||||
SELECT a, CAST(a AS DECIMAL(20,2)) FROM t1 ORDER BY a;
|
||||
a CAST(a AS DECIMAL(20,2))
|
||||
1x 1.00
|
||||
x 0.00
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '1x'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 'x'
|
||||
SELECT a, CAST(a AS SIGNED) FROM t1 ORDER BY a;
|
||||
a CAST(a AS SIGNED)
|
||||
1x 1
|
||||
x 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1x'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'x'
|
||||
SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY a;
|
||||
a CAST(a AS UNSIGNED)
|
||||
1x 1
|
||||
x 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1x'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'x'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
19
mysql-test/main/type_char.test
Normal file
19
mysql-test/main/type_char.test
Normal file
@@ -0,0 +1,19 @@
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34295 CAST(char_col AS DOUBLE) prints redundant spaces in a warning
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a CHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci);
|
||||
INSERT INTO t1 VALUES ('1x'), ('x');
|
||||
SELECT a, CAST(a AS DOUBLE) FROM t1 ORDER BY a;
|
||||
SELECT a, CAST(a AS DECIMAL(20,2)) FROM t1 ORDER BY a;
|
||||
SELECT a, CAST(a AS SIGNED) FROM t1 ORDER BY a;
|
||||
SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
@@ -465,7 +465,7 @@ a (a + 0)
|
||||
t 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '1a'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 't '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 't'
|
||||
SELECT a,(a DIV 2) FROM t1 ORDER BY a;
|
||||
a (a DIV 2)
|
||||
10 5
|
||||
@@ -476,7 +476,7 @@ a (a DIV 2)
|
||||
t 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '1a'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 't '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 't'
|
||||
SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
|
||||
a CAST(a AS SIGNED)
|
||||
10 10
|
||||
@@ -508,8 +508,8 @@ SELECT 5 = a FROM t1;
|
||||
0
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 's '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 's'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||
|
@@ -1948,6 +1948,38 @@ connection default;
|
||||
drop user user_11766767;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
#
|
||||
# MDEV-33119 User is case insensitive in INFORMATION_SCHEMA.VIEWS
|
||||
#
|
||||
USE test;
|
||||
CREATE USER foo;
|
||||
CREATE USER FOO;
|
||||
GRANT SELECT ON test.* TO foo;
|
||||
GRANT SELECT ON test.* TO FOO;
|
||||
CREATE DEFINER=foo SQL SECURITY INVOKER VIEW v1 AS SELECT 1 AS c1;
|
||||
connect FOO, localhost, FOO, , test;
|
||||
connection FOO;
|
||||
SELECT CURRENT_USER;
|
||||
CURRENT_USER
|
||||
FOO@%
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS;
|
||||
TABLE_CATALOG def
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME v1
|
||||
VIEW_DEFINITION
|
||||
CHECK_OPTION NONE
|
||||
IS_UPDATABLE NO
|
||||
DEFINER foo@%
|
||||
SECURITY_TYPE INVOKER
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
ALGORITHM UNDEFINED
|
||||
disconnect FOO;
|
||||
connection default;
|
||||
DROP VIEW v1;
|
||||
DROP USER foo;
|
||||
DROP USER FOO;
|
||||
# End of 10.5 tests
|
||||
# Check that a user without access to the schema 'foo' cannot query
|
||||
# a JSON_TABLE view in that schema.
|
||||
CREATE SCHEMA foo;
|
||||
@@ -1964,3 +1996,4 @@ connection default;
|
||||
disconnect con1;
|
||||
drop user foo@localhost;
|
||||
drop schema foo;
|
||||
# End of 10.6 tests
|
||||
|
@@ -2207,6 +2207,35 @@ drop user user_11766767;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33119 User is case insensitive in INFORMATION_SCHEMA.VIEWS
|
||||
--echo #
|
||||
|
||||
USE test;
|
||||
CREATE USER foo;
|
||||
CREATE USER FOO;
|
||||
GRANT SELECT ON test.* TO foo;
|
||||
GRANT SELECT ON test.* TO FOO;
|
||||
|
||||
CREATE DEFINER=foo SQL SECURITY INVOKER VIEW v1 AS SELECT 1 AS c1;
|
||||
|
||||
--connect (FOO, localhost, FOO, , test)
|
||||
--connection FOO
|
||||
|
||||
SELECT CURRENT_USER;
|
||||
--vertical_results
|
||||
--query_vertical SELECT * FROM INFORMATION_SCHEMA.VIEWS
|
||||
--horizontal_results
|
||||
|
||||
--disconnect FOO
|
||||
--connection default
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP USER foo;
|
||||
DROP USER FOO;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo # Check that a user without access to the schema 'foo' cannot query
|
||||
--echo # a JSON_TABLE view in that schema.
|
||||
CREATE SCHEMA foo;
|
||||
@@ -2225,7 +2254,7 @@ connection default;
|
||||
disconnect con1;
|
||||
drop user foo@localhost;
|
||||
drop schema foo;
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
|
@@ -4514,6 +4514,180 @@ row_number() OVER (order by a)
|
||||
3
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-29307: join of 2 derived tables over the same grouping view such
|
||||
# that the first of the joined tables contains a window
|
||||
# function and the view's specification contains a subquery
|
||||
# with a set function aggregated on the top level
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
tst int NOT NULL,
|
||||
flat tinyint unsigned NOT NULL,
|
||||
type tinyint unsigned NOT NULL,
|
||||
val int NOT NULL,
|
||||
PRIMARY KEY (tst,flat,type)
|
||||
) ENGINE=ARIA;
|
||||
INSERT INTO t1 VALUES
|
||||
(5, 20, 2, 100),
|
||||
(7, 20, 2, 150),
|
||||
(9, 20, 1, 200);
|
||||
CREATE VIEW v1 AS (
|
||||
SELECT
|
||||
flat,
|
||||
type,
|
||||
( SELECT val FROM t1 sw
|
||||
WHERE sw.tst = MAX(w.tst) AND sw.flat = w.flat AND sw.type = w.type)
|
||||
AS total
|
||||
FROM t1 w
|
||||
GROUP BY flat, type
|
||||
);
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 PRIMARY <derived6> ref key0 key0 1 v1.flat 1 100.00 Using where
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`v1`.`total` AS `w1_total` from `test`.`v1` join `test`.`v1` where `v1`.`flat` = `v1`.`flat` and `v1`.`type` = 2 and `v1`.`type` = 1
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
w2_total w1_total
|
||||
150 200
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY type ORDER BY type) AS u
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 PRIMARY <derived6> ref key0 key0 1 w1.flat 1 100.00 Using where
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
2 DERIVED <derived4> ALL NULL NULL NULL NULL 3 100.00 Using where; Using temporary
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`w1`.`total` AS `w1_total` from (/* select#2 */ select `v1`.`flat` AS `flat`,`v1`.`type` AS `type`,`v1`.`total` AS `total`,count(`v1`.`total`) over ( partition by `v1`.`type` order by `v1`.`type`) AS `u` from `test`.`v1` where `v1`.`type` = 1) `w1` join `test`.`v1` where `v1`.`flat` = `w1`.`flat` and `v1`.`type` = 2
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY type ORDER BY type) AS u
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
w2_total w1_total
|
||||
150 200
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total, u
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY flat ORDER BY flat) AS u
|
||||
FROM v1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
) AS w2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
2 DERIVED <derived4> ALL NULL NULL NULL NULL 3 100.00 Using temporary
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`w1`.`total` AS `w1_total`,`w1`.`u` AS `u` from (/* select#2 */ select `v1`.`flat` AS `flat`,`v1`.`type` AS `type`,`v1`.`total` AS `total`,count(`v1`.`total`) over ( partition by `v1`.`flat` order by `v1`.`flat`) AS `u` from `test`.`v1`) `w1` join `test`.`v1`
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total, u
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY flat ORDER BY flat) AS u
|
||||
FROM v1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
) AS w2;
|
||||
w2_total w1_total u
|
||||
150 150 2
|
||||
150 200 2
|
||||
200 150 2
|
||||
200 200 2
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER
|
||||
#
|
||||
CREATE TABLE t(c1 INT);
|
||||
|
@@ -2886,6 +2886,99 @@ insert into t1 values (1),(2),(3);
|
||||
SELECT row_number() OVER (order by a) FROM t1 order by NAME_CONST('myname',NULL);
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29307: join of 2 derived tables over the same grouping view such
|
||||
--echo # that the first of the joined tables contains a window
|
||||
--echo # function and the view's specification contains a subquery
|
||||
--echo # with a set function aggregated on the top level
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
tst int NOT NULL,
|
||||
flat tinyint unsigned NOT NULL,
|
||||
type tinyint unsigned NOT NULL,
|
||||
val int NOT NULL,
|
||||
PRIMARY KEY (tst,flat,type)
|
||||
) ENGINE=ARIA;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(5, 20, 2, 100),
|
||||
(7, 20, 2, 150),
|
||||
(9, 20, 1, 200);
|
||||
|
||||
CREATE VIEW v1 AS (
|
||||
SELECT
|
||||
flat,
|
||||
type,
|
||||
( SELECT val FROM t1 sw
|
||||
WHERE sw.tst = MAX(w.tst) AND sw.flat = w.flat AND sw.type = w.type)
|
||||
AS total
|
||||
FROM t1 w
|
||||
GROUP BY flat, type
|
||||
);
|
||||
|
||||
let $q1=
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
|
||||
eval EXPLAIN EXTENDED $q1;
|
||||
eval $q1;
|
||||
|
||||
let $q2=
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY type ORDER BY type) AS u
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
|
||||
eval EXPLAIN EXTENDED $q2;
|
||||
eval $q2;
|
||||
|
||||
let $q3=
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total, u
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY flat ORDER BY flat) AS u
|
||||
FROM v1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
) AS w2;
|
||||
|
||||
eval EXPLAIN EXTENDED $q3;
|
||||
--sorted_result
|
||||
eval $q3;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER
|
||||
--echo #
|
||||
|
@@ -991,20 +991,20 @@ CALL spxml('<a><b>b1</b><b>b2</b></a>', '1 and string');
|
||||
ExtractValue(xml,'/a/b[$i]')
|
||||
b1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1 and string '
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1 and string '
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1 and string'
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1 and string'
|
||||
CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string and 1');
|
||||
ExtractValue(xml,'/a/b[$i]')
|
||||
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string and 1 '
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string and 1 '
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string and 1'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string and 1'
|
||||
CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string');
|
||||
ExtractValue(xml,'/a/b[$i]')
|
||||
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string '
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string '
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'string'
|
||||
DROP PROCEDURE spxml;
|
||||
select UpdateXML('<a>a</a>',repeat('a b ',1000),'');
|
||||
ERROR HY000: XPATH syntax error: 'b a b a b a b a b a b a b a b...'
|
||||
|
@@ -339,7 +339,11 @@ my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
|
||||
my $opt_core_on_failure= 0;
|
||||
|
||||
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
|
||||
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 20;
|
||||
# Some galera tests starts 6 galera nodes. Each galera node requires
|
||||
# three ports: 6*3 = 18. Plus 6 ports are needed for 6 mariadbd servers.
|
||||
# Since the number of ports is rounded up to 10 everywhere, we will
|
||||
# take 30 as the default value:
|
||||
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 30;
|
||||
|
||||
# lock file to stop tests
|
||||
my $opt_stop_file= $ENV{MTR_STOP_FILE};
|
||||
@@ -436,7 +440,7 @@ sub main {
|
||||
{
|
||||
$opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1;
|
||||
}
|
||||
elsif (IS_MAC)
|
||||
elsif (IS_MAC || IS_FREEBSD)
|
||||
{
|
||||
$opt_parallel= `sysctl -n hw.ncpu`;
|
||||
}
|
||||
@@ -5587,6 +5591,8 @@ sub start_check_testcase ($$$) {
|
||||
mtr_add_arg($args, "--record");
|
||||
}
|
||||
my $errfile= "$opt_vardir/tmp/$name.err";
|
||||
|
||||
My::Debugger::setup_client_args(\$args, \$exe_mysqltest);
|
||||
my $proc= My::SafeProcess->new
|
||||
(
|
||||
name => $name,
|
||||
|
15
mysql-test/suite/csv/lowercase_table0.result
Normal file
15
mysql-test/suite/csv/lowercase_table0.result
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# MDEV-33085 Tables T1 and t1 do not work well with ENGINE=CSV and lower-case-table-names=0
|
||||
#
|
||||
CREATE OR REPLACE TABLE t1 (a INT NOT NULL) ENGINE=CSV;
|
||||
CREATE OR REPLACE TABLE T1 (a INT NOT NULL) ENGINE=CSV;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
INSERT INTO T1 VALUES (20);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
10
|
||||
SELECT * FROM T1;
|
||||
a
|
||||
20
|
||||
DROP TABLE t1;
|
||||
DROP TABLE T1;
|
16
mysql-test/suite/csv/lowercase_table0.test
Normal file
16
mysql-test/suite/csv/lowercase_table0.test
Normal file
@@ -0,0 +1,16 @@
|
||||
--source include/have_csv.inc
|
||||
--source include/have_lowercase0.inc
|
||||
--source include/have_case_sensitive_file_system.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33085 Tables T1 and t1 do not work well with ENGINE=CSV and lower-case-table-names=0
|
||||
--echo #
|
||||
|
||||
CREATE OR REPLACE TABLE t1 (a INT NOT NULL) ENGINE=CSV;
|
||||
CREATE OR REPLACE TABLE T1 (a INT NOT NULL) ENGINE=CSV;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
INSERT INTO T1 VALUES (20);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM T1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE T1;
|
@@ -4520,6 +4520,180 @@ row_number() OVER (order by a)
|
||||
3
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-29307: join of 2 derived tables over the same grouping view such
|
||||
# that the first of the joined tables contains a window
|
||||
# function and the view's specification contains a subquery
|
||||
# with a set function aggregated on the top level
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
tst int NOT NULL,
|
||||
flat tinyint unsigned NOT NULL,
|
||||
type tinyint unsigned NOT NULL,
|
||||
val int NOT NULL,
|
||||
PRIMARY KEY (tst,flat,type)
|
||||
) ENGINE=ARIA;
|
||||
INSERT INTO t1 VALUES
|
||||
(5, 20, 2, 100),
|
||||
(7, 20, 2, 150),
|
||||
(9, 20, 1, 200);
|
||||
CREATE VIEW v1 AS (
|
||||
SELECT
|
||||
flat,
|
||||
type,
|
||||
( SELECT val FROM t1 sw
|
||||
WHERE sw.tst = MAX(w.tst) AND sw.flat = w.flat AND sw.type = w.type)
|
||||
AS total
|
||||
FROM t1 w
|
||||
GROUP BY flat, type
|
||||
);
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 PRIMARY <derived6> ref key0 key0 1 v1.flat 1 100.00 Using where
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`v1`.`total` AS `w1_total` from `test`.`v1` join `test`.`v1` where `v1`.`flat` = `v1`.`flat` and `v1`.`type` = 2 and `v1`.`type` = 1
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
w2_total w1_total
|
||||
150 200
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY type ORDER BY type) AS u
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
1 PRIMARY <derived6> ref key0 key0 1 w1.flat 1 100.00 Using where
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
2 DERIVED <derived4> ALL NULL NULL NULL NULL 3 100.00 Using where; Using temporary
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using where; Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`w1`.`total` AS `w1_total` from (/* select#2 */ select `v1`.`flat` AS `flat`,`v1`.`type` AS `type`,`v1`.`total` AS `total`,count(`v1`.`total`) over ( partition by `v1`.`type` order by `v1`.`type`) AS `u` from `test`.`v1` where `v1`.`type` = 1) `w1` join `test`.`v1` where `v1`.`flat` = `w1`.`flat` and `v1`.`type` = 2
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY type ORDER BY type) AS u
|
||||
FROM v1
|
||||
WHERE type = 1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
WHERE type = 2
|
||||
) AS w2
|
||||
ON w1.flat = w2.flat;
|
||||
w2_total w1_total
|
||||
150 200
|
||||
EXPLAIN EXTENDED SELECT w2.total AS w2_total, w1.total AS w1_total, u
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY flat ORDER BY flat) AS u
|
||||
FROM v1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
) AS w2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
|
||||
6 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using index; Using temporary; Using filesort
|
||||
7 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
2 DERIVED <derived4> ALL NULL NULL NULL NULL 3 100.00 Using temporary
|
||||
4 DERIVED w index NULL PRIMARY 6 NULL 3 100.00 Using index; Using temporary; Using filesort
|
||||
5 DEPENDENT SUBQUERY sw eq_ref PRIMARY PRIMARY 6 func,func,func 1 100.00 Using index condition
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1981 Aggregate function 'max()' of SELECT #5 belongs to SELECT #4
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #5 was resolved in SELECT #4
|
||||
Note 1276 Field or reference 'test.w.tst' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1981 Aggregate function 'max()' of SELECT #7 belongs to SELECT #6
|
||||
Note 1276 Field or reference 'test.w.flat' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1276 Field or reference 'test.w.type' of SELECT #7 was resolved in SELECT #6
|
||||
Note 1003 /* select#1 */ select `v1`.`total` AS `w2_total`,`w1`.`total` AS `w1_total`,`w1`.`u` AS `u` from (/* select#2 */ select `v1`.`flat` AS `flat`,`v1`.`type` AS `type`,`v1`.`total` AS `total`,count(`v1`.`total`) over ( partition by `v1`.`flat` order by `v1`.`flat`) AS `u` from `test`.`v1`) `w1` join `test`.`v1`
|
||||
SELECT w2.total AS w2_total, w1.total AS w1_total, u
|
||||
FROM
|
||||
(
|
||||
SELECT flat, type, total,
|
||||
COUNT(total) OVER (PARTITION BY flat ORDER BY flat) AS u
|
||||
FROM v1
|
||||
) AS w1
|
||||
JOIN
|
||||
(
|
||||
SELECT flat, type, total
|
||||
FROM v1
|
||||
) AS w2;
|
||||
w2_total w1_total u
|
||||
150 150 2
|
||||
150 200 2
|
||||
200 150 2
|
||||
200 200 2
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER
|
||||
#
|
||||
CREATE TABLE t(c1 INT);
|
||||
|
@@ -2202,9 +2202,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -2218,9 +2218,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@@ -3523,9 +3523,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -3540,9 +3540,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@@ -2203,9 +2203,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -2219,9 +2219,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@@ -3524,9 +3524,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -3541,9 +3541,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@@ -2203,9 +2203,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -2219,9 +2219,9 @@ IS NOT TRUE <--------30 characters-------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ''
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@@ -3524,9 +3524,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@@ -3541,9 +3541,9 @@ NULL NULL 1
|
||||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 26
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--'
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@@ -23,4 +23,3 @@ galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep:
|
||||
galera_sst_mysqldump_with_key : MDEV-32782 galera_sst_mysqldump_with_key test failed
|
||||
galera_var_ignore_apply_errors : MENT-1997 galera_var_ignore_apply_errors test freezes
|
||||
galera_desync_overlapped : MDEV-21538 galera_desync_overlapped MTR failed: Result content mismatch
|
||||
galera_create_table_as_select : MDEV-33952 fails sporadically
|
||||
|
@@ -33,6 +33,9 @@ wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -47,6 +47,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
wsrep-on=OFF
|
||||
server-id=3
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -46,6 +46,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
wsrep-on=OFF
|
||||
server-id=3
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -11,7 +11,6 @@ default-storage-engine=innodb
|
||||
wsrep_gtid_mode=1
|
||||
gtid_ignore_duplicates
|
||||
auto_increment_increment=3
|
||||
|
||||
wsrep-provider=@ENV.WSREP_PROVIDER
|
||||
# enforce read-committed characteristics across the cluster
|
||||
# wsrep-causal-reads=ON
|
||||
@@ -61,6 +60,9 @@ wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
@@ -73,5 +75,3 @@ NODE_MYSOCK_3= @mysqld.3.socket
|
||||
|
||||
NODE_MYPORT_4= @mysqld.4.port
|
||||
NODE_MYSOCK_4= @mysqld.4.socket
|
||||
|
||||
|
||||
|
@@ -59,6 +59,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
|
||||
wsrep-on=OFF
|
||||
server-id=4
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -59,6 +59,9 @@ wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
|
||||
auto-increment-offset=4
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
6
mysql-test/suite/galera/r/MDEV-33523.result
Normal file
6
mysql-test/suite/galera/r/MDEV-33523.result
Normal file
@@ -0,0 +1,6 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
SET SESSION wsrep_on=OFF;
|
||||
BEGIN;
|
||||
ROLLBACK;
|
||||
SET SESSION wsrep_on=OFF;
|
@@ -22,12 +22,6 @@ EXPECT_1
|
||||
1
|
||||
gtid_binlog_state_equal
|
||||
0
|
||||
connection node_2;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM t1;
|
||||
EXPECT_1
|
||||
1
|
||||
gtid_binlog_state_equal
|
||||
0
|
||||
#cleanup
|
||||
connection node_3;
|
||||
DROP TABLE t1;
|
||||
|
@@ -49,16 +49,23 @@ a b
|
||||
disconnect node_2a;
|
||||
disconnect node_2b;
|
||||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
connection node_2a;
|
||||
SET SESSION wsrep_on=OFF;
|
||||
begin;
|
||||
update t1 set a =5, b=2;
|
||||
connection node_2;
|
||||
ALTER TABLE t1 ADD UNIQUE KEY b3(b);
|
||||
connection node_2b;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
connection node_2a;
|
||||
select * from t1;
|
||||
a b
|
||||
2 1
|
||||
5 2
|
||||
commit;
|
||||
connection node_2;
|
||||
disconnect node_2a;
|
||||
disconnect node_2b;
|
||||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
connection node_2a;
|
||||
SET SESSION wsrep_on=OFF;
|
||||
@@ -67,7 +74,7 @@ update t1 set a =5, b=2;
|
||||
connection node_2;
|
||||
select * from t1;
|
||||
a b
|
||||
2 1
|
||||
5 2
|
||||
disconnect node_2a;
|
||||
connection node_1;
|
||||
drop table t1;
|
||||
|
@@ -76,22 +76,21 @@ EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1, t2;
|
||||
connection node_1;
|
||||
SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_apply_cb';
|
||||
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
|
||||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
LOCK TABLE t2 WRITE;
|
||||
connection node_1;
|
||||
SET DEBUG_SYNC = 'create_table_select_before_create WAIT_FOR sync.wsrep_apply_cb_reached';
|
||||
SET DEBUG_SYNC = 'create_table_select_before_lock SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort';
|
||||
CREATE TABLE t1 AS SELECT * FROM t2;;
|
||||
connection node_1a;
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 5 FROM t2;
|
||||
COUNT(*) = 5
|
||||
1
|
||||
CREATE TABLE t1 AS SELECT * FROM t2;
|
||||
connection node_1a;
|
||||
UNLOCK TABLES;
|
||||
connection node_1;
|
||||
Got one of the listed errors
|
||||
ERROR 70100: Query execution was interrupted
|
||||
SET GLOBAL DEBUG_DBUG = '';
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
|
||||
|
46
mysql-test/suite/galera/r/galera_partition_key.result
Normal file
46
mysql-test/suite/galera/r/galera_partition_key.result
Normal file
@@ -0,0 +1,46 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`other_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`,`other_id`)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY LIST (`id` MOD 2)
|
||||
(PARTITION `p0` VALUES IN (0) ENGINE = InnoDB,
|
||||
PARTITION `p1` VALUES IN (1) ENGINE = InnoDB);
|
||||
INSERT INTO t1 VALUES (1, 0);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2(SELECT * FROM t1 WHERE id = 1);
|
||||
DELETE FROM t1 WHERE id = 1;
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SELECT * from t1;
|
||||
id other_id
|
||||
SELECT * from t2;
|
||||
id other_id
|
||||
1 0
|
||||
DROP TABLE t1, t2;
|
||||
connection node_1;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`other_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY LIST (`id` MOD 2)
|
||||
(PARTITION `p0` VALUES IN (0) ENGINE = InnoDB,
|
||||
PARTITION `p1` VALUES IN (1) ENGINE = InnoDB);
|
||||
INSERT INTO t1 VALUES (1, 0);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2(SELECT * FROM t1 WHERE id = 1);
|
||||
DELETE FROM t1 WHERE id = 1;
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SELECT * from t1;
|
||||
id other_id
|
||||
SELECT * from t2;
|
||||
id other_id
|
||||
1 0
|
||||
DROP TABLE t1, t2;
|
71
mysql-test/suite/galera/r/galera_replica_no_gtid.result
Normal file
71
mysql-test/suite/galera/r/galera_replica_no_gtid.result
Normal file
@@ -0,0 +1,71 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
flush privileges;
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_2;
|
||||
START SLAVE;
|
||||
connection node_3;
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
# Verify that graceful shutdown succeeds.
|
||||
# Force SST
|
||||
connection node_1;
|
||||
# Waiting until node_2 is not part of cluster anymore
|
||||
connection node_2;
|
||||
# Start node_2 again
|
||||
¤ Wait until node_2 is back on cluster
|
||||
connection node_2;
|
||||
call mtr.add_suppression("Slave: Operation CREATE USER failed for .*");
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_3;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
connection node_3;
|
||||
RESET MASTER;
|
||||
drop table t1;
|
||||
connection node_2;
|
||||
DROP TABLE t1;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
disconnect node_3;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
11
mysql-test/suite/galera/t/MDEV-33523.test
Normal file
11
mysql-test/suite/galera/t/MDEV-33523.test
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# MDEV-33523: Spurious deadlock error when wsrep_on=OFF
|
||||
#
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
SET SESSION wsrep_on=OFF;
|
||||
BEGIN;
|
||||
# If bug is present, the following rollback
|
||||
# results in ER_LOCK_DEADLOCK error.
|
||||
ROLLBACK;
|
||||
SET SESSION wsrep_on=OFF;
|
@@ -46,18 +46,8 @@ SELECT LENGTH(@@global.gtid_binlog_state) > 1;
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM t1;
|
||||
|
||||
--disable_query_log
|
||||
--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
|
||||
--enable_query_log
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM t1;
|
||||
# Note that MyISAM tables are not replicated by Galera so we do not here
|
||||
# check node_2
|
||||
|
||||
--disable_query_log
|
||||
--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
|
||||
|
@@ -94,27 +94,43 @@ select * from t1;
|
||||
--disconnect node_2b
|
||||
|
||||
#
|
||||
# Test case 5: Start a transaction on node_2a with wsrep disabled
|
||||
# and start a DDL on other transaction that will then abort node_2a
|
||||
# transactions
|
||||
# Test case 5: Start a transaction on node_2a with wsrep disabled.
|
||||
# A conflicting DDL on other transaction can't BF abort
|
||||
# transaction from node_2a (wsrep disabled).
|
||||
#
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connection node_2a
|
||||
SET SESSION wsrep_on=OFF;
|
||||
begin;
|
||||
update t1 set a =5, b=2;
|
||||
|
||||
--connection node_2
|
||||
ALTER TABLE t1 ADD UNIQUE KEY b3(b);
|
||||
--send ALTER TABLE t1 ADD UNIQUE KEY b3(b)
|
||||
|
||||
--connection node_2b
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2a
|
||||
select * from t1;
|
||||
|
||||
# We expect that ALTER should not be able to BF abort
|
||||
# this transaction, it must wait for it to finish.
|
||||
# Expect commit to succeed.
|
||||
commit;
|
||||
|
||||
--connection node_2
|
||||
--reap
|
||||
|
||||
--disconnect node_2a
|
||||
--disconnect node_2b
|
||||
|
||||
#
|
||||
# Test case 6: Start a transaction on node_2a with wsrep disabled
|
||||
# and kill it from other connection on same node
|
||||
# and kill it from other connection on same node.
|
||||
#
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
|
@@ -3,6 +3,8 @@
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--connection node_1
|
||||
SET SESSION default_storage_engine=InnoDB;
|
||||
@@ -103,31 +105,27 @@ DROP TABLE t1, t2;
|
||||
#
|
||||
|
||||
--connection node_1
|
||||
# Pause applying CTAS command from the other node
|
||||
SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_apply_cb';
|
||||
|
||||
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
LOCK TABLE t2 WRITE;
|
||||
|
||||
--connection node_1
|
||||
# Wait until local CTAS grabs MDL lock and let applied CTAS BF-abort it
|
||||
SET DEBUG_SYNC = 'create_table_select_before_create WAIT_FOR sync.wsrep_apply_cb_reached';
|
||||
SET DEBUG_SYNC = 'create_table_select_before_lock SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort';
|
||||
--send CREATE TABLE t1 AS SELECT * FROM t2;
|
||||
|
||||
--connection node_1a
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE STATE LIKE 'Waiting for table metadata lock%'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) = 5 FROM t2;
|
||||
CREATE TABLE t1 AS SELECT * FROM t2;
|
||||
|
||||
--connection node_1a
|
||||
UNLOCK TABLES;
|
||||
|
||||
--connection node_1
|
||||
--error ER_TABLE_EXISTS_ERROR,ER_QUERY_INTERRUPTED
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
--reap
|
||||
|
||||
SET GLOBAL DEBUG_DBUG = '';
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
|
@@ -1,5 +1,6 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/log_bin.inc
|
||||
|
||||
#
|
||||
# This tests simple autocommit replication of MyISAM tables.
|
||||
|
@@ -2,6 +2,7 @@
|
||||
--source include/have_partition.inc
|
||||
--source include/big_test.inc
|
||||
--source include/force_restart.inc
|
||||
--source include/log_bin.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
|
55
mysql-test/suite/galera/t/galera_partition_key.test
Normal file
55
mysql-test/suite/galera/t/galera_partition_key.test
Normal file
@@ -0,0 +1,55 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/log_bin.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`other_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`,`other_id`)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY LIST (`id` MOD 2)
|
||||
(PARTITION `p0` VALUES IN (0) ENGINE = InnoDB,
|
||||
PARTITION `p1` VALUES IN (1) ENGINE = InnoDB);
|
||||
|
||||
INSERT INTO t1 VALUES (1, 0);
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO t2(SELECT * FROM t1 WHERE id = 1);
|
||||
DELETE FROM t1 WHERE id = 1;
|
||||
|
||||
COMMIT;
|
||||
|
||||
--connection node_2
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`other_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY LIST (`id` MOD 2)
|
||||
(PARTITION `p0` VALUES IN (0) ENGINE = InnoDB,
|
||||
PARTITION `p1` VALUES IN (1) ENGINE = InnoDB);
|
||||
|
||||
INSERT INTO t1 VALUES (1, 0);
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO t2(SELECT * FROM t1 WHERE id = 1);
|
||||
DELETE FROM t1 WHERE id = 1;
|
||||
|
||||
COMMIT;
|
||||
|
||||
--connection node_2
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
DROP TABLE t1, t2;
|
9
mysql-test/suite/galera/t/galera_replica_no_gtid.cnf
Normal file
9
mysql-test/suite/galera/t/galera_replica_no_gtid.cnf
Normal file
@@ -0,0 +1,9 @@
|
||||
!include ../galera_2nodes_as_slave.cnf
|
||||
|
||||
[mysqld]
|
||||
wsrep-debug=1
|
||||
server_id=15
|
||||
wsrep_gtid_mode=OFF
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=OFF
|
124
mysql-test/suite/galera/t/galera_replica_no_gtid.test
Normal file
124
mysql-test/suite/galera/t/galera_replica_no_gtid.test
Normal file
@@ -0,0 +1,124 @@
|
||||
#
|
||||
# Test Galera as a replica to a MySQL async replication
|
||||
#
|
||||
# The galera/galera_2node_slave.cnf describes the setup of the nodes
|
||||
#
|
||||
--source include/force_restart.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
# As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it
|
||||
# we open the node_3 connection here
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
flush privileges;
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
||||
--let $node_1 = node_1
|
||||
--let $node_2 = node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_2
|
||||
--disable_query_log
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='repl', master_password='repl', master_port=$NODE_MYPORT_3, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
START SLAVE;
|
||||
|
||||
--connection node_3
|
||||
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
--disable_query_log
|
||||
INSERT INTO t1 SELECT seq, 'test' from seq_1_to_10000;
|
||||
--enable_query_log
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
#
|
||||
# Node_2 is slave so mysql.gtid_slave_pos table is also replicated
|
||||
#
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
#
|
||||
# mysql-gtid_slave_pos table should not be replicated by Galera
|
||||
#
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--echo # Verify that graceful shutdown succeeds.
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo # Force SST
|
||||
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
|
||||
|
||||
--connection node_1
|
||||
--echo # Waiting until node_2 is not part of cluster anymore
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--echo # Start node_2 again
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--echo ¤ Wait until node_2 is back on cluster
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
call mtr.add_suppression("Slave: Operation CREATE USER failed for .*");
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_3
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--connection node_2
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
|
||||
--connection node_3
|
||||
RESET MASTER;
|
||||
drop table t1;
|
||||
|
||||
--connection node_2
|
||||
DROP TABLE t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--disconnect node_3
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
@@ -1,6 +1,6 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_log_bin.inc
|
||||
--source include/log_bin.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_aria.inc
|
||||
|
||||
|
@@ -83,6 +83,9 @@ wsrep_node_address='127.0.0.1:@mysqld.6.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -46,6 +46,9 @@ wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
@@ -75,15 +75,15 @@ insert into t1 values (2, 21, 1);
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-2,2-21-1
|
||||
select * from t1;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
2 21 1
|
||||
#wait for sync cluster 1 and 2
|
||||
connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
2 21 1
|
||||
cluster 1 node 2
|
||||
connection node_2;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -98,6 +98,11 @@ connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
2 21 1
|
||||
cluster 1 node 3
|
||||
connection node_3;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -112,6 +117,12 @@ connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
cluster 2 node 2
|
||||
connection node_5;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -126,6 +137,13 @@ connection node_4;
|
||||
include/save_master_gtid.inc
|
||||
connection node_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
cluster 2 node 3
|
||||
connection node_6;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -140,6 +158,63 @@ connection node_4;
|
||||
include/save_master_gtid.inc
|
||||
connection node_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
# check other nodes are consistent
|
||||
connection node_2;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-4,2-21-3
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_3;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-4,2-21-3
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_5;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-4,2-21-3
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_6;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-4,2-21-3
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
cluster 1 node 1
|
||||
connection node_1;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -220,15 +295,15 @@ insert into t1 values (2, 21, 1);
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-7,2-21-4
|
||||
select * from t1;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
2 21 1
|
||||
#wait for sync cluster 1 and 2
|
||||
connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
2 21 1
|
||||
cluster 1 node 2
|
||||
connection node_2;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -243,6 +318,11 @@ connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
2 21 1
|
||||
cluster 1 node 3
|
||||
connection node_3;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -257,6 +337,12 @@ connection node_1;
|
||||
include/save_master_gtid.inc
|
||||
connection node_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
cluster 2 node 2
|
||||
connection node_5;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -271,6 +357,13 @@ connection node_4;
|
||||
include/save_master_gtid.inc
|
||||
connection node_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
cluster 2 node 3
|
||||
connection node_6;
|
||||
select @@gtid_binlog_state;
|
||||
@@ -285,6 +378,63 @@ connection node_4;
|
||||
include/save_master_gtid.inc
|
||||
connection node_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
# check other nodes are consistent
|
||||
connection node_2;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-9,2-21-6
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_3;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-9,2-21-6
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_5;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-9,2-21-6
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
connection node_6;
|
||||
select @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-11-9,2-21-6
|
||||
select * from t1 order by 1, 2, 3;
|
||||
cluster_domain_id node_server_id seq_no
|
||||
1 11 2
|
||||
1 12 3
|
||||
1 13 4
|
||||
2 21 1
|
||||
2 22 2
|
||||
2 23 3
|
||||
cluster 1 node 1
|
||||
connection node_1;
|
||||
select @@gtid_binlog_state;
|
||||
|
@@ -9,11 +9,11 @@ server-id=11
|
||||
|
||||
[mysqld.2]
|
||||
wsrep_gtid_domain_id=1
|
||||
server-id=12
|
||||
server-id=11
|
||||
|
||||
[mysqld.3]
|
||||
wsrep_gtid_domain_id=1
|
||||
server-id=13
|
||||
server-id=11
|
||||
|
||||
[mysqld.4]
|
||||
wsrep_gtid_domain_id=2
|
||||
@@ -21,8 +21,8 @@ server-id=21
|
||||
|
||||
[mysqld.5]
|
||||
wsrep_gtid_domain_id=2
|
||||
server-id=22
|
||||
server-id=21
|
||||
|
||||
[mysqld.6]
|
||||
wsrep_gtid_domain_id=2
|
||||
server-id=23
|
||||
server-id=21
|
||||
|
@@ -11,6 +11,7 @@
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/force_restart.inc
|
||||
|
||||
--connection node_1
|
||||
--echo cluster 1 node 1
|
||||
@@ -75,12 +76,12 @@ select @@gtid_binlog_state;
|
||||
select @@gtid_binlog_state;
|
||||
insert into t1 values (2, 21, 1);
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1;
|
||||
--echo #wait for sync cluster 1 and 2
|
||||
--connection node_1
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
|
||||
--echo cluster 1 node 2
|
||||
@@ -94,6 +95,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 1 node 3
|
||||
--connection node_3
|
||||
@@ -106,6 +108,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 2 node 2
|
||||
--connection node_5
|
||||
@@ -118,6 +121,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_1
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 2 node 3
|
||||
--connection node_6
|
||||
@@ -130,7 +134,21 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_1
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo # check other nodes are consistent
|
||||
--connection node_2
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_3
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_5
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_6
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 1 node 1
|
||||
--connection node_1
|
||||
@@ -226,13 +244,13 @@ select @@gtid_binlog_state;
|
||||
--connection node_4
|
||||
insert into t1 values (2, 21, 1);
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1;
|
||||
|
||||
--echo #wait for sync cluster 1 and 2
|
||||
--connection node_1
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
|
||||
--echo cluster 1 node 2
|
||||
@@ -246,6 +264,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 1 node 3
|
||||
--connection node_3
|
||||
@@ -258,6 +277,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 2 node 2
|
||||
--connection node_5
|
||||
@@ -270,6 +290,7 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_1
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 2 node 3
|
||||
--connection node_6
|
||||
@@ -282,7 +303,21 @@ select @@gtid_binlog_state;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection node_1
|
||||
--source include/sync_with_master_gtid.inc
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo # check other nodes are consistent
|
||||
--connection node_2
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_3
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_5
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
--connection node_6
|
||||
select @@gtid_binlog_state;
|
||||
select * from t1 order by 1, 2, 3;
|
||||
|
||||
--echo cluster 1 node 1
|
||||
--connection node_1
|
||||
|
@@ -98,3 +98,4 @@ INNODB_ENCRYPTION_N_ROWLOG_BLOCKS_DECRYPTED
|
||||
INNODB_ENCRYPTION_N_TEMP_BLOCKS_ENCRYPTED
|
||||
INNODB_ENCRYPTION_N_TEMP_BLOCKS_DECRYPTED
|
||||
INNODB_ENCRYPTION_NUM_KEY_REQUESTS
|
||||
INNODB_BULK_OPERATIONS
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user