mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merged with mysql-5.1 tree.
client/mysqltest.cc: Manually merged configure.in: Manually merged mysql-test/r/variables.result: Manually merged mysql-test/t/variables.test: Manually merged mysys/my_pread.c: Manually merged mysys/my_read.c: Manually merged sql/mysqld.cc: Manually merged storage/csv/ha_tina.h: Manually merged storage/myisam/ha_myisam.cc: Manually merged storage/myisam/mi_check.c: Manually merged storage/myisam/mi_search.c: Manually merged
This commit is contained in:
commit
e726e587ec
264 changed files with 4589 additions and 1605 deletions
|
@ -29,5 +29,5 @@ typedef struct st_line_buffer
|
|||
|
||||
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
|
||||
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
|
||||
extern char *batch_readline(LINE_BUFFER *buffer);
|
||||
extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
|
||||
extern void batch_readline_end(LINE_BUFFER *buffer);
|
||||
|
|
|
@ -49,7 +49,7 @@ const char *VER= "14.15";
|
|||
#define MAX_COLUMN_LENGTH 1024
|
||||
|
||||
/* Buffer to hold 'version' and 'version_comment' */
|
||||
#define MAX_SERVER_VERSION_LENGTH 128
|
||||
static char *server_version= NULL;
|
||||
|
||||
/* Array of options to pass to libemysqld */
|
||||
#define MAX_SERVER_ARGS 64
|
||||
|
@ -115,6 +115,8 @@ extern "C" {
|
|||
#define PROMPT_CHAR '\\'
|
||||
#define DEFAULT_DELIMITER ";"
|
||||
|
||||
#define MAX_BATCH_BUFFER_SIZE (1024L * 1024L)
|
||||
|
||||
typedef struct st_status
|
||||
{
|
||||
int exit_status;
|
||||
|
@ -1045,7 +1047,7 @@ static void fix_history(String *final_command);
|
|||
|
||||
static COMMANDS *find_command(char *name,char cmd_name);
|
||||
static bool add_line(String &buffer,char *line,char *in_string,
|
||||
bool *ml_comment);
|
||||
bool *ml_comment, bool truncated);
|
||||
static void remove_cntrl(String &buffer);
|
||||
static void print_table_data(MYSQL_RES *result);
|
||||
static void print_table_data_html(MYSQL_RES *result);
|
||||
|
@ -1117,7 +1119,7 @@ int main(int argc,char *argv[])
|
|||
exit(1);
|
||||
}
|
||||
if (status.batch && !status.line_buff &&
|
||||
!(status.line_buff=batch_readline_init(opt_max_allowed_packet+512,stdin)))
|
||||
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
|
||||
{
|
||||
free_defaults(defaults_argv);
|
||||
my_end(0);
|
||||
|
@ -1198,7 +1200,7 @@ int main(int argc,char *argv[])
|
|||
#endif
|
||||
sprintf(buff, "%s",
|
||||
#ifndef NOT_YET
|
||||
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n");
|
||||
"Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n");
|
||||
#else
|
||||
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
|
||||
#endif
|
||||
|
@ -1234,6 +1236,7 @@ sig_handler mysql_end(int sig)
|
|||
glob_buffer.free();
|
||||
old_buffer.free();
|
||||
processed_prompt.free();
|
||||
my_free(server_version,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(opt_mysql_unix_port,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(histfile,MYF(MY_ALLOW_ZERO_PTR));
|
||||
|
@ -1817,13 +1820,14 @@ static int read_and_execute(bool interactive)
|
|||
ulong line_number=0;
|
||||
bool ml_comment= 0;
|
||||
COMMANDS *com;
|
||||
bool truncated= 0;
|
||||
status.exit_status=1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (!interactive)
|
||||
{
|
||||
line=batch_readline(status.line_buff);
|
||||
line=batch_readline(status.line_buff, &truncated);
|
||||
/*
|
||||
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
|
||||
Editors like "notepad" put this marker in
|
||||
|
@ -1920,7 +1924,7 @@ static int read_and_execute(bool interactive)
|
|||
#endif
|
||||
continue;
|
||||
}
|
||||
if (add_line(glob_buffer,line,&in_string,&ml_comment))
|
||||
if (add_line(glob_buffer,line,&in_string,&ml_comment, truncated))
|
||||
break;
|
||||
}
|
||||
/* if in batch mode, send last query even if it doesn't end with \g or go */
|
||||
|
@ -2007,7 +2011,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
|
|||
|
||||
|
||||
static bool add_line(String &buffer,char *line,char *in_string,
|
||||
bool *ml_comment)
|
||||
bool *ml_comment, bool truncated)
|
||||
{
|
||||
uchar inchar;
|
||||
char buff[80], *pos, *out;
|
||||
|
@ -2257,9 +2261,10 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
{
|
||||
uint length=(uint) (out-line);
|
||||
|
||||
if (length < 9 ||
|
||||
my_strnncoll (charset_info,
|
||||
(uchar *)line, 9, (const uchar *) "delimiter", 9))
|
||||
if (!truncated &&
|
||||
(length < 9 ||
|
||||
my_strnncoll (charset_info,
|
||||
(uchar *)line, 9, (const uchar *) "delimiter", 9)))
|
||||
{
|
||||
/*
|
||||
Don't add a new line in case there's a DELIMITER command to be
|
||||
|
@ -2672,7 +2677,7 @@ static void get_current_db()
|
|||
(res= mysql_use_result(&mysql)))
|
||||
{
|
||||
MYSQL_ROW row= mysql_fetch_row(res);
|
||||
if (row[0])
|
||||
if (row && row[0])
|
||||
current_db= my_strdup(row[0], MYF(MY_WME));
|
||||
mysql_free_result(res);
|
||||
}
|
||||
|
@ -3932,7 +3937,7 @@ static int com_source(String *buffer, char *line)
|
|||
return put_info(buff, INFO_ERROR, 0);
|
||||
}
|
||||
|
||||
if (!(line_buff=batch_readline_init(opt_max_allowed_packet+512,sql_file)))
|
||||
if (!(line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, sql_file)))
|
||||
{
|
||||
my_fclose(sql_file,MYF(0));
|
||||
return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
|
||||
|
@ -4381,16 +4386,11 @@ select_limit, max_join_size);
|
|||
static const char *
|
||||
server_version_string(MYSQL *con)
|
||||
{
|
||||
static char buf[MAX_SERVER_VERSION_LENGTH] = "";
|
||||
|
||||
/* Only one thread calls this, so no synchronization is needed */
|
||||
if (buf[0] == '\0')
|
||||
if (server_version == NULL)
|
||||
{
|
||||
char *bufp = buf;
|
||||
MYSQL_RES *result;
|
||||
|
||||
bufp= strnmov(buf, mysql_get_server_info(con), sizeof buf);
|
||||
|
||||
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
|
||||
if (!mysql_query(con, "select @@version_comment limit 1") &&
|
||||
(result = mysql_use_result(con)))
|
||||
|
@ -4398,17 +4398,32 @@ server_version_string(MYSQL *con)
|
|||
MYSQL_ROW cur = mysql_fetch_row(result);
|
||||
if (cur && cur[0])
|
||||
{
|
||||
bufp = strxnmov(bufp, sizeof buf - (bufp - buf), " ", cur[0], NullS);
|
||||
/* version, space, comment, \0 */
|
||||
size_t len= strlen(mysql_get_server_info(con)) + strlen(cur[0]) + 2;
|
||||
|
||||
if ((server_version= (char *) my_malloc(len, MYF(MY_WME))))
|
||||
{
|
||||
char *bufp;
|
||||
bufp = strmov(server_version, mysql_get_server_info(con));
|
||||
bufp = strmov(bufp, " ");
|
||||
(void) strmov(bufp, cur[0]);
|
||||
}
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
||||
/* str*nmov doesn't guarantee NUL-termination */
|
||||
if (bufp == buf + sizeof buf)
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
/*
|
||||
If for some reason we didn't get a version_comment, we'll
|
||||
keep things simple.
|
||||
*/
|
||||
|
||||
if (server_version == NULL)
|
||||
{
|
||||
server_version= strdup(mysql_get_server_info(con));
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
return server_version ? server_version : "";
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -837,7 +837,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
bool old= (find_type(argv[0], &command_typelib, 2) ==
|
||||
ADMIN_OLD_PASSWORD);
|
||||
#ifdef __WIN__
|
||||
uint pw_len= strlen(pw);
|
||||
uint pw_len= (uint) strlen(pw);
|
||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||
printf("Warning: single quotes were not trimmed from the password by"
|
||||
" your command\nline client, as you might have expected.\n");
|
||||
|
|
|
@ -128,7 +128,7 @@ static Exit_status safe_connect();
|
|||
class Load_log_processor
|
||||
{
|
||||
char target_dir_name[FN_REFLEN];
|
||||
int target_dir_name_len;
|
||||
size_t target_dir_name_len;
|
||||
|
||||
/*
|
||||
When we see first event corresponding to some LOAD DATA statement in
|
||||
|
@ -285,9 +285,9 @@ public:
|
|||
File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
|
||||
Exit_status load_old_format_file(NET* net, const char *server_fname,
|
||||
uint server_fname_len, File file);
|
||||
Exit_status process_first_event(const char *bname, uint blen,
|
||||
Exit_status process_first_event(const char *bname, size_t blen,
|
||||
const uchar *block,
|
||||
uint block_len, uint file_id,
|
||||
size_t block_len, uint file_id,
|
||||
Create_file_log_event *ce);
|
||||
};
|
||||
|
||||
|
@ -305,7 +305,7 @@ public:
|
|||
File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
||||
char *filename)
|
||||
{
|
||||
uint len;
|
||||
size_t len;
|
||||
char *tail;
|
||||
File file;
|
||||
|
||||
|
@ -319,7 +319,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
|||
return -1;
|
||||
}
|
||||
|
||||
le->set_fname_outside_temp_buf(filename,len+strlen(tail));
|
||||
le->set_fname_outside_temp_buf(filename,len+(uint) strlen(tail));
|
||||
|
||||
return file;
|
||||
}
|
||||
|
@ -411,9 +411,9 @@ Exit_status Load_log_processor::load_old_format_file(NET* net,
|
|||
@retval OK_CONTINUE No error, the program should continue.
|
||||
*/
|
||||
Exit_status Load_log_processor::process_first_event(const char *bname,
|
||||
uint blen,
|
||||
size_t blen,
|
||||
const uchar *block,
|
||||
uint block_len,
|
||||
size_t block_len,
|
||||
uint file_id,
|
||||
Create_file_log_event *ce)
|
||||
{
|
||||
|
@ -456,7 +456,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
|
|||
}
|
||||
|
||||
if (ce)
|
||||
ce->set_fname_outside_temp_buf(fname, strlen(fname));
|
||||
ce->set_fname_outside_temp_buf(fname, (uint) strlen(fname));
|
||||
|
||||
if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP)))
|
||||
{
|
||||
|
@ -1189,7 +1189,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
|
|||
long dummy_my_timezone;
|
||||
my_bool dummy_in_dst_time_gap;
|
||||
/* We require a total specification (date AND time) */
|
||||
if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) !=
|
||||
if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
|
||||
MYSQL_TIMESTAMP_DATETIME || was_cut)
|
||||
{
|
||||
error("Incorrect date and time argument: %s", str);
|
||||
|
|
|
@ -349,7 +349,7 @@ static int get_options(int *argc, char ***argv)
|
|||
|
||||
if (!what_to_do)
|
||||
{
|
||||
int pnlen = strlen(my_progname);
|
||||
size_t pnlen= strlen(my_progname);
|
||||
|
||||
if (pnlen < 6) /* name too short */
|
||||
what_to_do = DO_CHECK;
|
||||
|
@ -448,7 +448,8 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
|||
space is for more readable output in logs and in case of error
|
||||
*/
|
||||
char *table_names_comma_sep, *end;
|
||||
int i, tot_length = 0;
|
||||
size_t tot_length= 0;
|
||||
int i= 0;
|
||||
|
||||
for (i = 0; i < tables; i++)
|
||||
tot_length+= fixed_name_length(*(table_names + i)) + 2;
|
||||
|
@ -464,7 +465,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
|||
*end++= ',';
|
||||
}
|
||||
*--end = 0;
|
||||
handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
|
||||
handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
|
||||
my_free(table_names_comma_sep, MYF(0));
|
||||
}
|
||||
else
|
||||
|
@ -486,7 +487,7 @@ static uint fixed_name_length(const char *name)
|
|||
else if (*p == '.')
|
||||
extra_length+= 2;
|
||||
}
|
||||
return (p - name) + extra_length;
|
||||
return (uint) ((p - name) + extra_length);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -802,7 +802,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
opt_set_charset= 0;
|
||||
opt_compatible_mode_str= argument;
|
||||
opt_compatible_mode= find_set(&compatible_mode_typelib,
|
||||
argument, strlen(argument),
|
||||
argument, (uint) strlen(argument),
|
||||
&err_ptr, &err_len);
|
||||
if (err_len)
|
||||
{
|
||||
|
@ -4588,7 +4588,8 @@ char check_if_ignore_table(const char *table_name, char *table_type)
|
|||
*/
|
||||
if (!opt_no_data &&
|
||||
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
|
||||
!strcmp(table_type,"MRG_ISAM")))
|
||||
!strcmp(table_type,"MRG_ISAM") ||
|
||||
!strcmp(table_type,"FEDERATED")))
|
||||
result= IGNORE_DATA;
|
||||
}
|
||||
mysql_free_result(res);
|
||||
|
|
|
@ -1936,7 +1936,7 @@ parse_option(const char *origin, option_string **stmt, char delm)
|
|||
char *ptr= (char *)origin;
|
||||
option_string **sptr= stmt;
|
||||
option_string *tmp;
|
||||
uint length= strlen(origin);
|
||||
size_t length= strlen(origin);
|
||||
uint count= 0; /* We know that there is always one */
|
||||
|
||||
for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string),
|
||||
|
|
|
@ -1325,7 +1325,7 @@ void log_msg(const char *fmt, ...)
|
|||
void cat_file(DYNAMIC_STRING* ds, const char* filename)
|
||||
{
|
||||
int fd;
|
||||
uint len;
|
||||
size_t len;
|
||||
char buff[512];
|
||||
|
||||
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
|
||||
|
@ -1454,6 +1454,7 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
|||
Test if diff is present. This is needed on Windows systems
|
||||
as the OS returns 1 whether diff is successful or if it is
|
||||
not present.
|
||||
Takes name of diff program as argument
|
||||
|
||||
We run diff -v and look for output in stdout.
|
||||
We don't redirect stderr to stdout to make for a simplified check
|
||||
|
@ -1461,11 +1462,12 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
|||
not present.
|
||||
*/
|
||||
|
||||
int diff_check()
|
||||
int diff_check (const char *diff_name)
|
||||
{
|
||||
char buf[512]= {0};
|
||||
FILE *res_file;
|
||||
const char *cmd = "diff -v";
|
||||
char cmd[128];
|
||||
my_snprintf (cmd, sizeof(cmd), "%s -v", diff_name);
|
||||
int have_diff = 0;
|
||||
|
||||
if (!(res_file= popen(cmd, "r")))
|
||||
|
@ -1497,7 +1499,7 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
const char* filename1, const char* filename2)
|
||||
{
|
||||
DYNAMIC_STRING ds_tmp;
|
||||
int have_diff = 0;
|
||||
const char *diff_name = 0;
|
||||
|
||||
if (init_dynamic_string(&ds_tmp, "", 256, 256))
|
||||
die("Out of memory");
|
||||
|
@ -1510,15 +1512,20 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
the way it's implemented does not work with default 'diff' on Solaris.
|
||||
*/
|
||||
#ifdef __WIN__
|
||||
have_diff = diff_check();
|
||||
if (diff_check("diff"))
|
||||
diff_name = "diff";
|
||||
else if (diff_check("mtrdiff"))
|
||||
diff_name = "mtrdiff";
|
||||
else
|
||||
diff_name = 0;
|
||||
#else
|
||||
have_diff = 1;
|
||||
diff_name = "diff"; // Otherwise always assume it's called diff
|
||||
#endif
|
||||
|
||||
if (have_diff)
|
||||
if (diff_name)
|
||||
{
|
||||
/* First try with unified diff */
|
||||
if (run_tool("diff",
|
||||
if (run_tool(diff_name,
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
"-u",
|
||||
filename1,
|
||||
|
@ -1529,7 +1536,7 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
dynstr_set(&ds_tmp, "");
|
||||
|
||||
/* Fallback to context diff with "diff -c" */
|
||||
if (run_tool("diff",
|
||||
if (run_tool(diff_name,
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
"-c",
|
||||
filename1,
|
||||
|
@ -1540,20 +1547,20 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
dynstr_set(&ds_tmp, "");
|
||||
|
||||
/* Fallback to simple diff with "diff" */
|
||||
if (run_tool("diff",
|
||||
if (run_tool(diff_name,
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
filename1,
|
||||
filename2,
|
||||
"2>&1",
|
||||
NULL) > 1) /* Most "diff" tools return >1 if error */
|
||||
{
|
||||
have_diff= 0;
|
||||
diff_name= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! have_diff)
|
||||
if (! diff_name)
|
||||
{
|
||||
/*
|
||||
Fallback to dump both files to result file and inform
|
||||
|
@ -2682,7 +2689,8 @@ void do_exec(struct st_command *command)
|
|||
log_msg("exec of '%s' failed, error: %d, status: %d, errno: %d",
|
||||
ds_cmd.str, error, status, errno);
|
||||
dynstr_free(&ds_cmd);
|
||||
die("command \"%s\" failed", command->first_argument);
|
||||
die("command \"%s\" failed\n\nOutput from before failure:\n%s\n",
|
||||
command->first_argument, ds_res.str);
|
||||
}
|
||||
|
||||
DBUG_PRINT("info",
|
||||
|
@ -7209,7 +7217,7 @@ void init_re_comp(my_regex_t *re, const char* str)
|
|||
char erbuf[100];
|
||||
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
||||
die("error %s, %d/%d `%s'\n",
|
||||
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||
re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7265,7 +7273,7 @@ int match_re(my_regex_t *re, char *str)
|
|||
char erbuf[100];
|
||||
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
||||
die("error %s, %d/%d `%s'\n",
|
||||
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||
re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
|
|||
ulong max_size);
|
||||
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
|
||||
static size_t fill_buffer(LINE_BUFFER *buffer);
|
||||
static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
|
||||
static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated);
|
||||
|
||||
|
||||
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
||||
|
@ -42,12 +42,13 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
|||
}
|
||||
|
||||
|
||||
char *batch_readline(LINE_BUFFER *line_buff)
|
||||
char *batch_readline(LINE_BUFFER *line_buff, bool *truncated)
|
||||
{
|
||||
char *pos;
|
||||
ulong out_length;
|
||||
DBUG_ASSERT(truncated != NULL);
|
||||
|
||||
if (!(pos=intern_read_line(line_buff,&out_length)))
|
||||
if (!(pos=intern_read_line(line_buff,&out_length, truncated)))
|
||||
return 0;
|
||||
if (out_length && pos[out_length-1] == '\n')
|
||||
if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */
|
||||
|
@ -149,6 +150,14 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
|
|||
read_count=(buffer->bufread - bufbytes)/IO_SIZE;
|
||||
if ((read_count*=IO_SIZE))
|
||||
break;
|
||||
if (buffer->bufread * 2 > buffer->max_size)
|
||||
{
|
||||
/*
|
||||
So we must grow the buffer but we cannot due to the max_size limit.
|
||||
Return 0 w/o setting buffer->eof to signal this condition.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
buffer->bufread *= 2;
|
||||
if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
|
||||
buffer->bufread+1,
|
||||
|
@ -172,11 +181,15 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
|
|||
|
||||
DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
|
||||
|
||||
/* Kludge to pretend every nonempty file ends with a newline. */
|
||||
if (!read_count && bufbytes && buffer->end[-1] != '\n')
|
||||
if (!read_count)
|
||||
{
|
||||
buffer->eof = read_count = 1;
|
||||
*buffer->end = '\n';
|
||||
buffer->eof = 1;
|
||||
/* Kludge to pretend every nonempty file ends with a newline. */
|
||||
if (bufbytes && buffer->end[-1] != '\n')
|
||||
{
|
||||
read_count = 1;
|
||||
*buffer->end = '\n';
|
||||
}
|
||||
}
|
||||
buffer->end_of_line=(buffer->start_of_line=buffer->buffer)+bufbytes;
|
||||
buffer->end+=read_count;
|
||||
|
@ -186,7 +199,7 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
|
|||
|
||||
|
||||
|
||||
char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
|
||||
char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
|
||||
{
|
||||
char *pos;
|
||||
size_t length;
|
||||
|
@ -200,14 +213,23 @@ char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
|
|||
pos++;
|
||||
if (pos == buffer->end)
|
||||
{
|
||||
if ((uint) (pos - buffer->start_of_line) < buffer->max_size)
|
||||
/*
|
||||
fill_buffer() can return 0 either on EOF in which case we abort
|
||||
or when the internal buffer has hit the size limit. In the latter case
|
||||
return what we have read so far and signal string truncation.
|
||||
*/
|
||||
if (!(length=fill_buffer(buffer)) || length == (uint) -1)
|
||||
{
|
||||
if (!(length=fill_buffer(buffer)) || length == (size_t) -1)
|
||||
DBUG_RETURN(0);
|
||||
continue;
|
||||
if (buffer->eof)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
pos--; /* break line here */
|
||||
*truncated= 1;
|
||||
}
|
||||
else
|
||||
*truncated= 0;
|
||||
buffer->end_of_line=pos+1;
|
||||
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
|
||||
DBUG_RETURN(buffer->start_of_line);
|
||||
|
|
|
@ -465,7 +465,7 @@ bool String::append(const char *s,uint32 arg_length)
|
|||
|
||||
bool String::append(const char *s)
|
||||
{
|
||||
return append(s, strlen(s));
|
||||
return append(s, (uint) strlen(s));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -330,41 +330,11 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
|
|||
AC_SUBST([NDB_SIZEOF_LONG])
|
||||
AC_SUBST([NDB_SIZEOF_LONG_LONG])
|
||||
|
||||
AC_CONFIG_FILES(storage/ndb/include/Makefile dnl
|
||||
storage/ndb/src/Makefile storage/ndb/src/common/Makefile dnl
|
||||
storage/ndb/docs/Makefile dnl
|
||||
storage/ndb/tools/Makefile dnl
|
||||
storage/ndb/src/common/debugger/Makefile dnl
|
||||
storage/ndb/src/common/debugger/signaldata/Makefile dnl
|
||||
storage/ndb/src/common/portlib/Makefile dnl
|
||||
storage/ndb/src/common/util/Makefile dnl
|
||||
storage/ndb/src/common/logger/Makefile dnl
|
||||
storage/ndb/src/common/transporter/Makefile dnl
|
||||
storage/ndb/src/common/mgmcommon/Makefile dnl
|
||||
storage/ndb/src/kernel/Makefile dnl
|
||||
storage/ndb/src/kernel/error/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/dbdict/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/dbdih/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/dblqh/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/dbtup/Makefile dnl
|
||||
storage/ndb/src/kernel/blocks/backup/Makefile dnl
|
||||
storage/ndb/src/kernel/vm/Makefile dnl
|
||||
storage/ndb/src/mgmapi/Makefile dnl
|
||||
storage/ndb/src/ndbapi/Makefile dnl
|
||||
storage/ndb/src/mgmsrv/Makefile dnl
|
||||
storage/ndb/src/mgmclient/Makefile dnl
|
||||
storage/ndb/src/cw/Makefile dnl
|
||||
storage/ndb/src/cw/cpcd/Makefile dnl
|
||||
storage/ndb/test/Makefile dnl
|
||||
storage/ndb/test/src/Makefile dnl
|
||||
storage/ndb/test/ndbapi/Makefile dnl
|
||||
storage/ndb/test/ndbapi/bank/Makefile dnl
|
||||
storage/ndb/test/tools/Makefile dnl
|
||||
storage/ndb/test/run-test/Makefile dnl
|
||||
storage/ndb/include/ndb_version.h storage/ndb/include/ndb_global.h dnl
|
||||
storage/ndb/include/ndb_types.h dnl
|
||||
)
|
||||
AC_CONFIG_FILES([
|
||||
storage/ndb/include/ndb_version.h
|
||||
storage/ndb/include/ndb_global.h
|
||||
storage/ndb/include/ndb_types.h
|
||||
])
|
||||
])
|
||||
|
||||
AC_SUBST(TEST_NDBCLUSTER)
|
||||
|
|
|
@ -477,10 +477,23 @@ dnl Although this is "pretty", it breaks libmysqld build
|
|||
# Even if we don't build a plugin, we bundle its source into the dist
|
||||
# file. So its Makefile (and Makefiles for any subdirs) must be
|
||||
# generated for 'make dist' to work.
|
||||
m4_syscmd(test -f "$6/configure")
|
||||
m4_syscmd([test -f "]$6[/configure"])
|
||||
ifelse(m4_sysval, 0,
|
||||
[AC_CONFIG_SUBDIRS($6)],
|
||||
[AC_CONFIG_FILES($6/Makefile)]
|
||||
[
|
||||
# autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of
|
||||
# a subdir; for our purposes, it's enough to just check for existing
|
||||
# Makefile.am files and add them in here
|
||||
dnl
|
||||
dnl Warning, don't try to quote the m4_esyscmd() macro, it doesn't
|
||||
dnl work. Quoting here is tricky.
|
||||
dnl
|
||||
dnl The $FIND or $SED variable can be set by the user when calling autoconf itself
|
||||
dnl to if they need to pass a specific path. This is *NOT* used when calling
|
||||
dnl running configure!
|
||||
dnl
|
||||
AC_CONFIG_FILES(m4_esyscmd([${FIND-find} "]$6[" -name Makefile.am -print | ${SED-sed} 's,\.am$,,']))
|
||||
]
|
||||
)
|
||||
|
||||
ifelse(
|
||||
|
|
|
@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
|
|||
#
|
||||
# When changing major version number please also check switch statement
|
||||
# in mysqlbinlog::check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.32-maria-beta2)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.35-maria-beta2)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
|
|
@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
|
|||
case 'u':
|
||||
case 'x':
|
||||
case 's':
|
||||
chksum= my_checksum(chksum, start, p-start);
|
||||
chksum= my_checksum(chksum, start, (uint) (p - start));
|
||||
start= 0; /* Not in format specifier anymore */
|
||||
break;
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ void input_buffer::add_size(uint i)
|
|||
|
||||
uint input_buffer::get_capacity() const
|
||||
{
|
||||
return end_ - buffer_;
|
||||
return (uint) (end_ - buffer_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,7 +223,7 @@ uint output_buffer::get_size() const
|
|||
|
||||
uint output_buffer::get_capacity() const
|
||||
{
|
||||
return end_ - buffer_;
|
||||
return (uint) (end_ - buffer_);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize,
|
|||
if (preserve) {
|
||||
A b = A();
|
||||
typename A::pointer newPointer = b.allocate(newSize, 0);
|
||||
memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize));
|
||||
memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize));
|
||||
a.deallocate(p, oldSize);
|
||||
STL::swap(a, b);
|
||||
return newPointer;
|
||||
|
|
|
@ -288,7 +288,7 @@ void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base,
|
|||
r = buckets[i][buckets[i].size()-1];
|
||||
if (buckets[i].size() > 1)
|
||||
{
|
||||
for (int j = buckets[i].size()-2; j >= 1; j--)
|
||||
for (int j= (unsigned int) (buckets[i].size()) - 2; j >= 1; j--)
|
||||
{
|
||||
Accumulate(buckets[i][j], buckets[i][j+1]);
|
||||
Accumulate(r, buckets[i][j]);
|
||||
|
|
|
@ -213,7 +213,7 @@ void PublicKey::AddToEnd(const byte* data, word32 len)
|
|||
Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
|
||||
: key_(k, kSz)
|
||||
{
|
||||
int sz = strlen(n);
|
||||
size_t sz = strlen(n);
|
||||
memcpy(name_, n, sz);
|
||||
name_[sz] = 0;
|
||||
|
||||
|
|
|
@ -861,14 +861,17 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
|
|||
extern int get_defaults_options(int argc, char **argv,
|
||||
char **defaults, char **extra_defaults,
|
||||
char **group_suffix);
|
||||
extern int my_load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv, const char ***);
|
||||
extern int load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv);
|
||||
int *argc, char ***argv);
|
||||
extern int modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option);
|
||||
extern int my_search_option_files(const char *conf_file, int *argc,
|
||||
char ***argv, uint *args_used,
|
||||
Process_option_func func, void *func_ctx);
|
||||
Process_option_func func, void *func_ctx,
|
||||
const char **default_directories);
|
||||
extern void free_defaults(char **argv);
|
||||
extern void my_print_default_files(const char *conf_file);
|
||||
extern void print_defaults(const char *conf_file, const char **groups);
|
||||
|
|
|
@ -1617,7 +1617,7 @@ mysql_hex_string(char *to, const char *from, ulong length)
|
|||
ulong STDCALL
|
||||
mysql_escape_string(char *to,const char *from,ulong length)
|
||||
{
|
||||
return escape_string_for_mysql(default_charset_info, to, 0, from, length);
|
||||
return (uint) escape_string_for_mysql(default_charset_info, to, 0, from, length);
|
||||
}
|
||||
|
||||
ulong STDCALL
|
||||
|
@ -1625,8 +1625,8 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
|
|||
ulong length)
|
||||
{
|
||||
if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
|
||||
return escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return (uint) escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||
}
|
||||
|
||||
void STDCALL
|
||||
|
|
|
@ -208,6 +208,6 @@ ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
|
|||
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
|
||||
TARGET_LINK_LIBRARIES(mysqlserver)
|
||||
|
||||
ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
|
||||
ADD_LIBRARY(libmysqld SHARED cmake_dummy.c libmysqld.def)
|
||||
ADD_DEPENDENCIES(libmysqld mysqlserver)
|
||||
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)
|
||||
|
|
|
@ -30,12 +30,12 @@ ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
|
|||
../../client/mysql.cc ../../client/readline.cc
|
||||
../../client/sql_string.cc)
|
||||
TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
||||
ADD_DEPENDENCIES(mysql_embedded libmysqld)
|
||||
TARGET_LINK_LIBRARIES(mysql_embedded libmysqld)
|
||||
|
||||
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
||||
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded libmysqld)
|
||||
|
||||
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
|
||||
TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
||||
ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
|
||||
TARGET_LINK_LIBRARIES(mysql_client_test_embedded libmysqld)
|
||||
|
|
|
@ -164,6 +164,46 @@ DROP TABLE t1;
|
|||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
|
||||
#
|
||||
# Bug#35383: binlog playback and replication breaks due to
|
||||
# name_const substitution
|
||||
#
|
||||
DELIMITER //;
|
||||
CREATE PROCEDURE p1(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT v1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
DECLARE v1 INT;
|
||||
CREATE TABLE t1 SELECT v1+1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p3(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p4(IN v1 INT)
|
||||
BEGIN
|
||||
DECLARE v2 INT;
|
||||
CREATE TABLE t1 SELECT 1, v1, v2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 1, v1+1, v2;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
DELIMITER ;//
|
||||
|
||||
CALL p1(1);
|
||||
CALL p2();
|
||||
CALL p3(0);
|
||||
CALL p4(0);
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
DROP PROCEDURE p3;
|
||||
DROP PROCEDURE p4;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
# Test of a too big SET INSERT_ID: see if the truncated value goes
|
||||
|
|
36
mysql-test/extra/rpl_tests/rpl_loadfile.test
Normal file
36
mysql-test/extra/rpl_tests/rpl_loadfile.test
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Begin clean up test section
|
||||
--disable_warnings
|
||||
connection master;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
--enable_warnings
|
||||
|
||||
# Section 1 test
|
||||
|
||||
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
|
||||
INSERT INTO test.t1 VALUES(1,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
|
||||
delimiter |;
|
||||
create procedure test.p1()
|
||||
begin
|
||||
INSERT INTO test.t1 VALUES(2,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
CALL test.p1();
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
save_master_pos;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Need to allow some time when NDB engine is used for
|
||||
# the injector thread to have time to populate binlog
|
||||
let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
|
||||
# Cleanup
|
||||
connection master;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE test.t1;
|
||||
sync_slave_with_master;
|
|
@ -11,6 +11,11 @@
|
|||
# $engine_type storage engine to be tested
|
||||
#
|
||||
# Last update:
|
||||
# 2009-02-13 HH "Release_lock("hello")" is now also successful when delivering NULL,
|
||||
# replaced two sleeps by wait_condition. The last two "sleep 1" have not been
|
||||
# replaced as all tried wait conditions leaded to nondeterministic results, especially
|
||||
# to succeeding concurrent updates. To replace the sleeps there should be some time
|
||||
# planned (or internal knowledge of the server may help).
|
||||
# 2006-08-02 ML test refactored
|
||||
# old name was t/innodb_concurrent.test
|
||||
# main code went into include/concurrent.inc
|
||||
|
@ -20,8 +25,9 @@
|
|||
# new wrapper t/concurrent_innodb_safelog.test
|
||||
#
|
||||
|
||||
connection default;
|
||||
--source include/not_embedded.inc
|
||||
|
||||
connection default;
|
||||
#
|
||||
# Show prerequisites for this test.
|
||||
#
|
||||
|
@ -50,8 +56,6 @@ GRANT USAGE ON test.* TO mysqltest@localhost;
|
|||
#
|
||||
# Preparatory cleanup.
|
||||
#
|
||||
DO release_lock("hello");
|
||||
DO release_lock("hello2");
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
@ -86,13 +90,14 @@ drop table if exists t1;
|
|||
connection thread2;
|
||||
--echo ** Start transaction for thread 2
|
||||
begin;
|
||||
--echo ** Update will cause a table scan and a new ULL will
|
||||
--echo ** Update will cause a table scan and a new ULL will
|
||||
--echo ** be created and blocked on the first row where tipo=11.
|
||||
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
|
||||
sleep 1;
|
||||
|
||||
--echo ** connection thread1
|
||||
connection thread1;
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||
--source include/wait_condition.inc
|
||||
--echo ** Start new transaction for thread 1
|
||||
begin;
|
||||
--echo ** Update on t1 will cause a table scan which will be blocked because
|
||||
|
@ -111,7 +116,9 @@ drop table if exists t1;
|
|||
}
|
||||
--echo ** Release user level name lock from thread 1. This will cause the ULL
|
||||
--echo ** on thread 2 to end its wait.
|
||||
select release_lock("hello");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello");
|
||||
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
|
||||
select * from t1;
|
||||
|
||||
|
@ -119,7 +126,9 @@ drop table if exists t1;
|
|||
connection thread2;
|
||||
--echo ** Release the lock and collect result from update on thread 2
|
||||
reap;
|
||||
select release_lock("hello");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello");
|
||||
--echo ** Table should have eta updates where tipo=11 but updates made by
|
||||
--echo ** thread 1 shouldn't be visible yet.
|
||||
select * from t1;
|
||||
|
@ -183,10 +192,11 @@ drop table t1;
|
|||
--echo ** This will cause a hang on the first row where tipo=1 until the
|
||||
--echo ** blocking ULL is released.
|
||||
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
|
||||
sleep 1;
|
||||
|
||||
--echo ** connection thread1
|
||||
--echo ** connection thread1
|
||||
connection thread1;
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||
--source include/wait_condition.inc
|
||||
--echo ** Start transaction on thread 1
|
||||
begin;
|
||||
--echo ** Update on t1 will cause a table scan which will be blocked because
|
||||
|
@ -204,7 +214,9 @@ drop table t1;
|
|||
update t1 set tipo=1 where tipo=2;
|
||||
}
|
||||
--echo ** Release ULL. This will release the next waiting ULL on thread 2.
|
||||
select release_lock("hello");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically)the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello");
|
||||
--echo ** The table should still be updated with updates for thread 1 only:
|
||||
select * from t1;
|
||||
|
||||
|
@ -212,7 +224,9 @@ drop table t1;
|
|||
connection thread2;
|
||||
--echo ** Release the lock and collect result from thread 2:
|
||||
reap;
|
||||
select release_lock("hello");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello");
|
||||
--echo ** Seen from thread 2 the table should have been updated on four
|
||||
--echo ** places.
|
||||
select * from t1;
|
||||
|
@ -264,15 +278,18 @@ drop table t1;
|
|||
--echo ** Update will create a table scan which creates a ULL where a=2;
|
||||
--echo ** this will hang waiting on thread 1.
|
||||
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
|
||||
sleep 1;
|
||||
|
||||
--echo ** connection thread1
|
||||
connection thread1;
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||
--source include/wait_condition.inc
|
||||
--echo ** Insert new values to t1 from thread 1; this created an implicit
|
||||
--echo ** commit since there are no on-going transactions.
|
||||
insert into t1 values (1,1);
|
||||
--echo ** Release the ULL (thread 2 updates will finish).
|
||||
select release_lock("hello2");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello2");
|
||||
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
|
||||
select * from t1;
|
||||
|
||||
|
@ -280,7 +297,9 @@ drop table t1;
|
|||
connection thread2;
|
||||
--echo ** Collect results from thread 2 and release the lock.
|
||||
reap;
|
||||
select release_lock("hello2");
|
||||
# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
|
||||
# is also guaranteed for NULL. Replaced SELECT by DO (no result).
|
||||
DO release_lock("hello2");
|
||||
--echo ** The table should look like the original+updates for thread 2,
|
||||
--echo ** and consist of new rows:
|
||||
select * from t1;
|
||||
|
@ -534,6 +553,9 @@ drop table t1;
|
|||
connection thread2;
|
||||
begin;
|
||||
send delete from t1 where tipo=2;
|
||||
# The sleep has not been replaced as all tried wait conditions leaded to sporadically
|
||||
# succeding update in the following thread. Also the used status variables '%lock%' and
|
||||
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
||||
sleep 1;
|
||||
|
||||
--echo ** connection thread1
|
||||
|
@ -594,8 +616,11 @@ drop table t1;
|
|||
connection thread2;
|
||||
begin;
|
||||
send delete from t1 where tipo=2;
|
||||
# The sleep has not been replaced as all tried wait conditions leaded to sporadically
|
||||
# succeding update in the following thread. Also the used status variables '%lock%' and
|
||||
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
||||
sleep 1;
|
||||
|
||||
|
||||
--echo ** connection thread1
|
||||
connection thread1;
|
||||
begin;
|
||||
|
|
|
@ -3,27 +3,44 @@
|
|||
# in test cases and can be reused. #
|
||||
######################################################
|
||||
|
||||
# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
|
||||
# 'grep' call
|
||||
# This test is disabled on Windows via the next line until the above bug is
|
||||
# resolved
|
||||
--source include/not_windows.inc
|
||||
|
||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
# there is no neat way to find the backupid, this is a hack to find it...
|
||||
let $dump_file= $MYSQLTEST_VARDIR/tmp/tmp.dat;
|
||||
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $dump_file
|
||||
# To find the backupid, we must dump this data to a table, and SELECT
|
||||
# what we want into an outfile. This could be accomplished with grep, but
|
||||
# grep isn't Windows-portable
|
||||
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
--disable_query_log
|
||||
# create a table to help us out
|
||||
--disable_warnings # leave this on until done with the entire process
|
||||
# cleanup
|
||||
DROP TABLE IF EXISTS helper1;
|
||||
CREATE TABLE helper1(c1 VARCHAR(20));
|
||||
# dump raw data to file
|
||||
let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat;
|
||||
let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat;
|
||||
--error 0,1
|
||||
--remove_file $ndb_backup_file1
|
||||
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1
|
||||
# load the table from the raw data file
|
||||
eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1;
|
||||
--remove_file $ndb_backup_file1
|
||||
# output what we need
|
||||
eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%'
|
||||
INTO OUTFILE '$ndb_backup_file2';
|
||||
# cleanup
|
||||
DROP TABLE helper1;
|
||||
--enable_warnings
|
||||
--enable_query_log
|
||||
|
||||
--replace_result $dump_file DUMP_FILE
|
||||
eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
|
||||
eval LOAD DATA INFILE '$ndb_backup_file2' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
--remove_file $ndb_backup_file2
|
||||
|
||||
# Load backup id into environment variable
|
||||
let the_backup_id=`SELECT backup_id from test.backup_info`;
|
||||
|
||||
DROP TABLE test.backup_info;
|
||||
|
||||
remove_file $dump_file;
|
||||
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -7,8 +7,6 @@ SELECT @@global.innodb_locks_unsafe_for_binlog;
|
|||
0
|
||||
# keep_locks == 1
|
||||
GRANT USAGE ON test.* TO mysqltest@localhost;
|
||||
DO release_lock("hello");
|
||||
DO release_lock("hello2");
|
||||
drop table if exists t1;
|
||||
|
||||
**
|
||||
|
@ -36,7 +34,7 @@ get_lock("hello",10)
|
|||
** connection thread2
|
||||
** Start transaction for thread 2
|
||||
begin;
|
||||
** Update will cause a table scan and a new ULL will
|
||||
** Update will cause a table scan and a new ULL will
|
||||
** be created and blocked on the first row where tipo=11.
|
||||
update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
|
||||
** connection thread1
|
||||
|
@ -51,9 +49,7 @@ update t1 set eta=2 where tipo=22;
|
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
** Release user level name lock from thread 1. This will cause the ULL
|
||||
** on thread 2 to end its wait.
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Table is now updated with a new eta on tipo=22 for thread 1.
|
||||
select * from t1;
|
||||
eta tipo c
|
||||
|
@ -70,9 +66,7 @@ eta tipo c
|
|||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** connection thread2
|
||||
** Release the lock and collect result from update on thread 2
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Table should have eta updates where tipo=11 but updates made by
|
||||
** thread 1 shouldn't be visible yet.
|
||||
select * from t1;
|
||||
|
@ -194,9 +188,7 @@ begin;
|
|||
update t1 set tipo=1 where tipo=2;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
** Release ULL. This will release the next waiting ULL on thread 2.
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** The table should still be updated with updates for thread 1 only:
|
||||
select * from t1;
|
||||
eta tipo c
|
||||
|
@ -213,9 +205,7 @@ eta tipo c
|
|||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** connection thread2
|
||||
** Release the lock and collect result from thread 2:
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Seen from thread 2 the table should have been updated on four
|
||||
** places.
|
||||
select * from t1;
|
||||
|
@ -319,9 +309,7 @@ update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
|
|||
** commit since there are no on-going transactions.
|
||||
insert into t1 values (1,1);
|
||||
** Release the ULL (thread 2 updates will finish).
|
||||
select release_lock("hello2");
|
||||
release_lock("hello2")
|
||||
1
|
||||
DO release_lock("hello2");
|
||||
** ..but thread 1 will still see t1 as if nothing has happend:
|
||||
select * from t1;
|
||||
a b
|
||||
|
@ -332,9 +320,7 @@ a b
|
|||
1 1
|
||||
** connection thread2
|
||||
** Collect results from thread 2 and release the lock.
|
||||
select release_lock("hello2");
|
||||
release_lock("hello2")
|
||||
1
|
||||
DO release_lock("hello2");
|
||||
** The table should look like the original+updates for thread 2,
|
||||
** and consist of new rows:
|
||||
select * from t1;
|
||||
|
|
|
@ -7,8 +7,6 @@ SELECT @@global.innodb_locks_unsafe_for_binlog;
|
|||
1
|
||||
# keep_locks == 0
|
||||
GRANT USAGE ON test.* TO mysqltest@localhost;
|
||||
DO release_lock("hello");
|
||||
DO release_lock("hello2");
|
||||
drop table if exists t1;
|
||||
|
||||
**
|
||||
|
@ -36,7 +34,7 @@ get_lock("hello",10)
|
|||
** connection thread2
|
||||
** Start transaction for thread 2
|
||||
begin;
|
||||
** Update will cause a table scan and a new ULL will
|
||||
** Update will cause a table scan and a new ULL will
|
||||
** be created and blocked on the first row where tipo=11.
|
||||
update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
|
||||
** connection thread1
|
||||
|
@ -50,9 +48,7 @@ begin;
|
|||
update t1 set eta=2 where tipo=22;
|
||||
** Release user level name lock from thread 1. This will cause the ULL
|
||||
** on thread 2 to end its wait.
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Table is now updated with a new eta on tipo=22 for thread 1.
|
||||
select * from t1;
|
||||
eta tipo c
|
||||
|
@ -69,9 +65,7 @@ eta tipo c
|
|||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** connection thread2
|
||||
** Release the lock and collect result from update on thread 2
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Table should have eta updates where tipo=11 but updates made by
|
||||
** thread 1 shouldn't be visible yet.
|
||||
select * from t1;
|
||||
|
@ -192,9 +186,7 @@ begin;
|
|||
** do not match the WHERE condition are released.
|
||||
update t1 set tipo=1 where tipo=2;
|
||||
** Release ULL. This will release the next waiting ULL on thread 2.
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** The table should still be updated with updates for thread 1 only:
|
||||
select * from t1;
|
||||
eta tipo c
|
||||
|
@ -211,9 +203,7 @@ eta tipo c
|
|||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** connection thread2
|
||||
** Release the lock and collect result from thread 2:
|
||||
select release_lock("hello");
|
||||
release_lock("hello")
|
||||
1
|
||||
DO release_lock("hello");
|
||||
** Seen from thread 2 the table should have been updated on four
|
||||
** places.
|
||||
select * from t1;
|
||||
|
@ -317,9 +307,7 @@ update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
|
|||
** commit since there are no on-going transactions.
|
||||
insert into t1 values (1,1);
|
||||
** Release the ULL (thread 2 updates will finish).
|
||||
select release_lock("hello2");
|
||||
release_lock("hello2")
|
||||
1
|
||||
DO release_lock("hello2");
|
||||
** ..but thread 1 will still see t1 as if nothing has happend:
|
||||
select * from t1;
|
||||
a b
|
||||
|
@ -330,9 +318,7 @@ a b
|
|||
1 1
|
||||
** connection thread2
|
||||
** Collect results from thread 2 and release the lock.
|
||||
select release_lock("hello2");
|
||||
release_lock("hello2")
|
||||
1
|
||||
DO release_lock("hello2");
|
||||
** The table should look like the original+updates for thread 2,
|
||||
** and consist of new rows:
|
||||
select * from t1;
|
||||
|
|
|
@ -1731,7 +1731,7 @@ t1 CREATE TABLE `t1` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
@ -1745,7 +1745,7 @@ t1 CREATE TEMPORARY TABLE `t1` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
|
|
@ -611,3 +611,22 @@ check table t1 extended;
|
|||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
|
||||
least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
|
||||
a
|
||||
create table t1
|
||||
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` varchar(1) CHARACTER SET latin5 NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
|
||||
latin5_turkish_ci then 2 else 3 end;
|
||||
case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
|
||||
latin5_turkish_ci then 2 else 3 end
|
||||
3
|
||||
select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
|
||||
concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
|
||||
abc
|
||||
|
|
|
@ -1391,3 +1391,174 @@ WHERE
|
|||
`RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND
|
||||
`TESTID`='' AND `UCCHECK`='';
|
||||
drop table t1;
|
||||
#
|
||||
# Generic @@optimizer_switch tests (move those into a separate file if
|
||||
# we get another @@optimizer_switch user)
|
||||
#
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
|
||||
set optimizer_switch='index_merge_union=on';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
|
||||
set optimizer_switch=4;
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4'
|
||||
set optimizer_switch=NULL;
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
|
||||
set optimizer_switch='default,index_merge';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
|
||||
set optimizer_switch='index_merge=index_merge';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=index_merge'
|
||||
set optimizer_switch='index_merge=on,but...';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'but...'
|
||||
set optimizer_switch='index_merge=';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge='
|
||||
set optimizer_switch='index_merge';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
|
||||
set optimizer_switch='on';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'on'
|
||||
set optimizer_switch='index_merge=on,index_merge=off';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off'
|
||||
set optimizer_switch='index_merge_union=on,index_merge_union=default';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge_union=default'
|
||||
set optimizer_switch='default,index_merge=on,index_merge=off,default';
|
||||
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off,default'
|
||||
set optimizer_switch=default;
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off,default';
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
|
||||
set optimizer_switch=default;
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
set @@global.optimizer_switch=default;
|
||||
select @@global.optimizer_switch;
|
||||
@@global.optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
#
|
||||
# Check index_merge's @@optimizer_switch flags
|
||||
#
|
||||
select @@optimizer_switch;
|
||||
@@optimizer_switch
|
||||
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a int, b int, c int, filler char(100),
|
||||
key(a), key(b), key(c));
|
||||
insert into t1 select
|
||||
A.a * B.a*10 + C.a*100,
|
||||
A.a * B.a*10 + C.a*100,
|
||||
A.a,
|
||||
'filler'
|
||||
from t0 A, t0 B, t0 C;
|
||||
This should use union:
|
||||
explain select * from t1 where a=1 or b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 2 Using union(a,b); Using where
|
||||
This should use ALL:
|
||||
set optimizer_switch='default,index_merge=off';
|
||||
explain select * from t1 where a=1 or b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a,b NULL NULL NULL 1000 Using where
|
||||
This should use sort-union:
|
||||
set optimizer_switch='default,index_merge_union=off';
|
||||
explain select * from t1 where a=1 or b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 2 Using sort_union(a,b); Using where
|
||||
This will use sort-union:
|
||||
set optimizer_switch=default;
|
||||
explain select * from t1 where a<1 or b <1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 38 Using sort_union(a,b); Using where
|
||||
This should use ALL:
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
explain select * from t1 where a<1 or b <1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a,b NULL NULL NULL 1000 Using where
|
||||
This should use ALL:
|
||||
set optimizer_switch='default,index_merge=off';
|
||||
explain select * from t1 where a<1 or b <1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a,b NULL NULL NULL 1000 Using where
|
||||
This will use sort-union:
|
||||
set optimizer_switch='default,index_merge_union=off';
|
||||
explain select * from t1 where a<1 or b <1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 38 Using sort_union(a,b); Using where
|
||||
alter table t1 add d int, add key(d);
|
||||
update t1 set d=a;
|
||||
This will use sort_union:
|
||||
set optimizer_switch=default;
|
||||
explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b,c,d a,b 5,5 NULL 3 Using sort_union(a,b); Using where
|
||||
And if we disable sort_union, union:
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b,c,d c,d 5,5 NULL 100 Using union(c,d); Using where
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
a int, b int, c int,
|
||||
filler1 char(200), filler2 char(200),
|
||||
key(a),key(b),key(c)
|
||||
);
|
||||
insert into t1
|
||||
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a, 'foo', 'bar'
|
||||
from t0 A, t0 B, t0 C, t0 D where D.a<5;
|
||||
This should be intersect:
|
||||
set optimizer_switch=default;
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
|
||||
No intersect when index_merge is disabled:
|
||||
set optimizer_switch='default,index_merge=off';
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 49 Using where
|
||||
No intersect if it is disabled:
|
||||
set optimizer_switch='default,index_merge_intersection=off';
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 49 Using where
|
||||
Do intersect when union was disabled
|
||||
set optimizer_switch='default,index_merge_union=off';
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
|
||||
Do intersect when sort_union was disabled
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
|
||||
This will use intersection inside a union:
|
||||
set optimizer_switch=default;
|
||||
explain select * from t1 where a=10 and b=10 or c=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b,c a,b,c 5,5,5 NULL 6 Using union(intersect(a,b),c); Using where
|
||||
Should be only union left:
|
||||
set optimizer_switch='default,index_merge_intersection=off';
|
||||
explain select * from t1 where a=10 and b=10 or c=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b,c a,c 5,5 NULL 54 Using union(a,c); Using where
|
||||
This will switch to sort-union (intersection will be gone, too,
|
||||
thats a known limitation:
|
||||
set optimizer_switch='default,index_merge_union=off';
|
||||
explain select * from t1 where a=10 and b=10 or c=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b,c a,c 5,5 NULL 54 Using sort_union(a,c); Using where
|
||||
set optimizer_switch=default;
|
||||
show variables like 'optimizer_switch';
|
||||
Variable_name Value
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
drop table t0, t1;
|
||||
|
|
|
@ -1582,4 +1582,9 @@ SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
|
|||
CREATE_OPTIONS
|
||||
key_block_size=1
|
||||
DROP TABLE t1;
|
||||
SET TIMESTAMP=@@TIMESTAMP + 10000000;
|
||||
SELECT 'OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
|
||||
TEST_RESULT
|
||||
OK
|
||||
SET TIMESTAMP=DEFAULT;
|
||||
End of 5.1 tests.
|
||||
|
|
|
@ -276,8 +276,6 @@ Variable_name Value
|
|||
Key_blocks_unused KEY_BLOCKS_UNUSED
|
||||
set global keycache2.key_buffer_size=0;
|
||||
set global keycache3.key_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_buffer_size value: '100'
|
||||
set global keycache3.key_buffer_size=0;
|
||||
create table t1 (mytext text, FULLTEXT (mytext));
|
||||
insert t1 values ('aaabbb');
|
||||
|
|
|
@ -96,40 +96,6 @@ alter table t1 auto_increment=0;
|
|||
alter table t1 auto_increment=0;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int(11) unsigned default NULL,
|
||||
b varchar(255) default NULL,
|
||||
UNIQUE KEY a (a),
|
||||
KEY b (b)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
CREATE TABLE t3 SELECT * FROM t1;
|
||||
# test altering of columns that multiupdate doesn't use
|
||||
# normal mode
|
||||
# PS mode
|
||||
# test altering of columns that multiupdate uses
|
||||
# normal mode
|
||||
# PS mode
|
||||
DROP TABLE t1, t2, t3;
|
||||
CREATE TABLE t1( a INT, b INT );
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
# 1. test regular tables
|
||||
# 1.1. test altering of columns that multiupdate doesn't use
|
||||
# 1.1.1. normal mode
|
||||
# 1.1.2. PS mode
|
||||
# 1.2. test altering of columns that multiupdate uses
|
||||
# 1.2.1. normal mode
|
||||
# 1.2.2. PS mode
|
||||
ALTER TABLE t1 ADD COLUMN a INT;
|
||||
# 2. test UNIONs
|
||||
# 2.1. test altering of columns that multiupdate doesn't use
|
||||
# 2.1.1. normal mode
|
||||
# 2.1.2. PS mode
|
||||
# 2.2. test altering of columns that multiupdate uses
|
||||
# 2.2.1. normal mode
|
||||
# 2.2.2. PS mode
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (i int);
|
||||
lock table t1 read;
|
||||
|
|
19
mysql-test/r/lock_multi_bug38499.result
Normal file
19
mysql-test/r/lock_multi_bug38499.result
Normal file
|
@ -0,0 +1,19 @@
|
|||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1( a INT, b INT );
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
# 1. test regular tables
|
||||
# 1.1. test altering of columns that multiupdate doesn't use
|
||||
# 1.1.1. normal mode
|
||||
# 1.1.2. PS mode
|
||||
# 1.2. test altering of columns that multiupdate uses
|
||||
# 1.2.1. normal mode
|
||||
# 1.2.2. PS mode
|
||||
ALTER TABLE t1 ADD COLUMN a INT;
|
||||
# 2. test UNIONs
|
||||
# 2.1. test altering of columns that multiupdate doesn't use
|
||||
# 2.1.1. normal mode
|
||||
# 2.1.2. PS mode
|
||||
# 2.2. test altering of columns that multiupdate uses
|
||||
# 2.2.1. normal mode
|
||||
# 2.2.2. PS mode
|
||||
DROP TABLE t1;
|
17
mysql-test/r/lock_multi_bug38691.result
Normal file
17
mysql-test/r/lock_multi_bug38691.result
Normal file
|
@ -0,0 +1,17 @@
|
|||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
CREATE TABLE t1 (
|
||||
a int(11) unsigned default NULL,
|
||||
b varchar(255) default NULL,
|
||||
UNIQUE KEY a (a),
|
||||
KEY b (b)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
CREATE TABLE t3 SELECT * FROM t1;
|
||||
# test altering of columns that multiupdate doesn't use
|
||||
# normal mode
|
||||
# PS mode
|
||||
# test altering of columns that multiupdate uses
|
||||
# normal mode
|
||||
# PS mode
|
||||
DROP TABLE t1, t2, t3;
|
13
mysql-test/r/mysql-bug41486.result
Normal file
13
mysql-test/r/mysql-bug41486.result
Normal file
|
@ -0,0 +1,13 @@
|
|||
DROP TABLE IF EXISTS t1;
|
||||
SET @old_max_allowed_packet= @@global.max_allowed_packet;
|
||||
SET @@global.max_allowed_packet = 2 * 1024 * 1024 + 1024;
|
||||
CREATE TABLE t1(data LONGBLOB);
|
||||
INSERT INTO t1 SELECT REPEAT('1', 2*1024*1024);
|
||||
SET @old_general_log = @@global.general_log;
|
||||
SET @@global.general_log = 0;
|
||||
SET @@global.general_log = @old_general_log;
|
||||
SELECT LENGTH(data) FROM t1;
|
||||
LENGTH(data)
|
||||
2097152
|
||||
DROP TABLE t1;
|
||||
SET @@global.max_allowed_packet = @old_max_allowed_packet;
|
|
@ -44,16 +44,16 @@ SET TIMESTAMP=1000000000/*!*/;
|
|||
insert into t2 values ()
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
|
@ -144,16 +144,16 @@ SET TIMESTAMP=1000000000/*!*/;
|
|||
insert into t2 values ()
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
|
@ -359,29 +359,29 @@ SET @@session.collation_database=DEFAULT/*!*/;
|
|||
create table t1 (a varchar(64) character set utf8)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=7/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=7/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
drop table t1
|
||||
|
|
|
@ -4416,4 +4416,32 @@ date_nokey
|
|||
Warnings:
|
||||
Warning 1292 Incorrect date value: '10:41:7' for column 'date_nokey' at row 1
|
||||
DROP TABLE A,C;
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT);
|
||||
INSERT INTO t1 VALUES (1, 1);
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
|
||||
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
|
||||
a b
|
||||
1 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL);
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -160,12 +160,12 @@ SELECT a FROM t1
|
|||
UNION
|
||||
SELECT a FROM t1
|
||||
) alias;
|
||||
SELECT a INTO OUTFILE 'union.out.file' FROM (
|
||||
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
|
||||
SELECT a FROM t1
|
||||
UNION
|
||||
SELECT a FROM t1 WHERE 0
|
||||
) alias;
|
||||
SELECT a INTO DUMPFILE 'union.out.file2' FROM (
|
||||
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
|
||||
SELECT a FROM t1
|
||||
UNION
|
||||
SELECT a FROM t1 WHERE 0
|
||||
|
@ -178,21 +178,21 @@ SELECT a INTO @v FROM t1
|
|||
SELECT a FROM (
|
||||
SELECT a FROM t1
|
||||
UNION
|
||||
SELECT a INTO OUTFILE 'union.out.file3' FROM t1
|
||||
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
|
||||
) alias;
|
||||
SELECT a FROM (
|
||||
SELECT a FROM t1
|
||||
UNION
|
||||
SELECT a INTO DUMPFILE 'union.out.file4' FROM t1
|
||||
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
|
||||
) alias;
|
||||
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
|
||||
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
|
||||
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
|
||||
SELECT a FROM t1 UNION SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
|
||||
SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
|
||||
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
|
||||
ERROR HY000: Incorrect usage of UNION and INTO
|
||||
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
|
||||
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
|
||||
ERROR HY000: Incorrect usage of UNION and INTO
|
||||
SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
|
||||
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
|
||||
ERROR HY000: Incorrect usage of UNION and INTO
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
|
|
|
@ -28,6 +28,7 @@ set @my_storage_engine =@@global.storage_engine;
|
|||
set @my_thread_cache_size =@@global.thread_cache_size;
|
||||
set @my_max_allowed_packet =@@global.max_allowed_packet;
|
||||
set @my_delay_key_write =@@global.delay_key_write;
|
||||
set @my_join_buffer_size =@@global.join_buffer_size;
|
||||
set @`test`=1;
|
||||
select @test, @`test`, @TEST, @`TEST`, @"teSt";
|
||||
@test @`test` @TEST @`TEST` @"teSt"
|
||||
|
@ -1019,6 +1020,11 @@ show variables like 'hostname';
|
|||
Variable_name Value
|
||||
hostname #
|
||||
End of 5.0 tests
|
||||
set join_buffer_size=1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '1'
|
||||
set @save_join_buffer_size=@@join_buffer_size;
|
||||
set join_buffer_size=@save_join_buffer_size;
|
||||
set global binlog_cache_size =@my_binlog_cache_size;
|
||||
set global connect_timeout =@my_connect_timeout;
|
||||
set global delayed_insert_timeout =@my_delayed_insert_timeout;
|
||||
|
@ -1050,6 +1056,7 @@ set global storage_engine =@my_storage_engine;
|
|||
set global thread_cache_size =@my_thread_cache_size;
|
||||
set global max_allowed_packet = default;
|
||||
set global delay_key_write =@my_delay_key_write;
|
||||
set global join_buffer_size =@my_join_buffer_size;
|
||||
show global variables where Variable_name='table_definition_cache' or
|
||||
Variable_name='table_lock_wait_timeout';
|
||||
Variable_name Value
|
||||
|
|
|
@ -38,4 +38,5 @@ DROP PROCEDURE IF EXISTS p2;
|
|||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
stop slave sql_thread;
|
||||
reset slave;
|
||||
SET @@global.relay_log_purge= @old_relay_log_purge;
|
||||
|
|
|
@ -1137,6 +1137,38 @@ DROP PROCEDURE p1;
|
|||
DROP TABLE t1;
|
||||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
CREATE PROCEDURE p1(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT v1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
DECLARE v1 INT;
|
||||
CREATE TABLE t1 SELECT v1+1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p3(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p4(IN v1 INT)
|
||||
BEGIN
|
||||
DECLARE v2 INT;
|
||||
CREATE TABLE t1 SELECT 1, v1, v2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 1, v1+1, v2;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CALL p1(1);
|
||||
CALL p2();
|
||||
CALL p3(0);
|
||||
CALL p4(0);
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
DROP PROCEDURE p3;
|
||||
DROP PROCEDURE p4;
|
||||
End of 5.0 tests
|
||||
reset master;
|
||||
create table t1 (id tinyint auto_increment primary key);
|
||||
|
|
|
@ -644,6 +644,38 @@ DROP PROCEDURE p1;
|
|||
DROP TABLE t1;
|
||||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
CREATE PROCEDURE p1(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT v1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
DECLARE v1 INT;
|
||||
CREATE TABLE t1 SELECT v1+1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p3(IN v1 INT)
|
||||
BEGIN
|
||||
CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CREATE PROCEDURE p4(IN v1 INT)
|
||||
BEGIN
|
||||
DECLARE v2 INT;
|
||||
CREATE TABLE t1 SELECT 1, v1, v2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 1, v1+1, v2;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
CALL p1(1);
|
||||
CALL p2();
|
||||
CALL p3(0);
|
||||
CALL p4(0);
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
DROP PROCEDURE p3;
|
||||
DROP PROCEDURE p4;
|
||||
End of 5.0 tests
|
||||
reset master;
|
||||
create table t1 (id tinyint auto_increment primary key);
|
||||
|
|
|
@ -52,9 +52,10 @@ DROP FUNCTION IF EXISTS f1;
|
|||
DROP TRIGGER IF EXISTS tr1;
|
||||
enable_warnings;
|
||||
|
||||
stop slave sql_thread;
|
||||
reset slave;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
|
||||
remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
|
||||
stop slave sql_thread;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
SET @@global.relay_log_purge= @old_relay_log_purge;
|
||||
|
|
|
@ -2130,6 +2130,26 @@ SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
|
|||
a
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#21360 - mysqldump error on federated tables
|
||||
#
|
||||
#Switch to Connection Slave
|
||||
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
|
||||
INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
|
||||
#Switch to Connection Master
|
||||
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
# Dump table t1 using mysqldump tool
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` varchar(20) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE t1;
|
||||
#Switch to Connection Slave
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create server 's1' foreign data wrapper 'mysql' options (port 3306);
|
||||
drop server 's1';
|
||||
|
|
|
@ -1942,6 +1942,28 @@ DROP TABLE t1;
|
|||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#21360 - mysqldump error on federated tables
|
||||
--echo #
|
||||
connection slave;
|
||||
--echo #Switch to Connection Slave
|
||||
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
|
||||
INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
|
||||
|
||||
connection master;
|
||||
--echo #Switch to Connection Master
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--echo # Dump table t1 using mysqldump tool
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--exec $MYSQL_DUMP --compact test t1
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
--echo #Switch to Connection Slave
|
||||
DROP TABLE t1;
|
||||
|
||||
connection default;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
@ -166,7 +166,7 @@ NULL information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf
|
|||
NULL information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
|
||||
NULL information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema PROCESSLIST TIME 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(7) select
|
||||
NULL information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7) select
|
||||
NULL information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
|
@ -340,6 +340,7 @@ ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
|||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL bigint NULL NULL
|
||||
NULL datetime NULL NULL
|
||||
NULL int NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
|
@ -519,7 +520,7 @@ NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
|
|||
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PROCESSLIST DB varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PROCESSLIST COMMAND varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema PROCESSLIST TIME bigint NULL NULL NULL NULL bigint(7)
|
||||
NULL information_schema PROCESSLIST TIME int NULL NULL NULL NULL int(7)
|
||||
3.0000 information_schema PROCESSLIST STATE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema PROCESSLIST INFO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
|
|
|
@ -48,7 +48,7 @@ NULL mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NUL
|
|||
NULL mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
|
||||
NULL mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE') select,insert,update,references
|
||||
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) select,insert,update,references
|
||||
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
|
||||
NULL mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') select,insert,update,references
|
||||
NULL mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
|
||||
NULL mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references
|
||||
|
@ -60,7 +60,7 @@ NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('fu
|
|||
NULL mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
|
||||
NULL mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
|
||||
NULL mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
NULL mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
|
||||
NULL mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
|
||||
NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references
|
||||
|
@ -150,7 +150,7 @@ NULL mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time
|
|||
NULL mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
|
||||
NULL mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
|
||||
NULL mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
|
||||
NULL mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
NULL mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
|
||||
|
@ -329,7 +329,7 @@ NULL mysql event ends datetime NULL NULL NULL NULL datetime
|
|||
3.0000 mysql event on_completion enum 8 24 utf8 utf8_general_ci enum('DROP','PRESERVE')
|
||||
3.0000 mysql event sql_mode set 478 1434 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql event originator int NULL NULL NULL NULL int(10)
|
||||
NULL mysql event originator int NULL NULL NULL NULL int(10) unsigned
|
||||
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
|
||||
3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
|
||||
|
@ -342,7 +342,7 @@ NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
|
|||
NULL mysql general_log event_time timestamp NULL NULL NULL NULL timestamp
|
||||
1.0000 mysql general_log user_host mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
NULL mysql general_log thread_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql general_log server_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql general_log command_type varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 mysql general_log argument mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
|
@ -434,7 +434,7 @@ NULL mysql slow_log rows_examined int NULL NULL NULL NULL int(11)
|
|||
3.0000 mysql slow_log db varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
NULL mysql slow_log last_insert_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log insert_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log server_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log server_id int NULL NULL NULL NULL int(10) unsigned
|
||||
1.0000 mysql slow_log sql_text mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
|
|
|
@ -27,7 +27,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
@ -97,7 +97,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
|
|
@ -27,7 +27,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
@ -97,7 +97,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
|
|
@ -17,7 +17,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
|
|
@ -17,7 +17,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
|||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`TIME` int(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) DEFAULT CHARSET=utf8
|
||||
|
|
|
@ -131,8 +131,9 @@ create table t9 engine=myisam as select * from t9_c;
|
|||
create table t10 engine=myisam as select * from t10_c;
|
||||
ForceVarPart: 0
|
||||
ForceVarPart: 1
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
|
||||
ForceVarPart: 0
|
||||
|
@ -286,8 +287,9 @@ auto_increment
|
|||
10001
|
||||
ALTER TABLE t7_c
|
||||
PARTITION BY LINEAR KEY (`dardtestard`);
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
|
||||
select count(*) from t1;
|
||||
|
@ -490,8 +492,9 @@ select * from t9_c) a;
|
|||
count(*)
|
||||
3
|
||||
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
|
||||
drop table if exists t2_c;
|
||||
|
|
|
@ -125,8 +125,9 @@ create table t6 engine=myisam as select * from t6_c;
|
|||
create table t7 engine=myisam as select * from t7_c;
|
||||
create table t8 engine=myisam as select * from t8_c;
|
||||
create table t9 engine=myisam as select * from t9_c;
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
select count(*) from t1;
|
||||
|
@ -244,8 +245,9 @@ PARTITION BY LINEAR HASH (`relatta`)
|
|||
PARTITIONS 4;
|
||||
ALTER TABLE t7_c
|
||||
PARTITION BY LINEAR KEY (`dardtestard`);
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
select count(*) from t1;
|
||||
|
@ -448,8 +450,9 @@ select * from t9_c) a;
|
|||
count(*)
|
||||
3
|
||||
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
Create table test/def/t2_c failed: Translate frm error
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
|
|
|
@ -227,8 +227,9 @@ hex(h3) NULL
|
|||
hex(i1) NULL
|
||||
hex(i2) NULL
|
||||
hex(i3) NULL
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
1;0x1;0x17;0x789A;0x789ABCDE;0xFEDC0001;127;255;32767;65535;2147483647;4294967295;9223372036854775807;18446744073709551615;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x12;0x123456789ABCDEF0;0x012345;0x12;0x123456789ABCDEF0;0x00123450
|
||||
2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0
|
||||
|
@ -257,8 +258,9 @@ create table t4 (pk int key, a int) engine ndb;
|
|||
insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
|
||||
insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
|
||||
insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
'1' '1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020' '0x00123450000020'
|
||||
|
||||
|
@ -297,8 +299,9 @@ create table t1
|
|||
insert into t1 values(1, 8388607, 16777215);
|
||||
insert into t1 values(2, -8388608, 0);
|
||||
insert into t1 values(3, -1, 1);
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
1;8388607;16777215
|
||||
2;-8388608;0
|
||||
|
|
|
@ -27,8 +27,9 @@ pk1 c2 c3 hex(c4)
|
|||
3 Sweden 498 1
|
||||
4 Sweden 497 1
|
||||
5 Sweden 496 1
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE table_space1
|
||||
|
@ -91,8 +92,9 @@ LENGTH(data)
|
|||
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
|
||||
LENGTH(data)
|
||||
16384
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
|
@ -317,8 +319,9 @@ pk1 c2 c3 hex(c4)
|
|||
248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
|
||||
247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
|
||||
246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
|
|
|
@ -27,8 +27,9 @@ pk1 c2 c3 hex(c4)
|
|||
3 Sweden 498 1
|
||||
4 Sweden 497 1
|
||||
5 Sweden 496 1
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE table_space1
|
||||
|
@ -91,8 +92,9 @@ LENGTH(data)
|
|||
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
|
||||
LENGTH(data)
|
||||
16384
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
|
@ -317,8 +319,9 @@ pk1 c2 c3 hex(c4)
|
|||
248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
|
||||
247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
|
||||
246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
|
|
|
@ -89,3 +89,81 @@ show grants for rpl_do_grant2@localhost;
|
|||
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
|
||||
show grants for rpl_do_grant2@localhost;
|
||||
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
|
||||
DROP DATABASE IF EXISTS bug42217_db;
|
||||
CREATE DATABASE bug42217_db;
|
||||
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
|
||||
IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
|
||||
USE bug42217_db;
|
||||
CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_del_func()";
|
||||
END//
|
||||
USE bug42217_db;
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
|
||||
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
|
||||
SELECT upgrade_del_func();
|
||||
upgrade_del_func()
|
||||
INSIDE upgrade_del_func()
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
|
||||
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
|
||||
SHOW GRANTS FOR 'create_rout_db'@'localhost';
|
||||
Grants for create_rout_db@localhost
|
||||
GRANT USAGE ON *.* TO 'create_rout_db'@'localhost' IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
|
||||
GRANT CREATE ROUTINE ON `bug42217_db`.* TO 'create_rout_db'@'localhost' WITH GRANT OPTION
|
||||
GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'create_rout_db'@'localhost'
|
||||
USE bug42217_db;
|
||||
SHOW CREATE FUNCTION upgrade_del_func;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_del_func()";
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT upgrade_del_func();
|
||||
upgrade_del_func()
|
||||
INSIDE upgrade_del_func()
|
||||
"Check whether the definer user will be able to execute the replicated routine on slave"
|
||||
USE bug42217_db;
|
||||
SHOW CREATE FUNCTION upgrade_del_func;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_del_func()";
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT upgrade_del_func();
|
||||
upgrade_del_func()
|
||||
INSIDE upgrade_del_func()
|
||||
DELETE FROM mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
USE bug42217_db;
|
||||
"Can't execute the replicated routine on slave like before after procs privilege is deleted "
|
||||
SELECT upgrade_del_func();
|
||||
ERROR 42000: execute command denied to user 'create_rout_db'@'localhost' for routine 'bug42217_db.upgrade_del_func'
|
||||
"Test the user who creates a function on master doesn't exist on slave."
|
||||
"Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
|
||||
DROP USER 'create_rout_db'@'localhost';
|
||||
CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_alter_func()";
|
||||
END//
|
||||
SELECT upgrade_alter_func();
|
||||
upgrade_alter_func()
|
||||
INSIDE upgrade_alter_func()
|
||||
SHOW CREATE FUNCTION upgrade_alter_func;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
upgrade_alter_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_alter_func()";
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
"Should no privilege record for upgrade_alter_func in mysql.procs_priv"
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
|
||||
SELECT upgrade_alter_func();
|
||||
ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist
|
||||
USE bug42217_db;
|
||||
DROP FUNCTION upgrade_del_func;
|
||||
DROP FUNCTION upgrade_alter_func;
|
||||
DROP DATABASE bug42217_db;
|
||||
DROP USER 'create_rout_db'@'localhost';
|
||||
"End of test"
|
||||
|
|
|
@ -29,3 +29,28 @@ a
|
|||
2
|
||||
3
|
||||
drop table t1;
|
||||
==== Bug22504 Initialize ====
|
||||
[on master]
|
||||
SET sql_mode='ignore_space';
|
||||
CREATE TABLE t1(a int);
|
||||
insert into t1 values (1), (2), (3), (4);
|
||||
select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
truncate table t1;
|
||||
load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
[on slave]
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
==== Clean up ====
|
||||
[on master]
|
||||
DROP TABLE t1;
|
||||
[on slave]
|
||||
|
|
|
@ -225,3 +225,21 @@ aberration
|
|||
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE test.t1;
|
||||
**** Resetting master and slave ****
|
||||
include/stop_slave.inc
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
include/start_slave.inc
|
||||
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (t text);
|
||||
CREATE PROCEDURE p(file varchar(4096))
|
||||
BEGIN
|
||||
INSERT INTO t1 VALUES (LOAD_FILE(file));
|
||||
END|
|
||||
include/stop_slave.inc
|
||||
CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
|
||||
include/start_slave.inc
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p;
|
||||
|
|
|
@ -87,9 +87,7 @@ show binary logs;
|
|||
Log_name File_size
|
||||
master-bin.000002 #
|
||||
master-bin.000003 #
|
||||
select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA="test" and TABLE_NAME="t2";
|
||||
SELECT @time_for_purge:=DATE_ADD('tmpval', INTERVAL 1 SECOND);
|
||||
purge master logs before (@time_for_purge);
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
|
|
318
mysql-test/suite/rpl/r/rpl_row_wide_table.result
Normal file
318
mysql-test/suite/rpl/r/rpl_row_wide_table.result
Normal file
|
@ -0,0 +1,318 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP TABLE IF EXISTS t300;
|
||||
create table t300 (
|
||||
f1 int,
|
||||
f2 int,
|
||||
f3 int,
|
||||
f4 int,
|
||||
f5 int,
|
||||
f6 int,
|
||||
f7 int,
|
||||
f8 int,
|
||||
f9 int,
|
||||
f10 int,
|
||||
f11 int,
|
||||
f12 int,
|
||||
f13 int,
|
||||
f14 int,
|
||||
f15 int,
|
||||
f16 int,
|
||||
f17 int,
|
||||
f18 int,
|
||||
f19 int,
|
||||
f20 int,
|
||||
f21 int,
|
||||
f22 int,
|
||||
f23 int,
|
||||
f24 int,
|
||||
f25 int,
|
||||
f26 int,
|
||||
f27 int,
|
||||
f28 int,
|
||||
f29 int,
|
||||
f30 int,
|
||||
f31 int,
|
||||
f32 int,
|
||||
f33 int,
|
||||
f34 int,
|
||||
f35 int,
|
||||
f36 int,
|
||||
f37 int,
|
||||
f38 int,
|
||||
f39 int,
|
||||
f40 int,
|
||||
f41 int,
|
||||
f42 int,
|
||||
f43 int,
|
||||
f44 int,
|
||||
f45 int,
|
||||
f46 int,
|
||||
f47 int,
|
||||
f48 int,
|
||||
f49 int,
|
||||
f50 int,
|
||||
f51 int,
|
||||
f52 int,
|
||||
f53 int,
|
||||
f54 int,
|
||||
f55 int,
|
||||
f56 int,
|
||||
f57 int,
|
||||
f58 int,
|
||||
f59 int,
|
||||
f60 int,
|
||||
f61 int,
|
||||
f62 int,
|
||||
f63 int,
|
||||
f64 int,
|
||||
f65 int,
|
||||
f66 int,
|
||||
f67 int,
|
||||
f68 int,
|
||||
f69 int,
|
||||
f70 int,
|
||||
f71 int,
|
||||
f72 int,
|
||||
f73 int,
|
||||
f74 int,
|
||||
f75 int,
|
||||
f76 int,
|
||||
f77 int,
|
||||
f78 int,
|
||||
f79 int,
|
||||
f80 int,
|
||||
f81 int,
|
||||
f82 int,
|
||||
f83 int,
|
||||
f84 int,
|
||||
f85 int,
|
||||
f86 int,
|
||||
f87 int,
|
||||
f88 int,
|
||||
f89 int,
|
||||
f90 int,
|
||||
f91 int,
|
||||
f92 int,
|
||||
f93 int,
|
||||
f94 int,
|
||||
f95 int,
|
||||
f96 int,
|
||||
f97 int,
|
||||
f98 int,
|
||||
f99 int,
|
||||
f100 int,
|
||||
f101 int,
|
||||
f102 int,
|
||||
f103 int,
|
||||
f104 int,
|
||||
f105 int,
|
||||
f106 int,
|
||||
f107 int,
|
||||
f108 int,
|
||||
f109 int,
|
||||
f110 int,
|
||||
f111 int,
|
||||
f112 int,
|
||||
f113 int,
|
||||
f114 int,
|
||||
f115 int,
|
||||
f116 int,
|
||||
f117 int,
|
||||
f118 int,
|
||||
f119 int,
|
||||
f120 int,
|
||||
f121 int,
|
||||
f122 int,
|
||||
f123 int,
|
||||
f124 int,
|
||||
f125 int,
|
||||
f126 int,
|
||||
f127 int,
|
||||
f128 int,
|
||||
f129 int,
|
||||
f130 int,
|
||||
f131 int,
|
||||
f132 int,
|
||||
f133 int,
|
||||
f134 int,
|
||||
f135 int,
|
||||
f136 int,
|
||||
f137 int,
|
||||
f138 int,
|
||||
f139 int,
|
||||
f140 int,
|
||||
f141 int,
|
||||
f142 int,
|
||||
f143 int,
|
||||
f144 int,
|
||||
f145 int,
|
||||
f146 int,
|
||||
f147 int,
|
||||
f148 int,
|
||||
f149 int,
|
||||
f150 int,
|
||||
f151 int,
|
||||
f152 int,
|
||||
f153 int,
|
||||
f154 int,
|
||||
f155 int,
|
||||
f156 int,
|
||||
f157 int,
|
||||
f158 int,
|
||||
f159 int,
|
||||
f160 int,
|
||||
f161 int,
|
||||
f162 int,
|
||||
f163 int,
|
||||
f164 int,
|
||||
f165 int,
|
||||
f166 int,
|
||||
f167 int,
|
||||
f168 int,
|
||||
f169 int,
|
||||
f170 int,
|
||||
f171 int,
|
||||
f172 int,
|
||||
f173 int,
|
||||
f174 int,
|
||||
f175 int,
|
||||
f176 int,
|
||||
f177 int,
|
||||
f178 int,
|
||||
f179 int,
|
||||
f180 int,
|
||||
f181 int,
|
||||
f182 int,
|
||||
f183 int,
|
||||
f184 int,
|
||||
f185 int,
|
||||
f186 int,
|
||||
f187 int,
|
||||
f188 int,
|
||||
f189 int,
|
||||
f190 int,
|
||||
f191 int,
|
||||
f192 int,
|
||||
f193 int,
|
||||
f194 int,
|
||||
f195 int,
|
||||
f196 int,
|
||||
f197 int,
|
||||
f198 int,
|
||||
f199 int,
|
||||
f200 int,
|
||||
f201 int,
|
||||
f202 int,
|
||||
f203 int,
|
||||
f204 int,
|
||||
f205 int,
|
||||
f206 int,
|
||||
f207 int,
|
||||
f208 int,
|
||||
f209 int,
|
||||
f210 int,
|
||||
f211 int,
|
||||
f212 int,
|
||||
f213 int,
|
||||
f214 int,
|
||||
f215 int,
|
||||
f216 int,
|
||||
f217 int,
|
||||
f218 int,
|
||||
f219 int,
|
||||
f220 int,
|
||||
f221 int,
|
||||
f222 int,
|
||||
f223 int,
|
||||
f224 int,
|
||||
f225 int,
|
||||
f226 int,
|
||||
f227 int,
|
||||
f228 int,
|
||||
f229 int,
|
||||
f230 int,
|
||||
f231 int,
|
||||
f232 int,
|
||||
f233 int,
|
||||
f234 int,
|
||||
f235 int,
|
||||
f236 int,
|
||||
f237 int,
|
||||
f238 int,
|
||||
f239 int,
|
||||
f240 int,
|
||||
f241 int,
|
||||
f242 int,
|
||||
f243 int,
|
||||
f244 int,
|
||||
f245 int,
|
||||
f246 int,
|
||||
f247 int,
|
||||
f248 int,
|
||||
f249 int,
|
||||
f250 int,
|
||||
f251 int,
|
||||
f252 int,
|
||||
f253 int,
|
||||
f254 int,
|
||||
f255 int,
|
||||
f256 int,
|
||||
f257 int,
|
||||
f258 int,
|
||||
f259 int,
|
||||
f260 int,
|
||||
f261 int,
|
||||
f262 int,
|
||||
f263 int,
|
||||
f264 int,
|
||||
f265 int,
|
||||
f266 int,
|
||||
f267 int,
|
||||
f268 int,
|
||||
f269 int,
|
||||
f270 int,
|
||||
f271 int,
|
||||
f272 int,
|
||||
f273 int,
|
||||
f274 int,
|
||||
f275 int,
|
||||
f276 int,
|
||||
f277 int,
|
||||
f278 int,
|
||||
f279 int,
|
||||
f280 int,
|
||||
f281 int,
|
||||
f282 int,
|
||||
f283 int,
|
||||
f284 int,
|
||||
f285 int,
|
||||
f286 int,
|
||||
f287 int,
|
||||
f288 int,
|
||||
f289 int,
|
||||
f290 int,
|
||||
f291 int,
|
||||
f292 int,
|
||||
f293 int,
|
||||
f294 int,
|
||||
f295 int,
|
||||
f296 int,
|
||||
f297 int,
|
||||
f298 int,
|
||||
f299 int,
|
||||
f300 int,
|
||||
primary key (f1));
|
||||
insert into t300 set f1= 1;
|
||||
select f300 from t300;
|
||||
f300
|
||||
NULL
|
||||
select count(*) as one from t300;
|
||||
one
|
||||
1
|
||||
*** Cleanup ***
|
||||
DROP TABLE t300;
|
|
@ -5,6 +5,15 @@ reset slave;
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1(a int not null auto_increment, b int, primary key(a));
|
||||
create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
start transaction;
|
||||
insert into t2(b) values (1);
|
||||
insert into t2(b) values (2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
|
||||
commit;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
Comparing tables master:test.t2 and slave:test.t2
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
|
53
mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
Normal file
53
mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
Normal file
|
@ -0,0 +1,53 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
|
||||
start transaction;
|
||||
insert into t1(b) values (1);
|
||||
insert into t1(b) values (2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
commit;
|
||||
show slave status;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_MYPORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 9
|
||||
Last_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno #
|
||||
Last_IO_Error #
|
||||
Last_SQL_Errno 9
|
||||
Last_SQL_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
|
||||
drop table t1;
|
||||
drop table t1;
|
|
@ -0,0 +1,6 @@
|
|||
CHANGE MASTER TO MASTER_USER='root',
|
||||
MASTER_CONNECT_RETRY=1,
|
||||
MASTER_HOST='127.0.0.1',
|
||||
MASTER_PORT=MASTER_MYPORT;
|
||||
START SLAVE;
|
||||
Unable to use slave's temporary directory ../../../error - Can't read dir of '../../../error' (Errcode: 2)
|
231
mysql-test/suite/rpl/r/rpl_stm_loadfile.result
Normal file
231
mysql-test/suite/rpl/r/rpl_stm_loadfile.result
Normal file
|
@ -0,0 +1,231 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
|
||||
INSERT INTO test.t1 VALUES(1,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
create procedure test.p1()
|
||||
begin
|
||||
INSERT INTO test.t1 VALUES(2,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
|
||||
end|
|
||||
CALL test.p1();
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
a blob_column
|
||||
1 abase
|
||||
abased
|
||||
abasement
|
||||
abasements
|
||||
abases
|
||||
abash
|
||||
abashed
|
||||
abashes
|
||||
abashing
|
||||
abasing
|
||||
abate
|
||||
abated
|
||||
abatement
|
||||
abatements
|
||||
abater
|
||||
abates
|
||||
abating
|
||||
Abba
|
||||
abbe
|
||||
abbey
|
||||
abbeys
|
||||
abbot
|
||||
abbots
|
||||
Abbott
|
||||
abbreviate
|
||||
abbreviated
|
||||
abbreviates
|
||||
abbreviating
|
||||
abbreviation
|
||||
abbreviations
|
||||
Abby
|
||||
abdomen
|
||||
abdomens
|
||||
abdominal
|
||||
abduct
|
||||
abducted
|
||||
abduction
|
||||
abductions
|
||||
abductor
|
||||
abductors
|
||||
abducts
|
||||
Abe
|
||||
abed
|
||||
Abel
|
||||
Abelian
|
||||
Abelson
|
||||
Aberdeen
|
||||
Abernathy
|
||||
aberrant
|
||||
aberration
|
||||
|
||||
2 abase
|
||||
abased
|
||||
abasement
|
||||
abasements
|
||||
abases
|
||||
abash
|
||||
abashed
|
||||
abashes
|
||||
abashing
|
||||
abasing
|
||||
abate
|
||||
abated
|
||||
abatement
|
||||
abatements
|
||||
abater
|
||||
abates
|
||||
abating
|
||||
Abba
|
||||
abbe
|
||||
abbey
|
||||
abbeys
|
||||
abbot
|
||||
abbots
|
||||
Abbott
|
||||
abbreviate
|
||||
abbreviated
|
||||
abbreviates
|
||||
abbreviating
|
||||
abbreviation
|
||||
abbreviations
|
||||
Abby
|
||||
abdomen
|
||||
abdomens
|
||||
abdominal
|
||||
abduct
|
||||
abducted
|
||||
abduction
|
||||
abductions
|
||||
abductor
|
||||
abductors
|
||||
abducts
|
||||
Abe
|
||||
abed
|
||||
Abel
|
||||
Abelian
|
||||
Abelson
|
||||
Aberdeen
|
||||
Abernathy
|
||||
aberrant
|
||||
aberration
|
||||
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
a blob_column
|
||||
1 abase
|
||||
abased
|
||||
abasement
|
||||
abasements
|
||||
abases
|
||||
abash
|
||||
abashed
|
||||
abashes
|
||||
abashing
|
||||
abasing
|
||||
abate
|
||||
abated
|
||||
abatement
|
||||
abatements
|
||||
abater
|
||||
abates
|
||||
abating
|
||||
Abba
|
||||
abbe
|
||||
abbey
|
||||
abbeys
|
||||
abbot
|
||||
abbots
|
||||
Abbott
|
||||
abbreviate
|
||||
abbreviated
|
||||
abbreviates
|
||||
abbreviating
|
||||
abbreviation
|
||||
abbreviations
|
||||
Abby
|
||||
abdomen
|
||||
abdomens
|
||||
abdominal
|
||||
abduct
|
||||
abducted
|
||||
abduction
|
||||
abductions
|
||||
abductor
|
||||
abductors
|
||||
abducts
|
||||
Abe
|
||||
abed
|
||||
Abel
|
||||
Abelian
|
||||
Abelson
|
||||
Aberdeen
|
||||
Abernathy
|
||||
aberrant
|
||||
aberration
|
||||
|
||||
2 abase
|
||||
abased
|
||||
abasement
|
||||
abasements
|
||||
abases
|
||||
abash
|
||||
abashed
|
||||
abashes
|
||||
abashing
|
||||
abasing
|
||||
abate
|
||||
abated
|
||||
abatement
|
||||
abatements
|
||||
abater
|
||||
abates
|
||||
abating
|
||||
Abba
|
||||
abbe
|
||||
abbey
|
||||
abbeys
|
||||
abbot
|
||||
abbots
|
||||
Abbott
|
||||
abbreviate
|
||||
abbreviated
|
||||
abbreviates
|
||||
abbreviating
|
||||
abbreviation
|
||||
abbreviations
|
||||
Abby
|
||||
abdomen
|
||||
abdomens
|
||||
abdominal
|
||||
abduct
|
||||
abducted
|
||||
abduction
|
||||
abductions
|
||||
abductor
|
||||
abductors
|
||||
abducts
|
||||
Abe
|
||||
abed
|
||||
Abel
|
||||
Abelian
|
||||
Abelson
|
||||
Aberdeen
|
||||
Abernathy
|
||||
aberrant
|
||||
aberration
|
||||
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE test.t1;
|
|
@ -218,7 +218,7 @@ slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
|
|||
slave-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
|
||||
slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
|
||||
slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
|
||||
slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
|
||||
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
|
||||
show binlog events in 'slave-bin.000002' from 4;
|
||||
|
|
|
@ -108,3 +108,16 @@ select * from t1;
|
|||
a
|
||||
1
|
||||
drop table t1;
|
||||
-- Bug#43748
|
||||
-- make a user on the slave that can list but not kill system threads.
|
||||
FLUSH PRIVILEGES;
|
||||
GRANT USAGE ON *.* TO user43748@127.0.0.1 IDENTIFIED BY 'meow';
|
||||
GRANT PROCESS ON *.* TO user43748@127.0.0.1;
|
||||
-- try to KILL system-thread as that non-privileged user (on slave).
|
||||
SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
|
||||
KILL @id;
|
||||
Got one of the listed errors
|
||||
-- throw out test-user on slave.
|
||||
DROP USER user43748@127.0.0.1;
|
||||
-- done. back to master.
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -122,4 +122,23 @@ a b
|
|||
SET @@session.time_zone = default;
|
||||
DROP TABLE t1;
|
||||
SET @@session.time_zone = default;
|
||||
reset master;
|
||||
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
|
||||
SET @@session.time_zone='+01:00';
|
||||
insert into t1 values('2008-12-23 19:39:39',1);
|
||||
SET @@session.time_zone='+02:00';
|
||||
insert delayed into t1 values ('2008-12-23 19:39:39',2);
|
||||
flush table t1;
|
||||
flush logs;
|
||||
select * from t1;
|
||||
date a
|
||||
2008-12-23 20:39:39 1
|
||||
2008-12-23 19:39:39 2
|
||||
DROP TABLE t1;
|
||||
select * from t1 order by a;
|
||||
date a
|
||||
2008-12-23 20:39:39 1
|
||||
2008-12-23 19:39:39 2
|
||||
DROP TABLE t1;
|
||||
SET @@session.time_zone = default;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -11,3 +11,5 @@
|
|||
##############################################################################
|
||||
|
||||
rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
|
||||
rpl_temp_table_mix_row : BUG#43440 2009-03-23 joro rpl.rpl_temp_table_mix_row fails sporadicly
|
||||
rpl_cross_version : BUG#42311 2009-03-27 joro rpl_cross_version fails on macosx
|
||||
|
|
|
@ -112,3 +112,100 @@ show grants for rpl_do_grant2@localhost;
|
|||
sync_slave_with_master;
|
||||
--error 1141
|
||||
show grants for rpl_do_grant2@localhost;
|
||||
|
||||
#####################################################
|
||||
# Purpose
|
||||
# Test whether mysql.procs_priv get replicated
|
||||
# Related bugs:
|
||||
# BUG42217 mysql.procs_priv does not get replicated
|
||||
#####################################################
|
||||
connection master;
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS bug42217_db;
|
||||
--enable_warnings
|
||||
CREATE DATABASE bug42217_db;
|
||||
|
||||
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
|
||||
IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
|
||||
|
||||
connect (create_rout_db_master, localhost, create_rout_db, create_rout_db, bug42217_db,$MASTER_MYPORT,);
|
||||
connect (create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,);
|
||||
|
||||
connection create_rout_db_master;
|
||||
|
||||
|
||||
USE bug42217_db;
|
||||
|
||||
DELIMITER //;
|
||||
CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_del_func()";
|
||||
END//
|
||||
|
||||
DELIMITER ;//
|
||||
|
||||
connection master;
|
||||
|
||||
USE bug42217_db;
|
||||
--replace_column 8 #
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
SELECT upgrade_del_func();
|
||||
|
||||
sync_slave_with_master;
|
||||
--replace_column 8 #
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
SHOW GRANTS FOR 'create_rout_db'@'localhost';
|
||||
|
||||
USE bug42217_db;
|
||||
SHOW CREATE FUNCTION upgrade_del_func;
|
||||
SELECT upgrade_del_func();
|
||||
|
||||
--echo "Check whether the definer user will be able to execute the replicated routine on slave"
|
||||
connection create_rout_db_slave;
|
||||
USE bug42217_db;
|
||||
SHOW CREATE FUNCTION upgrade_del_func;
|
||||
SELECT upgrade_del_func();
|
||||
|
||||
connection slave;
|
||||
DELETE FROM mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
USE bug42217_db;
|
||||
--echo "Can't execute the replicated routine on slave like before after procs privilege is deleted "
|
||||
--error 1370
|
||||
SELECT upgrade_del_func();
|
||||
|
||||
--echo "Test the user who creates a function on master doesn't exist on slave."
|
||||
--echo "Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
|
||||
DROP USER 'create_rout_db'@'localhost';
|
||||
|
||||
connection create_rout_db_master;
|
||||
DELIMITER //;
|
||||
CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
|
||||
BEGIN
|
||||
RETURN "INSIDE upgrade_alter_func()";
|
||||
END//
|
||||
DELIMITER ;//
|
||||
|
||||
connection master;
|
||||
SELECT upgrade_alter_func();
|
||||
|
||||
sync_slave_with_master;
|
||||
SHOW CREATE FUNCTION upgrade_alter_func;
|
||||
--echo "Should no privilege record for upgrade_alter_func in mysql.procs_priv"
|
||||
--replace_column 8 #
|
||||
SELECT * FROM mysql.procs_priv;
|
||||
--error 1449
|
||||
SELECT upgrade_alter_func();
|
||||
|
||||
###### CLEAN UP SECTION ##############
|
||||
disconnect create_rout_db_master;
|
||||
disconnect create_rout_db_slave;
|
||||
connection master;
|
||||
USE bug42217_db;
|
||||
DROP FUNCTION upgrade_del_func;
|
||||
DROP FUNCTION upgrade_alter_func;
|
||||
DROP DATABASE bug42217_db;
|
||||
DROP USER 'create_rout_db'@'localhost';
|
||||
|
||||
--echo "End of test"
|
||||
|
|
|
@ -64,3 +64,37 @@ drop table t1;
|
|||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
|
||||
#
|
||||
# Bug22504 load data infile sql statement in replication architecture get error
|
||||
#
|
||||
--echo ==== Bug22504 Initialize ====
|
||||
|
||||
--echo [on master]
|
||||
--connection master
|
||||
|
||||
SET sql_mode='ignore_space';
|
||||
CREATE TABLE t1(a int);
|
||||
insert into t1 values (1), (2), (3), (4);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
truncate table t1;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
--echo ==== Clean up ====
|
||||
|
||||
--echo [on master]
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
|
|
|
@ -11,43 +11,105 @@
|
|||
|
||||
# Includes
|
||||
-- source include/master-slave.inc
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
|
||||
-- source extra/rpl_tests/rpl_loadfile.test
|
||||
|
||||
# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Problem: when using load_file string function and mixed binlogging format
|
||||
# there was no switch to row based binlogging format. This leads
|
||||
# to scenarios on which the slave replicates the statement and it
|
||||
# will try to load the file from local file system, which in most
|
||||
# likely it will not exist.
|
||||
#
|
||||
# Solution:
|
||||
# Marking this function as unsafe for statement format, makes the
|
||||
# statement using it to be logged in row based format. As such, data
|
||||
# replicated from the master, becomes the content of the loaded file.
|
||||
# Consequently, the slave receives the necessary data to complete
|
||||
# the load_file instruction correctly.
|
||||
#
|
||||
# IMPLEMENTATION
|
||||
#
|
||||
# The test is implemented as follows:
|
||||
#
|
||||
# On Master,
|
||||
# i) write to file the desired content.
|
||||
# ii) create table and stored procedure with load_file
|
||||
# iii) stop slave
|
||||
# iii) execute load_file
|
||||
# iv) remove file
|
||||
#
|
||||
# On Slave,
|
||||
# v) start slave
|
||||
# vi) sync it with master so that it gets the updates from binlog (which
|
||||
# should have bin logged in row format).
|
||||
#
|
||||
# If the the binlog format does not change to row, then the assertion
|
||||
# done in the following step fails. This happens because tables differ
|
||||
# since the file does not exist anymore, meaning that when slave
|
||||
# attempts to execute LOAD_FILE statement it inserts NULL on table
|
||||
# instead of the same contents that the master loaded when it executed
|
||||
# the procedure (which was executed when file existed).
|
||||
#
|
||||
# vii) assert that the contents of master and slave
|
||||
# table are the same
|
||||
|
||||
# Begin clean up test section
|
||||
--disable_warnings
|
||||
connection master;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
--enable_warnings
|
||||
source include/reset_master_and_slave.inc;
|
||||
|
||||
# Section 1 test
|
||||
connection master;
|
||||
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
|
||||
|
||||
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
|
||||
INSERT INTO test.t1 VALUES(1,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
|
||||
delimiter |;
|
||||
create procedure test.p1()
|
||||
begin
|
||||
INSERT INTO test.t1 VALUES(2,'test');
|
||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
|
||||
end|
|
||||
delimiter ;|
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT repeat('x',20) INTO OUTFILE '$file'
|
||||
|
||||
CALL test.p1();
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
save_master_pos;
|
||||
sync_slave_with_master;
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
enable_warnings;
|
||||
|
||||
CREATE TABLE t1 (t text);
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p(file varchar(4096))
|
||||
BEGIN
|
||||
INSERT INTO t1 VALUES (LOAD_FILE(file));
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
# stop slave before issuing the load_file on master
|
||||
connection slave;
|
||||
# Need to allow some time when NDB engine is used for
|
||||
# the injector thread to have time to populate binlog
|
||||
let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
# test: check that logging falls back to rbr.
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval CALL p('$file')
|
||||
|
||||
# test: remove the file from the filesystem and assert that slave still
|
||||
# gets the loaded file
|
||||
remove_file $file;
|
||||
|
||||
# now that the file is removed it is safe (regarding what we want to test)
|
||||
# to start slave
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
|
||||
# Cleanup
|
||||
connection master;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP TABLE test.t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
# End of 5.0 test case
|
||||
# assertion: assert that the slave got the updates even
|
||||
# if the file was removed before the slave started,
|
||||
# meaning that contents were indeed transfered
|
||||
# through binlog (in row format)
|
||||
let $diff_table_1=master:test.t1;
|
||||
let $diff_table_2=slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# CLEAN UP
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p;
|
||||
sync_slave_with_master;
|
||||
|
|
|
@ -112,14 +112,24 @@ source include/show_master_logs.inc;
|
|||
purge binary logs to 'master-bin.000002';
|
||||
source include/show_binary_logs.inc;
|
||||
|
||||
# Calculate time to use in "purge master logs before" by taking
|
||||
# last modification time of t2 and adding 1 second
|
||||
# This is donw in order to handle the case where file system
|
||||
# time differs from mysqld's time
|
||||
# Set the purge time 1 second after the last modify time of master-bin.000002.
|
||||
perl;
|
||||
open F, ">>".$ENV{'MYSQLTEST_VARDIR'}.'/tmp/rpl_rotate_logs.tmp' or die "Tmp file rpl_rotate_logs.tmp not found";
|
||||
my $binlogpath = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.1/data/master-bin.000002';
|
||||
my @array = stat($binlogpath);
|
||||
my $filemodifytime = $array[9];
|
||||
my @t = localtime $filemodifytime;
|
||||
my $modifytime = sprintf "%04u-%02u-%02u %02u:%02u:%02u",$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0];
|
||||
printf F ("let \$tmpval = %s;",$modifytime);
|
||||
close F;
|
||||
EOF
|
||||
|
||||
--source $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp;
|
||||
|
||||
--disable_result_log
|
||||
select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA="test" and TABLE_NAME="t2";
|
||||
--replace_result $tmpval tmpval
|
||||
--eval SELECT @time_for_purge:=DATE_ADD('$tmpval', INTERVAL 1 SECOND)
|
||||
--enable_result_log
|
||||
|
||||
purge master logs before (@time_for_purge);
|
||||
|
|
339
mysql-test/suite/rpl/t/rpl_row_wide_table.test
Normal file
339
mysql-test/suite/rpl/t/rpl_row_wide_table.test
Normal file
|
@ -0,0 +1,339 @@
|
|||
##################################################################
|
||||
# rpl_row_wide_table
|
||||
#
|
||||
# This test verifies that the table with number of attributes more
|
||||
# than 250 is replicated.
|
||||
# Related bugs:
|
||||
# Bug #42977 RBR logs for rows with more than 250 column results
|
||||
# in corrupt binlog
|
||||
##################################################################
|
||||
|
||||
-- source include/master-slave.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t300;
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
|
||||
create table t300 (
|
||||
f1 int,
|
||||
f2 int,
|
||||
f3 int,
|
||||
f4 int,
|
||||
f5 int,
|
||||
f6 int,
|
||||
f7 int,
|
||||
f8 int,
|
||||
f9 int,
|
||||
f10 int,
|
||||
f11 int,
|
||||
f12 int,
|
||||
f13 int,
|
||||
f14 int,
|
||||
f15 int,
|
||||
f16 int,
|
||||
f17 int,
|
||||
f18 int,
|
||||
f19 int,
|
||||
f20 int,
|
||||
f21 int,
|
||||
f22 int,
|
||||
f23 int,
|
||||
f24 int,
|
||||
f25 int,
|
||||
f26 int,
|
||||
f27 int,
|
||||
f28 int,
|
||||
f29 int,
|
||||
f30 int,
|
||||
f31 int,
|
||||
f32 int,
|
||||
f33 int,
|
||||
f34 int,
|
||||
f35 int,
|
||||
f36 int,
|
||||
f37 int,
|
||||
f38 int,
|
||||
f39 int,
|
||||
f40 int,
|
||||
f41 int,
|
||||
f42 int,
|
||||
f43 int,
|
||||
f44 int,
|
||||
f45 int,
|
||||
f46 int,
|
||||
f47 int,
|
||||
f48 int,
|
||||
f49 int,
|
||||
f50 int,
|
||||
f51 int,
|
||||
f52 int,
|
||||
f53 int,
|
||||
f54 int,
|
||||
f55 int,
|
||||
f56 int,
|
||||
f57 int,
|
||||
f58 int,
|
||||
f59 int,
|
||||
f60 int,
|
||||
f61 int,
|
||||
f62 int,
|
||||
f63 int,
|
||||
f64 int,
|
||||
f65 int,
|
||||
f66 int,
|
||||
f67 int,
|
||||
f68 int,
|
||||
f69 int,
|
||||
f70 int,
|
||||
f71 int,
|
||||
f72 int,
|
||||
f73 int,
|
||||
f74 int,
|
||||
f75 int,
|
||||
f76 int,
|
||||
f77 int,
|
||||
f78 int,
|
||||
f79 int,
|
||||
f80 int,
|
||||
f81 int,
|
||||
f82 int,
|
||||
f83 int,
|
||||
f84 int,
|
||||
f85 int,
|
||||
f86 int,
|
||||
f87 int,
|
||||
f88 int,
|
||||
f89 int,
|
||||
f90 int,
|
||||
f91 int,
|
||||
f92 int,
|
||||
f93 int,
|
||||
f94 int,
|
||||
f95 int,
|
||||
f96 int,
|
||||
f97 int,
|
||||
f98 int,
|
||||
f99 int,
|
||||
f100 int,
|
||||
f101 int,
|
||||
f102 int,
|
||||
f103 int,
|
||||
f104 int,
|
||||
f105 int,
|
||||
f106 int,
|
||||
f107 int,
|
||||
f108 int,
|
||||
f109 int,
|
||||
f110 int,
|
||||
f111 int,
|
||||
f112 int,
|
||||
f113 int,
|
||||
f114 int,
|
||||
f115 int,
|
||||
f116 int,
|
||||
f117 int,
|
||||
f118 int,
|
||||
f119 int,
|
||||
f120 int,
|
||||
f121 int,
|
||||
f122 int,
|
||||
f123 int,
|
||||
f124 int,
|
||||
f125 int,
|
||||
f126 int,
|
||||
f127 int,
|
||||
f128 int,
|
||||
f129 int,
|
||||
f130 int,
|
||||
f131 int,
|
||||
f132 int,
|
||||
f133 int,
|
||||
f134 int,
|
||||
f135 int,
|
||||
f136 int,
|
||||
f137 int,
|
||||
f138 int,
|
||||
f139 int,
|
||||
f140 int,
|
||||
f141 int,
|
||||
f142 int,
|
||||
f143 int,
|
||||
f144 int,
|
||||
f145 int,
|
||||
f146 int,
|
||||
f147 int,
|
||||
f148 int,
|
||||
f149 int,
|
||||
f150 int,
|
||||
f151 int,
|
||||
f152 int,
|
||||
f153 int,
|
||||
f154 int,
|
||||
f155 int,
|
||||
f156 int,
|
||||
f157 int,
|
||||
f158 int,
|
||||
f159 int,
|
||||
f160 int,
|
||||
f161 int,
|
||||
f162 int,
|
||||
f163 int,
|
||||
f164 int,
|
||||
f165 int,
|
||||
f166 int,
|
||||
f167 int,
|
||||
f168 int,
|
||||
f169 int,
|
||||
f170 int,
|
||||
f171 int,
|
||||
f172 int,
|
||||
f173 int,
|
||||
f174 int,
|
||||
f175 int,
|
||||
f176 int,
|
||||
f177 int,
|
||||
f178 int,
|
||||
f179 int,
|
||||
f180 int,
|
||||
f181 int,
|
||||
f182 int,
|
||||
f183 int,
|
||||
f184 int,
|
||||
f185 int,
|
||||
f186 int,
|
||||
f187 int,
|
||||
f188 int,
|
||||
f189 int,
|
||||
f190 int,
|
||||
f191 int,
|
||||
f192 int,
|
||||
f193 int,
|
||||
f194 int,
|
||||
f195 int,
|
||||
f196 int,
|
||||
f197 int,
|
||||
f198 int,
|
||||
f199 int,
|
||||
f200 int,
|
||||
f201 int,
|
||||
f202 int,
|
||||
f203 int,
|
||||
f204 int,
|
||||
f205 int,
|
||||
f206 int,
|
||||
f207 int,
|
||||
f208 int,
|
||||
f209 int,
|
||||
f210 int,
|
||||
f211 int,
|
||||
f212 int,
|
||||
f213 int,
|
||||
f214 int,
|
||||
f215 int,
|
||||
f216 int,
|
||||
f217 int,
|
||||
f218 int,
|
||||
f219 int,
|
||||
f220 int,
|
||||
f221 int,
|
||||
f222 int,
|
||||
f223 int,
|
||||
f224 int,
|
||||
f225 int,
|
||||
f226 int,
|
||||
f227 int,
|
||||
f228 int,
|
||||
f229 int,
|
||||
f230 int,
|
||||
f231 int,
|
||||
f232 int,
|
||||
f233 int,
|
||||
f234 int,
|
||||
f235 int,
|
||||
f236 int,
|
||||
f237 int,
|
||||
f238 int,
|
||||
f239 int,
|
||||
f240 int,
|
||||
f241 int,
|
||||
f242 int,
|
||||
f243 int,
|
||||
f244 int,
|
||||
f245 int,
|
||||
f246 int,
|
||||
f247 int,
|
||||
f248 int,
|
||||
f249 int,
|
||||
f250 int,
|
||||
f251 int,
|
||||
f252 int,
|
||||
f253 int,
|
||||
f254 int,
|
||||
f255 int,
|
||||
f256 int,
|
||||
f257 int,
|
||||
f258 int,
|
||||
f259 int,
|
||||
f260 int,
|
||||
f261 int,
|
||||
f262 int,
|
||||
f263 int,
|
||||
f264 int,
|
||||
f265 int,
|
||||
f266 int,
|
||||
f267 int,
|
||||
f268 int,
|
||||
f269 int,
|
||||
f270 int,
|
||||
f271 int,
|
||||
f272 int,
|
||||
f273 int,
|
||||
f274 int,
|
||||
f275 int,
|
||||
f276 int,
|
||||
f277 int,
|
||||
f278 int,
|
||||
f279 int,
|
||||
f280 int,
|
||||
f281 int,
|
||||
f282 int,
|
||||
f283 int,
|
||||
f284 int,
|
||||
f285 int,
|
||||
f286 int,
|
||||
f287 int,
|
||||
f288 int,
|
||||
f289 int,
|
||||
f290 int,
|
||||
f291 int,
|
||||
f292 int,
|
||||
f293 int,
|
||||
f294 int,
|
||||
f295 int,
|
||||
f296 int,
|
||||
f297 int,
|
||||
f298 int,
|
||||
f299 int,
|
||||
f300 int,
|
||||
primary key (f1));
|
||||
|
||||
insert into t300 set f1= 1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# prove that slave processed the create as well as the insert
|
||||
#
|
||||
eval select f300 from t300;
|
||||
select count(*) as one from t300;
|
||||
|
||||
--echo *** Cleanup ***
|
||||
connection master;
|
||||
DROP TABLE t300;
|
||||
sync_slave_with_master;
|
||||
|
||||
# END of Test Case
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
# event while the "--secure-file-priv" option is set.
|
||||
#
|
||||
# The test is divided in two steps:
|
||||
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
|
||||
# 1 - Creates tables and populates them through "LOAD DATA INFILE".
|
||||
# 2 - Compares the master and slave.
|
||||
##########################################################################
|
||||
source include/master-slave.inc;
|
||||
--source include/have_innodb.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
##########################################################################
|
||||
# Loading data
|
||||
|
@ -14,8 +15,17 @@ source include/master-slave.inc;
|
|||
connection master;
|
||||
|
||||
create table t1(a int not null auto_increment, b int, primary key(a));
|
||||
create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
|
||||
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
|
||||
start transaction;
|
||||
insert into t2(b) values (1);
|
||||
insert into t2(b) values (2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
|
||||
commit;
|
||||
|
||||
##########################################################################
|
||||
# Checking Consistency
|
||||
##########################################################################
|
||||
|
@ -25,11 +35,16 @@ let $diff_table_1=master:test.t1;
|
|||
let $diff_table_2=slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
let $diff_table_1=master:test.t2;
|
||||
let $diff_table_2=slave:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
##########################################################################
|
||||
# Clean up
|
||||
##########################################################################
|
||||
connection master;
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
--loose-debug=d,remove_slave_load_file_before_write
|
49
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
Normal file
49
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
Normal file
|
@ -0,0 +1,49 @@
|
|||
##########################################################################
|
||||
# This test verifies if the slave fails gracefully when the temporary
|
||||
# file used to load data is removed while it is about to be used it.
|
||||
# Similar errors are caught if the temporary directory is removed.
|
||||
#
|
||||
# Steps:
|
||||
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
|
||||
# 2 - Catches error.
|
||||
##########################################################################
|
||||
--source include/have_binlog_format_mixed_or_statement.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
##########################################################################
|
||||
# Loading data
|
||||
##########################################################################
|
||||
connection master;
|
||||
|
||||
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
|
||||
|
||||
start transaction;
|
||||
insert into t1(b) values (1);
|
||||
insert into t1(b) values (2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
commit;
|
||||
|
||||
##########################################################################
|
||||
# Catch Error
|
||||
##########################################################################
|
||||
connection slave;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/
|
||||
query_vertical show slave status;
|
||||
|
||||
##########################################################################
|
||||
# Clean up
|
||||
##########################################################################
|
||||
connection master;
|
||||
|
||||
drop table t1;
|
||||
|
||||
connection slave;
|
||||
|
||||
drop table t1;
|
|
@ -0,0 +1 @@
|
|||
--slave-load-tmpdir=../../../error
|
24
mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
Normal file
24
mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
Normal file
|
@ -0,0 +1,24 @@
|
|||
##########################################################################
|
||||
# This test verifies if the start slave fails gracefuly when an
|
||||
# invalid directory is used to set --slave-load-tmpdir.
|
||||
##########################################################################
|
||||
--source include/have_log_bin.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
connection slave;
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
eval CHANGE MASTER TO MASTER_USER='root',
|
||||
MASTER_CONNECT_RETRY=1,
|
||||
MASTER_HOST='127.0.0.1',
|
||||
MASTER_PORT=$MASTER_MYPORT;
|
||||
START SLAVE;
|
||||
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
let $error=query_get_value("show slave status", Last_SQL_Error, 1);
|
||||
echo $error;
|
20
mysql-test/suite/rpl/t/rpl_stm_loadfile.test
Normal file
20
mysql-test/suite/rpl/t/rpl_stm_loadfile.test
Normal file
|
@ -0,0 +1,20 @@
|
|||
#############################################################################
|
||||
# Original Author: JBM #
|
||||
# Original Date: Aug/18/2005 #
|
||||
#############################################################################
|
||||
# TEST: To test the LOAD_FILE() in rbr #
|
||||
#############################################################################
|
||||
# Change Author: JBM
|
||||
# Change Date: 2006-01-16
|
||||
# Change: Added Order by for NDB
|
||||
# Change: Split the original test file. This one forces STATEMENT only because
|
||||
# when in STATEMENT mode, the load_file will issue a warning, whereas
|
||||
# in RBR or MIXED mode it does not (by lsoares).
|
||||
##########
|
||||
|
||||
# Includes
|
||||
-- source include/master-slave.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
|
||||
-- source extra/rpl_tests/rpl_loadfile.test
|
||||
|
|
@ -222,4 +222,40 @@ drop table t1;
|
|||
# Delete the anonymous users
|
||||
source include/delete_anonymous_users.inc;
|
||||
|
||||
# End of tests
|
||||
|
||||
|
||||
#
|
||||
# Bug#43748: crash when non-super user tries to kill the replication threads
|
||||
#
|
||||
|
||||
--echo -- Bug#43748
|
||||
|
||||
--echo -- make a user on the slave that can list but not kill system threads.
|
||||
connection slave;
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
GRANT USAGE ON *.* TO user43748@127.0.0.1 IDENTIFIED BY 'meow';
|
||||
GRANT PROCESS ON *.* TO user43748@127.0.0.1;
|
||||
|
||||
--echo -- try to KILL system-thread as that non-privileged user (on slave).
|
||||
connect (cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,);
|
||||
connection cont43748;
|
||||
|
||||
SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
|
||||
|
||||
--error ER_KILL_DENIED_ERROR,ER_NO_SUCH_THREAD
|
||||
KILL @id;
|
||||
|
||||
disconnect cont43748;
|
||||
|
||||
--echo -- throw out test-user on slave.
|
||||
connection slave;
|
||||
|
||||
DROP USER user43748@127.0.0.1;
|
||||
|
||||
--echo -- done. back to master.
|
||||
connection master;
|
||||
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
@ -165,5 +165,32 @@ connection master;
|
|||
DROP TABLE t1;
|
||||
SET @@session.time_zone = default;
|
||||
|
||||
# Bug#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging
|
||||
# To test that time_zone is correctly binloging for 'insert delayed' statement
|
||||
# Insert 2 values into timestamp col with different time_zone. Check result.
|
||||
|
||||
--connection master
|
||||
reset master;
|
||||
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
|
||||
|
||||
SET @@session.time_zone='+01:00';
|
||||
insert into t1 values('2008-12-23 19:39:39',1);
|
||||
|
||||
--connection master1
|
||||
SET @@session.time_zone='+02:00';
|
||||
insert delayed into t1 values ('2008-12-23 19:39:39',2);
|
||||
# Forces table t1 to be closed and flushes the query cache.
|
||||
# This makes sure that 'delayed insert' is executed before next statement.
|
||||
flush table t1;
|
||||
flush logs;
|
||||
select * from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir;`;
|
||||
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL
|
||||
--connection master1
|
||||
select * from t1 order by a;
|
||||
DROP TABLE t1;
|
||||
SET @@session.time_zone = default;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
@ -25,8 +25,9 @@ hex(c2) hex(c3) c1
|
|||
0 1 BCDEF
|
||||
1 0 CD
|
||||
0 0 DEFGHIJKL
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
UPDATE t1 SET c2=0 WHERE c3="row2";
|
||||
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
# #
|
||||
###############################################################################
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/load_sysvars.inc
|
||||
|
||||
###################################################################
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
# #
|
||||
###############################################################################
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/load_sysvars.inc
|
||||
|
||||
##################################################################
|
||||
|
|
|
@ -44,7 +44,7 @@ SET @@global.binlog_cache_size = 10000.01;
|
|||
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
|
||||
SET @@global.binlog_cache_size = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
|
||||
Warning 1292 Truncated incorrect binlog_cache_size value: '-1024'
|
||||
SELECT @@global.binlog_cache_size;
|
||||
@@global.binlog_cache_size
|
||||
4096
|
||||
|
|
|
@ -68,6 +68,8 @@ SELECT @@global.bulk_insert_buffer_size;
|
|||
@@global.bulk_insert_buffer_size
|
||||
4294967295
|
||||
SET @@global.bulk_insert_buffer_size = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-1024'
|
||||
SELECT @@global.bulk_insert_buffer_size;
|
||||
@@global.bulk_insert_buffer_size
|
||||
0
|
||||
|
@ -84,6 +86,8 @@ SELECT @@session.bulk_insert_buffer_size;
|
|||
@@session.bulk_insert_buffer_size
|
||||
4294967295
|
||||
SET @@session.bulk_insert_buffer_size = -2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2'
|
||||
SELECT @@session.bulk_insert_buffer_size;
|
||||
@@session.bulk_insert_buffer_size
|
||||
0
|
||||
|
|
|
@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_limit;
|
|||
1
|
||||
SET @@global.delayed_insert_limit = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect delayed_insert_limit value: '0'
|
||||
Warning 1292 Truncated incorrect delayed_insert_limit value: '-1024'
|
||||
SELECT @@global.delayed_insert_limit;
|
||||
@@global.delayed_insert_limit
|
||||
1
|
||||
|
|
|
@ -3,98 +3,75 @@
|
|||
Creating connection con0
|
||||
Creating connection con1
|
||||
SET @global_delayed_insert_limit = @@GLOBAL.delayed_insert_limit;
|
||||
CREATE TABLE t1 (a varchar(100));
|
||||
CREATE TABLE t1 (a VARCHAR(100),b VARCHAR(100),c VARCHAR(100));
|
||||
'#--------------------FN_DYNVARS_25_01-------------------------#'
|
||||
SET GLOBAL delayed_insert_limit = 9;
|
||||
** Connection con0 **
|
||||
SET GLOBAL delayed_insert_limit = 9;
|
||||
** Connection con1 **
|
||||
SET GLOBAL delayed_insert_limit = 9;
|
||||
** Connection default **
|
||||
SET GLOBAL delayed_insert_limit = 9;
|
||||
INSERT INTO t1 VALUES('1');
|
||||
INSERT INTO t1 VALUES('2');
|
||||
INSERT INTO t1 VALUES('3');
|
||||
INSERT INTO t1 VALUES('4');
|
||||
INSERT INTO t1 VALUES('5');
|
||||
INSERT INTO t1 VALUES('6');
|
||||
SET GLOBAL delayed_insert_limit = 14;
|
||||
INSERT INTO t1 VALUES('1','1','1');
|
||||
INSERT INTO t1 VALUES('2','1','1');
|
||||
INSERT INTO t1 VALUES('3','1','1');
|
||||
INSERT INTO t1 VALUES('4','1','1');
|
||||
INSERT INTO t1 VALUES('5','1','1');
|
||||
INSERT INTO t1 VALUES('6','1','1');
|
||||
LOCK TABLE t1 WRITE;
|
||||
** Connection con1 **
|
||||
INSERT DELAYED INTO t1 VALUES('7');
|
||||
INSERT DELAYED INTO t1 VALUES('8');
|
||||
INSERT DELAYED INTO t1 VALUES('9');
|
||||
INSERT DELAYED INTO t1 VALUES('10');
|
||||
INSERT DELAYED INTO t1 VALUES('11');
|
||||
INSERT DELAYED INTO t1 VALUES('12');
|
||||
INSERT DELAYED INTO t1 VALUES('13');
|
||||
INSERT DELAYED INTO t1 VALUES('14');
|
||||
INSERT DELAYED INTO t1 VALUES('15');
|
||||
INSERT DELAYED INTO t1 VALUES('16');
|
||||
INSERT DELAYED INTO t1 VALUES('17');
|
||||
INSERT DELAYED INTO t1 VALUES('18');
|
||||
INSERT DELAYED INTO t1 VALUES('19');
|
||||
INSERT DELAYED INTO t1 VALUES('20');
|
||||
INSERT DELAYED INTO t1 VALUES('21');
|
||||
INSERT DELAYED INTO t1 VALUES('22');|
|
||||
INSERT DELAYED INTO t1 VALUES('7','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('8','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('9','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('10','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('11','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('12','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('13','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('14','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('15','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('16','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('17','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('18','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('19','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('20','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('21','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('22','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('23','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('24','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('25','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('26','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('27','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('28','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('29','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('30','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('31','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('32','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('33','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('34','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('35','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('36','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('37','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('38','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('39','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('40','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('41','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('42','1','1');
|
||||
INSERT DELAYED INTO t1 VALUES('43','1','1');|
|
||||
** Connection con0 **
|
||||
SELECT * FROM t1;|
|
||||
SELECT COUNT(*) FROM t1;
|
||||
** Connection default **
|
||||
Waiting for 1 sec
|
||||
** Wait till con0 is blocked **
|
||||
UNLOCK TABLES;
|
||||
** Connection con1 **
|
||||
Asynchronous "reap" result
|
||||
** Connection con0 **
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
'Bug#35386: insert delayed inserts 1 + limit rows instead of just limit rows'
|
||||
Asynchronous "reap" result
|
||||
The next result suffers from
|
||||
'# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
|
||||
COUNT(*)
|
||||
21
|
||||
** Connection default **
|
||||
Waiting for 1 sec
|
||||
Checking if the delayed insert continued afterwards
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
DELETE FROM t1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
43
|
||||
DROP TABLE t1;
|
||||
'#--------------------FN_DYNVARS_25_02-------------------------#'
|
||||
SET GLOBAL delayed_insert_limit = 20;
|
||||
** Connection con0 **
|
||||
SET GLOBAL delayed_insert_limit = 20;
|
||||
** Connection con1 **
|
||||
SET GLOBAL delayed_insert_limit = 20;
|
||||
** Connection default **
|
||||
CREATE TABLE t1 (a VARCHAR(100));
|
||||
SET GLOBAL delayed_insert_limit = 20;
|
||||
INSERT INTO t1 VALUES('1');
|
||||
INSERT INTO t1 VALUES('2');
|
||||
|
@ -123,64 +100,21 @@ INSERT DELAYED INTO t1 VALUES('21');
|
|||
INSERT DELAYED INTO t1 VALUES('22');|
|
||||
** Connection con0 **
|
||||
Asynchronous execute
|
||||
SELECT * FROM t1;|
|
||||
SELECT COUNT(*) = 22 FROM t1;
|
||||
** Connection default **
|
||||
Waiting for 1 sec
|
||||
** Wait till con0 is blocked **
|
||||
UNLOCK TABLES;
|
||||
** Connection con1 **
|
||||
** Connection con0 **
|
||||
Asynchronous execute result
|
||||
a
|
||||
Asynchronous "reap" result
|
||||
COUNT(*) = 22
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
** Connection default**
|
||||
Waiting for 1 sec
|
||||
Checking if the delayed insert gives the same result afterwards
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
SELECT COUNT(*) = 22 FROM t1;
|
||||
COUNT(*) = 22
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
DELETE FROM t1;
|
||||
Switching to default
|
||||
Disconnecting from con1, con0
|
||||
** Connection default**
|
||||
DROP TABLE t1;
|
||||
SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
|
||||
Disconnecting from con1, con0
|
||||
|
|
|
@ -35,7 +35,7 @@ SELECT @@global.delayed_queue_size;
|
|||
1
|
||||
SET @@global.delayed_queue_size = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect delayed_queue_size value: '0'
|
||||
Warning 1292 Truncated incorrect delayed_queue_size value: '-1024'
|
||||
SELECT @@global.delayed_queue_size;
|
||||
@@global.delayed_queue_size
|
||||
1
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
drop table if exists t1;
|
||||
## Creating new table ##
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL auto_increment,
|
||||
PRIMARY KEY (id),
|
||||
name VARCHAR(30)
|
||||
);
|
||||
'#--------------------FN_DYNVARS_018_01-------------------------#'
|
||||
## Setting initial value of variable to ON ##
|
||||
SET @@global.event_scheduler = ON;
|
||||
SELECT @@event_scheduler;
|
||||
@@event_scheduler
|
||||
ON
|
||||
## Creating new event ##
|
||||
CREATE EVENT test_event_1
|
||||
ON SCHEDULE EVERY 3 SECOND
|
||||
DO
|
||||
INSERT into t1(name) values('Record_1');
|
||||
SELECT * from t1;
|
||||
id name
|
||||
1 Record_1
|
||||
2 Record_1
|
||||
DROP EVENT test_event_1;
|
||||
DELETE from t1;
|
||||
select * from t1;
|
||||
id name
|
||||
'#--------------------FN_DYNVARS_018_02-------------------------#'
|
||||
## Setting value of variable to OFF ##
|
||||
SET @@global.event_scheduler = OFF;
|
||||
SELECT @@event_scheduler;
|
||||
@@event_scheduler
|
||||
OFF
|
||||
## Creating new event ##
|
||||
CREATE EVENT test_event_1
|
||||
ON SCHEDULE EVERY 3 SECOND
|
||||
DO
|
||||
INSERT into t1(name) values('Record_2');
|
||||
## Table should be empty ##
|
||||
SELECT * from t1;
|
||||
id name
|
||||
DROP EVENT test_event_1;
|
||||
## Dropping table ##
|
||||
DROP table t1;
|
|
@ -70,7 +70,7 @@ FROM articles WHERE MATCH (title,body)
|
|||
AGAINST ('+security configuring' IN BOOLEAN MODE);
|
||||
id title body relevance
|
||||
8 MySQL Security When configured properly, MySQL ... 1
|
||||
9 Database Security Configuring MySQL for ... 1.3333333730698
|
||||
9 Database Security Configuring MySQL for ... 1.33333337306976
|
||||
SELECT * FROM articles WHERE MATCH (title,body)
|
||||
AGAINST ('"faster than"' IN BOOLEAN MODE);
|
||||
id title body
|
||||
|
@ -91,7 +91,7 @@ AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)
|
|||
ORDER BY relevance DESC;
|
||||
id title body relevance
|
||||
4 Optimizing MySQL In this tutorial we will show .... Run command line ... 1.25
|
||||
1 MySQL Tutorial DBMS stands for DataBase ... 0.83333337306976
|
||||
1 MySQL Tutorial DBMS stands for DataBase ... 0.833333373069763
|
||||
'---try setting different operators. Default '+ -><()~*:""&|'--'
|
||||
SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-';
|
||||
SELECT * FROM articles WHERE MATCH (title,body)
|
||||
|
|
|
@ -9,22 +9,27 @@ name VARCHAR(30)
|
|||
'#--------------------FN_DYNVARS_052_01-------------------------#'
|
||||
## Setting initial value of variable to 1 ##
|
||||
SET @@global.interactive_timeout = 1;
|
||||
## Creating new interactive connection test_con1 ##
|
||||
## Creating new connection test_con1 ##
|
||||
## Inserting record in table ##
|
||||
INSERT into t1(name) values('Record_1');
|
||||
## Setting session value of interactive_timeout ##
|
||||
## Setting session value of interactive_timeout ##
|
||||
SET @@session.interactive_timeout = 1;
|
||||
## Verifying values of variable ##
|
||||
## Verifying values of variable ##
|
||||
SELECT @@session.interactive_timeout;
|
||||
@@session.interactive_timeout
|
||||
1
|
||||
SELECT @@global.interactive_timeout;
|
||||
@@global.interactive_timeout
|
||||
1
|
||||
## Using sleep to check timeout ##
|
||||
connection default;
|
||||
## Using sleep to check timeout ##
|
||||
sleep 2;
|
||||
connection test_con1;
|
||||
SELECT * from t1;
|
||||
id name
|
||||
1 Record_1
|
||||
'Bug#35377: Error should appear here because interactive_timeout value';
|
||||
'is 1 and connection remains idle for 5 secs';
|
||||
INSERT into t1(name) values('Record_2');
|
||||
connection default;
|
||||
disconnect test_con1;
|
||||
DROP TABLE t1;
|
||||
SET @@global.interactive_timeout= 28800;
|
||||
|
|
|
@ -75,7 +75,7 @@ SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
|
|||
1
|
||||
SET @@global.join_buffer_size = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '0'
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
|
||||
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
|
||||
@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
|
||||
1
|
||||
|
@ -109,7 +109,7 @@ SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
|
|||
1
|
||||
SET @@session.join_buffer_size = -2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '0'
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '-2'
|
||||
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
|
||||
@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
|
||||
1
|
||||
|
|
|
@ -17,8 +17,6 @@ SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
|
|||
@@global.key_buffer_size BETWEEN 8 AND 36
|
||||
1
|
||||
SET @@global.key_buffer_size = 1800;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
|
||||
SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
|
||||
@@global.key_buffer_size BETWEEN 8 AND 36
|
||||
1
|
||||
|
@ -55,13 +53,13 @@ SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
|
|||
@@global.key_buffer_size BETWEEN 8 AND 36
|
||||
1
|
||||
'#----------------------FN_DYNVARS_055_06------------------------#'
|
||||
SELECT @@global.key_buffer_size = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
SELECT @@global.key_buffer_size = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='key_buffer_size';
|
||||
@@global.key_buffer_size = VARIABLE_VALUE
|
||||
1
|
||||
SELECT @@key_buffer_size = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
SELECT @@key_buffer_size = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='key_buffer_size';
|
||||
@@key_buffer_size = VARIABLE_VALUE
|
||||
1
|
||||
|
|
|
@ -37,10 +37,14 @@ SELECT @@global.key_cache_age_threshold;
|
|||
'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
|
||||
'#--------------------FN_DYNVARS_056_04-------------------------#'
|
||||
SET @@global.key_cache_age_threshold = -1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_age_threshold value: '18446744073709551615'
|
||||
SELECT @@global.key_cache_age_threshold;
|
||||
@@global.key_cache_age_threshold
|
||||
4294967200
|
||||
SET @@global.key_cache_age_threshold = 42949672951;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_age_threshold value: '42949672951'
|
||||
SELECT @@global.key_cache_age_threshold;
|
||||
@@global.key_cache_age_threshold
|
||||
4294967200
|
||||
|
@ -50,9 +54,11 @@ SELECT @@global.key_cache_age_threshold;
|
|||
@@global.key_cache_age_threshold
|
||||
4294967200
|
||||
SET @@global.key_cache_age_threshold = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_age_threshold value: '18446744073709550592'
|
||||
SELECT @@global.key_cache_age_threshold;
|
||||
@@global.key_cache_age_threshold
|
||||
4294966200
|
||||
4294967200
|
||||
SET @@global.key_cache_age_threshold = 99;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_age_threshold value: '99'
|
||||
|
|
|
@ -36,13 +36,13 @@ SELECT @@global.key_cache_block_size;
|
|||
'#--------------------FN_DYNVARS_057_04-------------------------#'
|
||||
SET @@global.key_cache_block_size = -1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '4294967295'
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709551615'
|
||||
SELECT @@global.key_cache_block_size;
|
||||
@@global.key_cache_block_size
|
||||
16384
|
||||
SET @@global.key_cache_block_size = 42949672951;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '4294967287'
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '42949672951'
|
||||
SELECT @@global.key_cache_block_size;
|
||||
@@global.key_cache_block_size
|
||||
16384
|
||||
|
@ -53,7 +53,7 @@ SELECT @@global.key_cache_block_size;
|
|||
16384
|
||||
SET @@global.key_cache_block_size = -1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '4294966272'
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709550592'
|
||||
SELECT @@global.key_cache_block_size;
|
||||
@@global.key_cache_block_size
|
||||
16384
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue