mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch '10.2' into bb-10.2-mdev9543
- Make Window Functions errors use the MariaDB's extra error range. - Fix a trivial bug in check_error_mesg
This commit is contained in:
@ -127,7 +127,7 @@ static my_bool parsing_disabled= 0;
|
|||||||
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
||||||
display_metadata= FALSE, display_result_sorted= FALSE;
|
display_metadata= FALSE, display_result_sorted= FALSE;
|
||||||
static my_bool disable_query_log= 0, disable_result_log= 0;
|
static my_bool disable_query_log= 0, disable_result_log= 0;
|
||||||
static my_bool disable_connect_log= 1;
|
static my_bool disable_connect_log= 0;
|
||||||
static my_bool disable_warnings= 0, disable_column_names= 0;
|
static my_bool disable_warnings= 0, disable_column_names= 0;
|
||||||
static my_bool prepare_warnings_enabled= 0;
|
static my_bool prepare_warnings_enabled= 0;
|
||||||
static my_bool disable_info= 1;
|
static my_bool disable_info= 1;
|
||||||
@ -703,7 +703,7 @@ public:
|
|||||||
DBUG_ASSERT(ds->str);
|
DBUG_ASSERT(ds->str);
|
||||||
|
|
||||||
#ifdef EXTRA_DEBUG
|
#ifdef EXTRA_DEBUG
|
||||||
DBUG_PRINT("QQ", ("str: %*s", (int) ds->length, ds->str));
|
DBUG_PRINT("extra", ("str: %*s", (int) ds->length, ds->str));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fwrite(ds->str, 1, ds->length, m_file) != ds->length)
|
if (fwrite(ds->str, 1, ds->length, m_file) != ds->length)
|
||||||
|
147
extra/comp_err.c
147
extra/comp_err.c
@ -32,9 +32,11 @@
|
|||||||
#include <my_getopt.h>
|
#include <my_getopt.h>
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
|
|
||||||
#define MAX_ROWS 2000
|
#define MAX_ROWS 3000
|
||||||
|
#define ERRORS_PER_RANGE 1000
|
||||||
|
#define MAX_SECTIONS 4
|
||||||
#define HEADER_LENGTH 32 /* Length of header in errmsg.sys */
|
#define HEADER_LENGTH 32 /* Length of header in errmsg.sys */
|
||||||
#define ERRMSG_VERSION 3 /* Version number of errmsg.sys */
|
#define ERRMSG_VERSION 4 /* Version number of errmsg.sys */
|
||||||
#define DEFAULT_CHARSET_DIR "../sql/share/charsets"
|
#define DEFAULT_CHARSET_DIR "../sql/share/charsets"
|
||||||
#define ER_PREFIX "ER_"
|
#define ER_PREFIX "ER_"
|
||||||
#define ER_PREFIX2 "MARIA_ER_"
|
#define ER_PREFIX2 "MARIA_ER_"
|
||||||
@ -53,6 +55,8 @@ static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
|
|||||||
uchar file_head[]= { 254, 254, 2, ERRMSG_VERSION };
|
uchar file_head[]= { 254, 254, 2, ERRMSG_VERSION };
|
||||||
/* Store positions to each error message row to store in errmsg.sys header */
|
/* Store positions to each error message row to store in errmsg.sys header */
|
||||||
uint file_pos[MAX_ROWS+1];
|
uint file_pos[MAX_ROWS+1];
|
||||||
|
uint section_count,section_start;
|
||||||
|
uchar section_header[MAX_SECTIONS*2];
|
||||||
|
|
||||||
const char *empty_string= ""; /* For empty states */
|
const char *empty_string= ""; /* For empty states */
|
||||||
/*
|
/*
|
||||||
@ -131,7 +135,7 @@ static struct my_option my_long_options[]=
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static struct errors *generate_empty_message(uint dcode);
|
static struct errors *generate_empty_message(uint dcode, my_bool skip);
|
||||||
static struct languages *parse_charset_string(char *str);
|
static struct languages *parse_charset_string(char *str);
|
||||||
static struct errors *parse_error_string(char *ptr, int er_count);
|
static struct errors *parse_error_string(char *ptr, int er_count);
|
||||||
static struct message *parse_message_string(struct message *new_message,
|
static struct message *parse_message_string(struct message *new_message,
|
||||||
@ -140,8 +144,9 @@ static struct message *find_message(struct errors *err, const char *lang,
|
|||||||
my_bool no_default);
|
my_bool no_default);
|
||||||
static int check_message_format(struct errors *err,
|
static int check_message_format(struct errors *err,
|
||||||
const char* mess);
|
const char* mess);
|
||||||
static int parse_input_file(const char *file_name, struct errors **top_error,
|
static uint parse_input_file(const char *file_name, struct errors **top_error,
|
||||||
struct languages **top_language);
|
struct languages **top_language,
|
||||||
|
uint *error_count);
|
||||||
static int get_options(int *argc, char ***argv);
|
static int get_options(int *argc, char ***argv);
|
||||||
static void print_version(void);
|
static void print_version(void);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
@ -158,14 +163,15 @@ static char *find_end_of_word(char *str);
|
|||||||
static void clean_up(struct languages *lang_head, struct errors *error_head);
|
static void clean_up(struct languages *lang_head, struct errors *error_head);
|
||||||
static int create_header_files(struct errors *error_head);
|
static int create_header_files(struct errors *error_head);
|
||||||
static int create_sys_files(struct languages *lang_head,
|
static int create_sys_files(struct languages *lang_head,
|
||||||
struct errors *error_head, uint row_count);
|
struct errors *error_head, uint max_error,
|
||||||
|
uint error_count);
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
{
|
{
|
||||||
uint row_count;
|
uint max_error, error_count;
|
||||||
struct errors *error_head;
|
struct errors *error_head;
|
||||||
struct languages *lang_head;
|
struct languages *lang_head;
|
||||||
DBUG_ENTER("main");
|
DBUG_ENTER("main");
|
||||||
@ -173,32 +179,39 @@ int main(int argc, char *argv[])
|
|||||||
charsets_dir= DEFAULT_CHARSET_DIR;
|
charsets_dir= DEFAULT_CHARSET_DIR;
|
||||||
my_umask_dir= 0777;
|
my_umask_dir= 0777;
|
||||||
if (get_options(&argc, &argv))
|
if (get_options(&argc, &argv))
|
||||||
DBUG_RETURN(1);
|
goto err;
|
||||||
if (!(row_count= parse_input_file(TXTFILE, &error_head, &lang_head)))
|
if (!(max_error= parse_input_file(TXTFILE, &error_head, &lang_head,
|
||||||
|
&error_count)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to parse input file %s\n", TXTFILE);
|
fprintf(stderr, "Failed to parse input file %s\n", TXTFILE);
|
||||||
DBUG_RETURN(1);
|
goto err;
|
||||||
}
|
}
|
||||||
if (lang_head == NULL || error_head == NULL)
|
if (lang_head == NULL || error_head == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to parse input file %s\n", TXTFILE);
|
fprintf(stderr, "Failed to parse input file %s\n", TXTFILE);
|
||||||
DBUG_RETURN(1);
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (create_header_files(error_head))
|
if (create_header_files(error_head))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to create header files\n");
|
fprintf(stderr, "Failed to create header files\n");
|
||||||
DBUG_RETURN(1);
|
goto err;
|
||||||
}
|
}
|
||||||
if (create_sys_files(lang_head, error_head, row_count))
|
if (create_sys_files(lang_head, error_head, max_error, error_count))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to create sys files\n");
|
fprintf(stderr, "Failed to create sys files\n");
|
||||||
DBUG_RETURN(1);
|
goto err;
|
||||||
}
|
}
|
||||||
clean_up(lang_head, error_head);
|
clean_up(lang_head, error_head);
|
||||||
DBUG_LEAVE; /* Can't use dbug after my_end() */
|
DBUG_LEAVE; /* Can't use dbug after my_end() */
|
||||||
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
|
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err:
|
||||||
|
clean_up(lang_head, error_head);
|
||||||
|
DBUG_LEAVE; /* Can't use dbug after my_end() */
|
||||||
|
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,6 +239,7 @@ static void print_escaped_string(FILE *f, const char *str)
|
|||||||
static int create_header_files(struct errors *error_head)
|
static int create_header_files(struct errors *error_head)
|
||||||
{
|
{
|
||||||
uint er_last= 0;
|
uint er_last= 0;
|
||||||
|
uint section= 1;
|
||||||
FILE *er_definef, *sql_statef, *er_namef;
|
FILE *er_definef, *sql_statef, *er_namef;
|
||||||
struct errors *tmp_error;
|
struct errors *tmp_error;
|
||||||
struct message *er_msg;
|
struct message *er_msg;
|
||||||
@ -266,8 +280,19 @@ static int create_header_files(struct errors *error_head)
|
|||||||
if (!tmp_error->er_name)
|
if (!tmp_error->er_name)
|
||||||
continue; /* Placeholder for gap */
|
continue; /* Placeholder for gap */
|
||||||
|
|
||||||
if (tmp_error->d_code > current_d_code + 1)
|
while (tmp_error->d_code > current_d_code + 1)
|
||||||
|
{
|
||||||
|
uint next_range= (((current_d_code + ERRORS_PER_RANGE) /
|
||||||
|
ERRORS_PER_RANGE) * ERRORS_PER_RANGE);
|
||||||
|
|
||||||
|
fprintf(er_definef, "#define ER_ERROR_LAST_SECTION_%d %d\n", section,
|
||||||
|
current_d_code);
|
||||||
fprintf(er_definef, "\n/* New section */\n\n");
|
fprintf(er_definef, "\n/* New section */\n\n");
|
||||||
|
fprintf(er_definef, "#define ER_ERROR_FIRST_SECTION_%d %d\n", section+1,
|
||||||
|
MY_MIN(tmp_error->d_code, next_range));
|
||||||
|
section++;
|
||||||
|
current_d_code= MY_MIN(tmp_error->d_code, next_range);
|
||||||
|
}
|
||||||
current_d_code= tmp_error->d_code;
|
current_d_code= tmp_error->d_code;
|
||||||
|
|
||||||
fprintf(er_definef, "#define %s %u\n", tmp_error->er_name,
|
fprintf(er_definef, "#define %s %u\n", tmp_error->er_name,
|
||||||
@ -297,17 +322,18 @@ static int create_header_files(struct errors *error_head)
|
|||||||
|
|
||||||
|
|
||||||
static int create_sys_files(struct languages *lang_head,
|
static int create_sys_files(struct languages *lang_head,
|
||||||
struct errors *error_head, uint row_count)
|
struct errors *error_head,
|
||||||
|
uint max_error,
|
||||||
|
uint error_count)
|
||||||
{
|
{
|
||||||
FILE *to;
|
FILE *to;
|
||||||
uint csnum= 0, length, i, row_nr;
|
uint csnum= 0, length, i, row_nr;
|
||||||
uchar head[32];
|
uchar head[HEADER_LENGTH];
|
||||||
char outfile[FN_REFLEN], *outfile_end;
|
char outfile[FN_REFLEN], *outfile_end;
|
||||||
long start_pos;
|
long start_pos;
|
||||||
struct message *tmp;
|
struct message *tmp;
|
||||||
struct languages *tmp_lang;
|
struct languages *tmp_lang;
|
||||||
struct errors *tmp_error;
|
struct errors *tmp_error;
|
||||||
|
|
||||||
MY_STAT stat_info;
|
MY_STAT stat_info;
|
||||||
DBUG_ENTER("create_sys_files");
|
DBUG_ENTER("create_sys_files");
|
||||||
|
|
||||||
@ -331,7 +357,7 @@ static int create_sys_files(struct languages *lang_head,
|
|||||||
{
|
{
|
||||||
if (my_mkdir(outfile, 0777,MYF(0)) < 0)
|
if (my_mkdir(outfile, 0777,MYF(0)) < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Can't create output directory for %s\n",
|
fprintf(stderr, "Can't creqate output directory for %s\n",
|
||||||
outfile);
|
outfile);
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
@ -343,8 +369,8 @@ static int create_sys_files(struct languages *lang_head,
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
/* 2 is for 2 bytes to store row position / error message */
|
/* 2 is for 2 bytes to store row position / error message */
|
||||||
start_pos= (long) (HEADER_LENGTH + row_count * 2);
|
start_pos= (long) (HEADER_LENGTH + (error_count + section_count) * 2);
|
||||||
fseek(to, start_pos, 0);
|
my_fseek(to, start_pos, 0, MYF(0));
|
||||||
row_nr= 0;
|
row_nr= 0;
|
||||||
for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error)
|
for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error)
|
||||||
{
|
{
|
||||||
@ -358,29 +384,38 @@ static int create_sys_files(struct languages *lang_head,
|
|||||||
"language\n", tmp_error->er_name, tmp_lang->lang_short_name);
|
"language\n", tmp_error->er_name, tmp_lang->lang_short_name);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (copy_rows(to, tmp->text, row_nr, start_pos))
|
if (tmp->text) /* If not skipped row */
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to copy rows to %s\n", outfile);
|
if (copy_rows(to, tmp->text, row_nr, start_pos))
|
||||||
goto err;
|
{
|
||||||
|
fprintf(stderr, "Failed to copy rows to %s\n", outfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
row_nr++;
|
||||||
}
|
}
|
||||||
row_nr++;
|
|
||||||
}
|
}
|
||||||
|
DBUG_ASSERT(error_count == row_nr);
|
||||||
|
|
||||||
/* continue with header of the errmsg.sys file */
|
/* continue with header of the errmsg.sys file */
|
||||||
length= ftell(to) - HEADER_LENGTH - row_count * 2;
|
length= (my_ftell(to, MYF(0)) - HEADER_LENGTH -
|
||||||
|
(error_count + section_count) * 2);
|
||||||
bzero((uchar*) head, HEADER_LENGTH);
|
bzero((uchar*) head, HEADER_LENGTH);
|
||||||
bmove((uchar *) head, (uchar *) file_head, 4);
|
bmove((uchar*) head, (uchar*) file_head, 4);
|
||||||
head[4]= 1;
|
head[4]= 1;
|
||||||
int4store(head + 6, length);
|
int4store(head + 6, length);
|
||||||
int2store(head + 10, row_count);
|
int2store(head + 10, max_error); /* Max error */
|
||||||
|
int2store(head + 12, row_nr);
|
||||||
|
int2store(head + 14, section_count);
|
||||||
head[30]= csnum;
|
head[30]= csnum;
|
||||||
|
|
||||||
my_fseek(to, 0l, MY_SEEK_SET, MYF(0));
|
my_fseek(to, 0l, MY_SEEK_SET, MYF(0));
|
||||||
if (my_fwrite(to, (uchar*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)))
|
if (my_fwrite(to, (uchar*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)) ||
|
||||||
|
my_fwrite(to, (uchar*) section_header, section_count*2,
|
||||||
|
MYF(MY_WME | MY_FNABP)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
file_pos[row_count]= (ftell(to) - start_pos);
|
file_pos[row_nr]= (ftell(to) - start_pos);
|
||||||
for (i= 0; i < row_count; i++)
|
for (i= 0; i < row_nr; i++)
|
||||||
{
|
{
|
||||||
/* Store length of each string */
|
/* Store length of each string */
|
||||||
int2store(head, file_pos[i+1] - file_pos[i]);
|
int2store(head, file_pos[i+1] - file_pos[i]);
|
||||||
@ -437,24 +472,29 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int parse_input_file(const char *file_name, struct errors **top_error,
|
static uint parse_input_file(const char *file_name, struct errors **top_error,
|
||||||
struct languages **top_lang)
|
struct languages **top_lang, uint *error_count)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char *str, buff[1000];
|
char *str, buff[1000];
|
||||||
struct errors *current_error= 0, **tail_error= top_error;
|
struct errors *current_error= 0, **tail_error= top_error;
|
||||||
struct message current_message;
|
struct message current_message;
|
||||||
uint rcount= 0;
|
uint rcount= 0, skiped_errors= 0;
|
||||||
my_bool er_offset_found= 0;
|
my_bool er_offset_found= 0;
|
||||||
DBUG_ENTER("parse_input_file");
|
DBUG_ENTER("parse_input_file");
|
||||||
|
|
||||||
*top_error= 0;
|
*top_error= 0;
|
||||||
*top_lang= 0;
|
*top_lang= 0;
|
||||||
|
*error_count= 0;
|
||||||
|
section_start= er_offset;
|
||||||
|
section_count= 0;
|
||||||
|
|
||||||
if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME))))
|
if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME))))
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
while ((str= fgets(buff, sizeof(buff), file)))
|
while ((str= fgets(buff, sizeof(buff), file)))
|
||||||
{
|
{
|
||||||
|
my_bool skip;
|
||||||
if (is_prefix(str, "language"))
|
if (is_prefix(str, "language"))
|
||||||
{
|
{
|
||||||
if (!(*top_lang= parse_charset_string(str)))
|
if (!(*top_lang= parse_charset_string(str)))
|
||||||
@ -464,18 +504,34 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (is_prefix(str, "start-error-number"))
|
skip= 0;
|
||||||
|
if (is_prefix(str, "start-error-number") ||
|
||||||
|
(skip= is_prefix(str, "skip-to-error-number")))
|
||||||
{
|
{
|
||||||
uint tmp_er_offset;
|
uint tmp_er_offset;
|
||||||
|
|
||||||
if (!(tmp_er_offset= parse_error_offset(str)))
|
if (!(tmp_er_offset= parse_error_offset(str)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to parse the error offset string!\n");
|
fprintf(stderr, "Failed to parse the error offset string!\n");
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
if (skip)
|
||||||
|
{
|
||||||
|
if (section_count >= MAX_SECTIONS-1)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Found too many skip-to-error-number entries. "
|
||||||
|
"We only support %d entries\n", MAX_SECTIONS);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
int2store(section_header + section_count*2,
|
||||||
|
er_offset +rcount - section_start);
|
||||||
|
section_count++;
|
||||||
|
section_start= tmp_er_offset;
|
||||||
|
}
|
||||||
if (!er_offset_found)
|
if (!er_offset_found)
|
||||||
{
|
{
|
||||||
er_offset_found= 1;
|
er_offset_found= 1;
|
||||||
er_offset= tmp_er_offset;
|
er_offset= section_start= tmp_er_offset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -487,7 +543,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||||||
}
|
}
|
||||||
for ( ; er_offset + rcount < tmp_er_offset ; rcount++)
|
for ( ; er_offset + rcount < tmp_er_offset ; rcount++)
|
||||||
{
|
{
|
||||||
current_error= generate_empty_message(er_offset + rcount);
|
skiped_errors+= skip != 0;
|
||||||
|
current_error= generate_empty_message(er_offset + rcount, skip);
|
||||||
*tail_error= current_error;
|
*tail_error= current_error;
|
||||||
tail_error= ¤t_error->next_error;
|
tail_error= ¤t_error->next_error;
|
||||||
}
|
}
|
||||||
@ -559,6 +616,11 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||||||
fprintf(stderr, "Wrong input file format. Stop!\nLine: %s\n", str);
|
fprintf(stderr, "Wrong input file format. Stop!\nLine: %s\n", str);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
int2store(section_header + section_count*2,
|
||||||
|
er_offset + rcount - section_start);
|
||||||
|
section_count++;
|
||||||
|
*error_count= rcount - skiped_errors;
|
||||||
|
|
||||||
*tail_error= 0; /* Mark end of list */
|
*tail_error= 0; /* Mark end of list */
|
||||||
|
|
||||||
my_fclose(file, MYF(0));
|
my_fclose(file, MYF(0));
|
||||||
@ -887,7 +949,7 @@ static struct message *parse_message_string(struct message *new_message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct errors *generate_empty_message(uint d_code)
|
static struct errors *generate_empty_message(uint d_code, my_bool skip)
|
||||||
{
|
{
|
||||||
struct errors *new_error;
|
struct errors *new_error;
|
||||||
struct message message;
|
struct message message;
|
||||||
@ -896,7 +958,8 @@ static struct errors *generate_empty_message(uint d_code)
|
|||||||
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
|
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
|
||||||
MYF(MY_WME))))
|
MYF(MY_WME))))
|
||||||
return(0);
|
return(0);
|
||||||
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1, MYF(0)))
|
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1,
|
||||||
|
MYF(0)))
|
||||||
return(0); /* OOM: Fatal error */
|
return(0); /* OOM: Fatal error */
|
||||||
|
|
||||||
new_error->er_name= NULL;
|
new_error->er_name= NULL;
|
||||||
@ -904,8 +967,10 @@ static struct errors *generate_empty_message(uint d_code)
|
|||||||
new_error->sql_code1= empty_string;
|
new_error->sql_code1= empty_string;
|
||||||
new_error->sql_code2= empty_string;
|
new_error->sql_code2= empty_string;
|
||||||
|
|
||||||
|
message.text= 0; /* If skip set, don't generate a text */
|
||||||
|
|
||||||
if (!(message.lang_short_name= my_strdup(default_language, MYF(MY_WME))) ||
|
if (!(message.lang_short_name= my_strdup(default_language, MYF(MY_WME))) ||
|
||||||
!(message.text= my_strdup("", MYF(MY_WME))))
|
(!skip && !(message.text= my_strdup("", MYF(MY_WME)))))
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
/* Can't fail as msg is preallocated */
|
/* Can't fail as msg is preallocated */
|
||||||
@ -1071,10 +1136,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
|
|||||||
switch (optid) {
|
switch (optid) {
|
||||||
case 'V':
|
case 'V':
|
||||||
print_version();
|
print_version();
|
||||||
|
my_end(0);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
usage();
|
usage();
|
||||||
|
my_end(0);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
|
@ -180,6 +180,10 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
|
|||||||
/* A helper macros for "need at least n bytes" */
|
/* A helper macros for "need at least n bytes" */
|
||||||
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
||||||
|
|
||||||
|
#define MY_CS_MBMAXLEN 6 /* Maximum supported mbmaxlen */
|
||||||
|
#define MY_CS_IS_TOOSMALL(rc) ((rc) >= MY_CS_TOOSMALL6 && (rc) <= MY_CS_TOOSMALL)
|
||||||
|
|
||||||
|
|
||||||
#define MY_SEQ_INTTAIL 1
|
#define MY_SEQ_INTTAIL 1
|
||||||
#define MY_SEQ_SPACES 2
|
#define MY_SEQ_SPACES 2
|
||||||
|
|
||||||
@ -325,8 +329,7 @@ struct my_collation_handler_st
|
|||||||
int (*strnncoll)(CHARSET_INFO *,
|
int (*strnncoll)(CHARSET_INFO *,
|
||||||
const uchar *, size_t, const uchar *, size_t, my_bool);
|
const uchar *, size_t, const uchar *, size_t, my_bool);
|
||||||
int (*strnncollsp)(CHARSET_INFO *,
|
int (*strnncollsp)(CHARSET_INFO *,
|
||||||
const uchar *, size_t, const uchar *, size_t,
|
const uchar *, size_t, const uchar *, size_t);
|
||||||
my_bool diff_if_only_endspace_difference);
|
|
||||||
size_t (*strnxfrm)(CHARSET_INFO *,
|
size_t (*strnxfrm)(CHARSET_INFO *,
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
uchar *dst, size_t dstlen, uint nweights,
|
||||||
const uchar *src, size_t srclen, uint flags);
|
const uchar *src, size_t srclen, uint flags);
|
||||||
@ -644,8 +647,7 @@ extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
|
|||||||
const uchar *, size_t, my_bool);
|
const uchar *, size_t, my_bool);
|
||||||
|
|
||||||
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
|
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
|
||||||
const uchar *, size_t,
|
const uchar *, size_t);
|
||||||
my_bool diff_if_only_endspace_difference);
|
|
||||||
|
|
||||||
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||||
const uchar *key, size_t len,
|
const uchar *key, size_t len,
|
||||||
@ -654,6 +656,17 @@ extern void my_hash_sort_bin(CHARSET_INFO *cs,
|
|||||||
const uchar *key, size_t len, ulong *nr1,
|
const uchar *key, size_t len, ulong *nr1,
|
||||||
ulong *nr2);
|
ulong *nr2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Compare a string to an array of spaces, for PAD SPACE comparison.
|
||||||
|
The function iterates through the string and compares every byte to 0x20.
|
||||||
|
@param - the string
|
||||||
|
@param - its length
|
||||||
|
@return <0 - if a byte less than 0x20 was found in the string.
|
||||||
|
@return 0 - if all bytes in the string were 0x20, or if length was 0.
|
||||||
|
@return >0 - if a byte greater than 0x20 was found in the string.
|
||||||
|
*/
|
||||||
|
extern int my_strnncollsp_padspace_bin(const uchar *str, size_t length);
|
||||||
|
|
||||||
extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
|
extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
|
||||||
|
|
||||||
extern uint my_instr_simple(CHARSET_INFO *,
|
extern uint my_instr_simple(CHARSET_INFO *,
|
||||||
|
@ -298,11 +298,7 @@ enum ha_base_keytype {
|
|||||||
#define HA_SWAP_KEY 64
|
#define HA_SWAP_KEY 64
|
||||||
#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
|
#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
|
||||||
#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
|
#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
|
||||||
/*
|
|
||||||
End space in unique/varchar are considered equal. (Like 'a' and 'a ')
|
|
||||||
Only needed for internal temporary tables.
|
|
||||||
*/
|
|
||||||
#define HA_END_SPACE_ARE_EQUAL 512
|
|
||||||
#define HA_BIT_PART 1024
|
#define HA_BIT_PART 1024
|
||||||
#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
|
#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */
|
|||||||
set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
|
set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
|
||||||
|
|
||||||
extern int ha_compare_text(CHARSET_INFO *, const uchar *, uint,
|
extern int ha_compare_text(CHARSET_INFO *, const uchar *, uint,
|
||||||
const uchar *, uint , my_bool, my_bool);
|
const uchar *, uint , my_bool);
|
||||||
extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
|
extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
|
||||||
const uchar *b, uint key_length, uint nextflag,
|
const uchar *b, uint key_length, uint nextflag,
|
||||||
uint *diff_pos);
|
uint *diff_pos);
|
||||||
|
@ -689,7 +689,7 @@ extern void my_osmaperr(unsigned long last_error);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void init_glob_errs(void);
|
extern void init_glob_errs(void);
|
||||||
extern const char** get_global_errmsgs(void);
|
extern const char** get_global_errmsgs(int nr);
|
||||||
extern void wait_for_free_space(const char *filename, int errors);
|
extern void wait_for_free_space(const char *filename, int errors);
|
||||||
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
|
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
|
||||||
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
|
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
|
||||||
@ -714,9 +714,9 @@ extern void my_printf_error(uint my_err, const char *format,
|
|||||||
ATTRIBUTE_FORMAT(printf, 2, 4);
|
ATTRIBUTE_FORMAT(printf, 2, 4);
|
||||||
extern void my_printv_error(uint error, const char *format, myf MyFlags,
|
extern void my_printv_error(uint error, const char *format, myf MyFlags,
|
||||||
va_list ap);
|
va_list ap);
|
||||||
extern int my_error_register(const char** (*get_errmsgs) (void),
|
extern int my_error_register(const char** (*get_errmsgs) (int nr),
|
||||||
uint first, uint last);
|
uint first, uint last);
|
||||||
extern const char **my_error_unregister(uint first, uint last);
|
extern my_bool my_error_unregister(uint first, uint last);
|
||||||
extern void my_message(uint my_err, const char *str,myf MyFlags);
|
extern void my_message(uint my_err, const char *str,myf MyFlags);
|
||||||
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
|
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
|
||||||
extern my_bool my_init(void);
|
extern my_bool my_init(void);
|
||||||
|
@ -90,7 +90,7 @@ const char *client_errors[]=
|
|||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
const char** get_client_errmsgs(void)
|
const char** get_client_errmsgs(int nr __attribute__((unused)))
|
||||||
{
|
{
|
||||||
return client_errors;
|
return client_errors;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef alpha_linux_port
|
#ifdef alpha_linux_port
|
||||||
#include <asm/ioctls.h> /* QQ; Fix this in configure */
|
#include <asm/ioctls.h>
|
||||||
#include <asm/termiobits.h>
|
#include <asm/termiobits.h>
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
@ -39,29 +39,24 @@ if ($before_truncate) {
|
|||||||
eval $before_truncate;
|
eval $before_truncate;
|
||||||
}
|
}
|
||||||
|
|
||||||
--echo # Connection: default
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO t2 SELECT * FROM t1;
|
INSERT INTO t2 SELECT * FROM t1;
|
||||||
|
|
||||||
connect (truncate,localhost,root,,);
|
connect (truncate,localhost,root,,);
|
||||||
--echo # Connection: truncate
|
|
||||||
send TRUNCATE TABLE t1;
|
send TRUNCATE TABLE t1;
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
--echo # Connection: default
|
|
||||||
INSERT INTO t2 SELECT * FROM t1;
|
INSERT INTO t2 SELECT * FROM t1;
|
||||||
SELECT COUNT(*) FROM t2;
|
SELECT COUNT(*) FROM t2;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
connection truncate;
|
connection truncate;
|
||||||
--echo # Connection: truncate
|
|
||||||
--echo # Reaping TRUNCATE TABLE
|
--echo # Reaping TRUNCATE TABLE
|
||||||
--reap
|
--reap
|
||||||
SELECT COUNT(*) FROM t1;
|
SELECT COUNT(*) FROM t1;
|
||||||
SELECT COUNT(*) FROM t2;
|
SELECT COUNT(*) FROM t2;
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
--echo # Connection: default
|
|
||||||
|
|
||||||
source include/show_binlog_events.inc;
|
source include/show_binlog_events.inc;
|
||||||
disconnect truncate;
|
disconnect truncate;
|
||||||
|
@ -14,11 +14,9 @@
|
|||||||
connection slave;
|
connection slave;
|
||||||
let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
|
let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||||
|
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
eval $statement;
|
eval $statement;
|
||||||
|
|
||||||
--echo [on slave]
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo # Expect 0
|
--echo # Expect 0
|
||||||
SELECT COUNT(*) FROM t1;
|
SELECT COUNT(*) FROM t1;
|
||||||
|
@ -7,15 +7,9 @@ set timestamp=1000000000;
|
|||||||
create database mysqltest2 character set latin2;
|
create database mysqltest2 character set latin2;
|
||||||
set @@character_set_server=latin5;
|
set @@character_set_server=latin5;
|
||||||
create database mysqltest3;
|
create database mysqltest3;
|
||||||
--disable_query_log
|
|
||||||
select "--- --master--" as "";
|
|
||||||
--enable_query_log
|
|
||||||
show create database mysqltest2;
|
show create database mysqltest2;
|
||||||
show create database mysqltest3;
|
show create database mysqltest3;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--disable_query_log
|
|
||||||
select "--- --slave--" as "";
|
|
||||||
--enable_query_log
|
|
||||||
show create database mysqltest2;
|
show create database mysqltest2;
|
||||||
show create database mysqltest3;
|
show create database mysqltest3;
|
||||||
|
|
||||||
@ -23,14 +17,8 @@ connection master;
|
|||||||
set @@collation_server=armscii8_bin;
|
set @@collation_server=armscii8_bin;
|
||||||
drop database mysqltest3;
|
drop database mysqltest3;
|
||||||
create database mysqltest3;
|
create database mysqltest3;
|
||||||
--disable_query_log
|
|
||||||
select "--- --master--" as "";
|
|
||||||
--enable_query_log
|
|
||||||
show create database mysqltest3;
|
show create database mysqltest3;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--disable_query_log
|
|
||||||
select "--- --slave--" as "";
|
|
||||||
--enable_query_log
|
|
||||||
show create database mysqltest3;
|
show create database mysqltest3;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
@ -45,10 +33,8 @@ insert into t1 (b) values(@@character_set_client);
|
|||||||
# collation_client does not exist
|
# collation_client does not exist
|
||||||
insert into t1 (b) values(@@character_set_connection);
|
insert into t1 (b) values(@@character_set_connection);
|
||||||
insert into t1 (b) values(@@collation_connection);
|
insert into t1 (b) values(@@collation_connection);
|
||||||
--echo --- --master--
|
|
||||||
select * from t1 order by a;
|
select * from t1 order by a;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo --- --slave--
|
|
||||||
select * from mysqltest2.t1 order by a;
|
select * from mysqltest2.t1 order by a;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
@ -59,10 +45,8 @@ insert into t1 (b) values(LEAST("M
|
|||||||
set collation_connection=latin1_german2_ci;
|
set collation_connection=latin1_german2_ci;
|
||||||
insert into t1 (b) values(@@collation_connection);
|
insert into t1 (b) values(@@collation_connection);
|
||||||
insert into t1 (b) values(LEAST("M<>ller","Muffler"));
|
insert into t1 (b) values(LEAST("M<>ller","Muffler"));
|
||||||
--echo --- --master--
|
|
||||||
select * from t1 order by a;
|
select * from t1 order by a;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo --- --slave--
|
|
||||||
select * from mysqltest2.t1 order by a;
|
select * from mysqltest2.t1 order by a;
|
||||||
|
|
||||||
# Presently charset info is not logged with LOAD DATA but it will
|
# Presently charset info is not logged with LOAD DATA but it will
|
||||||
@ -81,10 +65,8 @@ connection master;
|
|||||||
set @a= _cp850 'M<>ller' collate cp850_general_ci;
|
set @a= _cp850 'M<>ller' collate cp850_general_ci;
|
||||||
truncate table t1;
|
truncate table t1;
|
||||||
insert into t1 (b) values(collation(@a));
|
insert into t1 (b) values(collation(@a));
|
||||||
--echo --- --master--
|
|
||||||
select * from t1 order by a;
|
select * from t1 order by a;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo --- --slave--
|
|
||||||
select * from mysqltest2.t1 order by a;
|
select * from mysqltest2.t1 order by a;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
|
@ -57,10 +57,8 @@
|
|||||||
|
|
||||||
--echo ==== Initialize ====
|
--echo ==== Initialize ====
|
||||||
|
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
CREATE TABLE t1(a INT PRIMARY KEY);
|
CREATE TABLE t1(a INT PRIMARY KEY);
|
||||||
--echo [on slave]
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
|
||||||
@ -71,14 +69,12 @@ sync_slave_with_master;
|
|||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
|
|
||||||
--echo ---- Insert rows on master ----
|
--echo ---- Insert rows on master ----
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
# Insert the same row on master
|
# Insert the same row on master
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo [on slave]
|
|
||||||
connection slave;
|
connection slave;
|
||||||
|
|
||||||
# If we are statement-logging or if slave_exec_mode=STRICT, we now
|
# If we are statement-logging or if slave_exec_mode=STRICT, we now
|
||||||
@ -117,23 +113,19 @@ SELECT * FROM t1;
|
|||||||
--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
|
--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
|
||||||
|
|
||||||
--echo ---- On master, insert two rows, the second with binlogging off ----
|
--echo ---- On master, insert two rows, the second with binlogging off ----
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
|
|
||||||
--echo [on slave]
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
DELETE FROM t1 WHERE a = 1;
|
DELETE FROM t1 WHERE a = 1;
|
||||||
|
|
||||||
--echo ---- On master, remove the row that does not exist on slave ----
|
--echo ---- On master, remove the row that does not exist on slave ----
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
DELETE FROM t1 WHERE a = 1;
|
DELETE FROM t1 WHERE a = 1;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
|
|
||||||
--echo [on slave]
|
|
||||||
connection slave;
|
connection slave;
|
||||||
|
|
||||||
# If we are row-logging and slave_exec_mode is STRICT, we now expect
|
# If we are row-logging and slave_exec_mode is STRICT, we now expect
|
||||||
@ -172,9 +164,7 @@ SELECT * FROM t1;
|
|||||||
|
|
||||||
--echo ==== Clean up ====
|
--echo ==== Clean up ====
|
||||||
|
|
||||||
--echo [on master]
|
|
||||||
connection master;
|
connection master;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo [on slave]
|
|
||||||
--sync_slave_with_master
|
--sync_slave_with_master
|
||||||
|
@ -133,8 +133,6 @@ set local sql_mode='';
|
|||||||
# The sync_slave_with_master is needed to make the xids deterministic.
|
# The sync_slave_with_master is needed to make the xids deterministic.
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
SET AUTOCOMMIT = 1;
|
SET AUTOCOMMIT = 1;
|
||||||
#
|
#
|
||||||
@ -186,13 +184,9 @@ eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type;
|
|||||||
SET AUTOCOMMIT = 0;
|
SET AUTOCOMMIT = 0;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SET AUTOCOMMIT = 1;
|
SET AUTOCOMMIT = 1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
|
|
||||||
@ -260,12 +254,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW TABLES LIKE 't2';
|
SHOW TABLES LIKE 't2';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW TABLES LIKE 't2';
|
SHOW TABLES LIKE 't2';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
|
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
|
||||||
@ -273,12 +263,8 @@ let $my_master_commit= false;
|
|||||||
let $my_slave_commit= false;
|
let $my_slave_commit= false;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW TABLES LIKE 't23';
|
SHOW TABLES LIKE 't23';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW TABLES LIKE 't23';
|
SHOW TABLES LIKE 't23';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
|
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
|
||||||
@ -286,12 +272,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW TABLES LIKE 't20';
|
SHOW TABLES LIKE 't20';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW TABLES LIKE 't20';
|
SHOW TABLES LIKE 't20';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
|
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
|
||||||
@ -299,12 +281,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
describe mysqltest1.t4;
|
describe mysqltest1.t4;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
describe mysqltest1.t4;
|
describe mysqltest1.t4;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
|
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
|
||||||
@ -326,12 +304,8 @@ let $my_slave_commit= true;
|
|||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SELECT * FROM mysqltest1.t7;
|
SELECT * FROM mysqltest1.t7;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT * FROM mysqltest1.t7;
|
SELECT * FROM mysqltest1.t7;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
@ -383,12 +357,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW INDEX FROM mysqltest1.t6;
|
SHOW INDEX FROM mysqltest1.t6;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW INDEX FROM mysqltest1.t6;
|
SHOW INDEX FROM mysqltest1.t6;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
|
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
|
||||||
@ -396,12 +366,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW INDEX FROM mysqltest1.t5;
|
SHOW INDEX FROM mysqltest1.t5;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW INDEX FROM mysqltest1.t5;
|
SHOW INDEX FROM mysqltest1.t5;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
@ -413,12 +379,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW DATABASES LIKE "mysqltest2";
|
SHOW DATABASES LIKE "mysqltest2";
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW DATABASES LIKE "mysqltest2";
|
SHOW DATABASES LIKE "mysqltest2";
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= CREATE DATABASE mysqltest3;
|
let $my_stmt= CREATE DATABASE mysqltest3;
|
||||||
@ -426,12 +388,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW DATABASES LIKE "mysqltest3";
|
SHOW DATABASES LIKE "mysqltest3";
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW DATABASES LIKE "mysqltest3";
|
SHOW DATABASES LIKE "mysqltest3";
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
@ -446,13 +404,9 @@ let $my_slave_commit= true;
|
|||||||
--vertical_results
|
--vertical_results
|
||||||
--replace_column 5 # 6 #
|
--replace_column 5 # 6 #
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
--replace_column 5 # 6 #
|
--replace_column 5 # 6 #
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
--horizontal_results
|
--horizontal_results
|
||||||
|
|
||||||
@ -463,13 +417,9 @@ let $my_slave_commit= true;
|
|||||||
--vertical_results
|
--vertical_results
|
||||||
--replace_column 5 # 6 #
|
--replace_column 5 # 6 #
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
--replace_column 5 # 6 #
|
--replace_column 5 # 6 #
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
--horizontal_results
|
--horizontal_results
|
||||||
|
|
||||||
@ -479,12 +429,8 @@ let $my_slave_commit= true;
|
|||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
--vertical_results
|
--vertical_results
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW PROCEDURE STATUS LIKE 'p1';
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
--horizontal_results
|
--horizontal_results
|
||||||
|
|
||||||
@ -496,12 +442,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
|
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
|
||||||
@ -509,12 +451,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= DROP VIEW IF EXISTS v1;
|
let $my_stmt= DROP VIEW IF EXISTS v1;
|
||||||
@ -523,13 +461,9 @@ let $my_slave_commit= true;
|
|||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
--error 1146
|
--error 1146
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
--error 1146
|
--error 1146
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
@ -540,12 +474,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= DROP TRIGGER trg1;
|
let $my_stmt= DROP TRIGGER trg1;
|
||||||
@ -553,12 +483,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
@ -569,12 +495,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SELECT user FROM mysql.user WHERE user = 'user1';
|
SELECT user FROM mysql.user WHERE user = 'user1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT user FROM mysql.user WHERE user = 'user1';
|
SELECT user FROM mysql.user WHERE user = 'user1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
|
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
|
||||||
@ -582,12 +504,8 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
let $my_stmt= DROP USER rename1@localhost;
|
let $my_stmt= DROP USER rename1@localhost;
|
||||||
@ -595,8 +513,6 @@ let $my_master_commit= true;
|
|||||||
let $my_slave_commit= true;
|
let $my_slave_commit= true;
|
||||||
--source include/rpl_stmt_seq.inc
|
--source include/rpl_stmt_seq.inc
|
||||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||||
|
|
||||||
@ -604,8 +520,6 @@ SELECT user FROM mysql.user WHERE user = 'rename1';
|
|||||||
# Cleanup
|
# Cleanup
|
||||||
###############################################################
|
###############################################################
|
||||||
use test;
|
use test;
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
DROP TEMPORARY TABLE mysqltest1.t22;
|
DROP TEMPORARY TABLE mysqltest1.t22;
|
||||||
DROP DATABASE mysqltest1;
|
DROP DATABASE mysqltest1;
|
||||||
|
@ -23,7 +23,6 @@ call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot
|
|||||||
### Should Stop Slave ###
|
### Should Stop Slave ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
--echo *** On Slave ***
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
STOP SLAVE;
|
STOP SLAVE;
|
||||||
RESET SLAVE;
|
RESET SLAVE;
|
||||||
|
@ -64,7 +64,6 @@ eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
|
|||||||
SET AUTOCOMMIT = 0;
|
SET AUTOCOMMIT = 0;
|
||||||
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
|
|
||||||
# We want to verify that the following transactions are written to the
|
# We want to verify that the following transactions are written to the
|
||||||
@ -79,7 +78,6 @@ connection slave;
|
|||||||
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
|
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
|
||||||
SHOW CREATE TABLE mysqltest1.t1;
|
SHOW CREATE TABLE mysqltest1.t1;
|
||||||
|
|
||||||
--echo -------- switch to master --------
|
|
||||||
connection master;
|
connection master;
|
||||||
INSERT INTO mysqltest1.t1 SET f1= 1;
|
INSERT INTO mysqltest1.t1 SET f1= 1;
|
||||||
DROP TEMPORARY TABLE mysqltest1.tmp;
|
DROP TEMPORARY TABLE mysqltest1.tmp;
|
||||||
@ -98,7 +96,6 @@ SHOW CREATE TABLE mysqltest1.tmp2;
|
|||||||
SELECT COUNT(*) FROM mysqltest1.t1;
|
SELECT COUNT(*) FROM mysqltest1.t1;
|
||||||
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
--error ER_NO_SUCH_TABLE
|
--error ER_NO_SUCH_TABLE
|
||||||
SHOW CREATE TABLE mysqltest1.tmp;
|
SHOW CREATE TABLE mysqltest1.tmp;
|
||||||
@ -108,7 +105,6 @@ SHOW CREATE TABLE mysqltest1.tmp2;
|
|||||||
SELECT COUNT(*) FROM mysqltest1.t1;
|
SELECT COUNT(*) FROM mysqltest1.t1;
|
||||||
FLUSH LOGS;
|
FLUSH LOGS;
|
||||||
|
|
||||||
--echo -------- switch to master --------
|
|
||||||
connection master;
|
connection master;
|
||||||
FLUSH LOGS;
|
FLUSH LOGS;
|
||||||
DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
|
DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
|
||||||
@ -142,11 +138,9 @@ INSERT INTO t1 (b) VALUES (1),(2),(3);
|
|||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO t1(b) VALUES (4);
|
INSERT INTO t1(b) VALUES (4);
|
||||||
|
|
||||||
--echo -------- switch to master1 --------
|
|
||||||
connection master1;
|
connection master1;
|
||||||
--send RENAME TABLE t1 TO t3, t2 TO t1;
|
--send RENAME TABLE t1 TO t3, t2 TO t1;
|
||||||
|
|
||||||
--echo -------- switch to master --------
|
|
||||||
connection master;
|
connection master;
|
||||||
# Need to wait until RENAME is received
|
# Need to wait until RENAME is received
|
||||||
let $wait_condition=
|
let $wait_condition=
|
||||||
@ -157,23 +151,19 @@ let $wait_condition=
|
|||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
--echo -------- switch to master1 --------
|
|
||||||
connection master1;
|
connection master1;
|
||||||
--reap
|
--reap
|
||||||
|
|
||||||
--echo -------- switch to master --------
|
|
||||||
connection master;
|
connection master;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
SELECT * FROM t3;
|
SELECT * FROM t3;
|
||||||
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
SELECT * FROM t3;
|
SELECT * FROM t3;
|
||||||
|
|
||||||
--echo -------- switch to master --------
|
|
||||||
connection master;
|
connection master;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
|
@ -197,7 +197,6 @@ DROP TABLE t1;
|
|||||||
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||||
|
|
||||||
-- echo ### create connection without default database
|
-- echo ### create connection without default database
|
||||||
-- echo ### connect (conn2,localhost,root,,*NO-ONE*);
|
|
||||||
connect (conn2,localhost,root,,*NO-ONE*);
|
connect (conn2,localhost,root,,*NO-ONE*);
|
||||||
-- connection conn2
|
-- connection conn2
|
||||||
-- echo ### assertion: works without stating the default database
|
-- echo ### assertion: works without stating the default database
|
||||||
@ -216,7 +215,6 @@ connect (conn2,localhost,root,,*NO-ONE*);
|
|||||||
-- let $table= $db1.t1
|
-- let $table= $db1.t1
|
||||||
--source include/wait_until_rows_count.inc
|
--source include/wait_until_rows_count.inc
|
||||||
|
|
||||||
-- echo ### disconnect and switch back to master connection
|
|
||||||
-- disconnect conn2
|
-- disconnect conn2
|
||||||
-- connection master
|
-- connection master
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ if (`select char_length('$bit_field_special') > 0`) {
|
|||||||
connection master;
|
connection master;
|
||||||
eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
|
eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo --- on slave: original values ---
|
--echo --- original values ---
|
||||||
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
|
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
|
||||||
SELECT * FROM t7 ORDER BY C1;
|
SELECT * FROM t7 ORDER BY C1;
|
||||||
|
|
||||||
@ -226,13 +226,13 @@ SELECT * FROM t7 ORDER BY C1;
|
|||||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
--echo --- on master: new values inserted ---
|
--echo --- new values inserted ---
|
||||||
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
||||||
SELECT * FROM t7 ORDER BY C1;
|
SELECT * FROM t7 ORDER BY C1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
set @@global.slave_exec_mode= default;
|
set @@global.slave_exec_mode= default;
|
||||||
--echo --- on slave: old values should be overwritten by replicated values ---
|
--echo --- old values should be overwritten by replicated values ---
|
||||||
SELECT * FROM t7 ORDER BY C1;
|
SELECT * FROM t7 ORDER BY C1;
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -240,7 +240,6 @@ SELECT * FROM t7 ORDER BY C1;
|
|||||||
# causing a conflict for a key that is not "last".
|
# causing a conflict for a key that is not "last".
|
||||||
#
|
#
|
||||||
connection master;
|
connection master;
|
||||||
--echo --- on master ---
|
|
||||||
eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
|
eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
|
||||||
|
|
||||||
# First we make sure that the constraints are correctly set.
|
# First we make sure that the constraints are correctly set.
|
||||||
@ -254,7 +253,6 @@ INSERT INTO t8 VALUES (11,22,99);
|
|||||||
SELECT * FROM t8 ORDER BY a;
|
SELECT * FROM t8 ORDER BY a;
|
||||||
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo --- on slave ---
|
|
||||||
SELECT * FROM t8 ORDER BY a;
|
SELECT * FROM t8 ORDER BY a;
|
||||||
INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
|
INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
|
||||||
SELECT * FROM t8 ORDER BY a;
|
SELECT * FROM t8 ORDER BY a;
|
||||||
@ -265,14 +263,12 @@ SELECT * FROM t8 ORDER BY a;
|
|||||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
--echo --- on master ---
|
|
||||||
# We insert a row that will cause conflict on the primary key but not
|
# We insert a row that will cause conflict on the primary key but not
|
||||||
# on the other keys.
|
# on the other keys.
|
||||||
INSERT INTO t8 VALUES (2,4,8);
|
INSERT INTO t8 VALUES (2,4,8);
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
set @@global.slave_exec_mode= default;
|
set @@global.slave_exec_mode= default;
|
||||||
|
|
||||||
--echo --- on slave ---
|
|
||||||
SELECT * FROM t8 ORDER BY a;
|
SELECT * FROM t8 ORDER BY a;
|
||||||
|
|
||||||
# BUG#31552: Replication breaks when deleting rows from out-of-sync
|
# BUG#31552: Replication breaks when deleting rows from out-of-sync
|
||||||
@ -280,7 +276,6 @@ SELECT * FROM t8 ORDER BY a;
|
|||||||
|
|
||||||
--echo **** Test for BUG#31552 ****
|
--echo **** Test for BUG#31552 ****
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
# Clean up t1 so that we can use it.
|
# Clean up t1 so that we can use it.
|
||||||
connection master;
|
connection master;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
@ -289,10 +284,8 @@ sync_slave_with_master;
|
|||||||
# Just to get a clean binary log
|
# Just to get a clean binary log
|
||||||
--source include/rpl_reset.inc
|
--source include/rpl_reset.inc
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
||||||
--echo **** On Master ****
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||||
# the following test DELETE FROM t1 to pass the mode is switched
|
# the following test DELETE FROM t1 to pass the mode is switched
|
||||||
@ -313,14 +306,12 @@ query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
|||||||
# (regression test)
|
# (regression test)
|
||||||
|
|
||||||
--echo **** Test for BUG#37076 ****
|
--echo **** Test for BUG#37076 ****
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
|
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
|
||||||
INSERT INTO t1 VALUES(
|
INSERT INTO t1 VALUES(
|
||||||
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
|
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
|
||||||
|
|
||||||
--echo **** On Slave ****
|
|
||||||
sync_slave_with_master slave;
|
sync_slave_with_master slave;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
@ -22,25 +22,16 @@ BEGIN
|
|||||||
END|
|
END|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
|
||||||
let $message=< ---- Master selects-- >;
|
|
||||||
--source include/show_msg.inc
|
|
||||||
CALL test.p1(12);
|
CALL test.p1(12);
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
|
|
||||||
|
|
||||||
let $message=< ---- Slave selects-- >;
|
|
||||||
--source include/show_msg.inc
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
|
|
||||||
let $message=< ---- Master selects-- >;
|
|
||||||
--source include/show_msg.inc
|
|
||||||
connection master;
|
connection master;
|
||||||
CALL test.p1(13);
|
CALL test.p1(13);
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
|
|
||||||
let $message=< ---- Slave selects-- >;
|
|
||||||
--source include/show_msg.inc
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ INSERT INTO t1_int VALUES (2, 4, 4711);
|
|||||||
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
||||||
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
INSERT INTO t1_int VALUES (1,2);
|
INSERT INTO t1_int VALUES (1,2);
|
||||||
INSERT INTO t1_int VALUES (2,5);
|
INSERT INTO t1_int VALUES (2,5);
|
||||||
@ -89,7 +88,6 @@ INSERT INTO t1_char VALUES (2,5);
|
|||||||
SELECT * FROM t1_int ORDER BY a;
|
SELECT * FROM t1_int ORDER BY a;
|
||||||
SELECT * FROM t1_bit ORDER BY a;
|
SELECT * FROM t1_bit ORDER BY a;
|
||||||
SELECT * FROM t1_char ORDER BY a;
|
SELECT * FROM t1_char ORDER BY a;
|
||||||
--echo **** On Slave ****
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
set @@global.slave_exec_mode= default;
|
set @@global.slave_exec_mode= default;
|
||||||
|
|
||||||
@ -97,7 +95,6 @@ SELECT a,b,x FROM t1_int ORDER BY a;
|
|||||||
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
||||||
SELECT a,b,x FROM t1_char ORDER BY a;
|
SELECT a,b,x FROM t1_char ORDER BY a;
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
UPDATE t1_int SET b=2*b WHERE a=2;
|
UPDATE t1_int SET b=2*b WHERE a=2;
|
||||||
UPDATE t1_char SET b=2*b WHERE a=2;
|
UPDATE t1_char SET b=2*b WHERE a=2;
|
||||||
@ -105,7 +102,6 @@ UPDATE t1_bit SET b=2*b WHERE a=2;
|
|||||||
SELECT * FROM t1_int ORDER BY a;
|
SELECT * FROM t1_int ORDER BY a;
|
||||||
SELECT * FROM t1_bit ORDER BY a;
|
SELECT * FROM t1_bit ORDER BY a;
|
||||||
SELECT * FROM t1_char ORDER BY a;
|
SELECT * FROM t1_char ORDER BY a;
|
||||||
--echo **** On Slave ****
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT a,b,x FROM t1_int ORDER BY a;
|
SELECT a,b,x FROM t1_int ORDER BY a;
|
||||||
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
||||||
@ -132,11 +128,9 @@ INSERT INTO t9 VALUES (2);
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
# Now slave is guaranteed to be running
|
# Now slave is guaranteed to be running
|
||||||
connection master;
|
connection master;
|
||||||
--echo **** On Master ****
|
|
||||||
INSERT INTO t2 VALUES (2,4);
|
INSERT INTO t2 VALUES (2,4);
|
||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo **** On Slave ****
|
|
||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
--source include/check_slave_is_running.inc
|
--source include/check_slave_is_running.inc
|
||||||
|
|
||||||
@ -200,7 +194,6 @@ SELECT * FROM t8 ORDER BY a;
|
|||||||
# update should not generate an error even though there is no default
|
# update should not generate an error even though there is no default
|
||||||
# for the extra column.
|
# for the extra column.
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
TRUNCATE t1_nodef;
|
TRUNCATE t1_nodef;
|
||||||
SET SQL_LOG_BIN=0;
|
SET SQL_LOG_BIN=0;
|
||||||
@ -209,26 +202,21 @@ INSERT INTO t1_nodef VALUES (2,4);
|
|||||||
SET SQL_LOG_BIN=1;
|
SET SQL_LOG_BIN=1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo **** On Slave ****
|
|
||||||
connection slave;
|
connection slave;
|
||||||
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
|
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
|
||||||
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
|
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
UPDATE t1_nodef SET b=2*b WHERE a=1;
|
UPDATE t1_nodef SET b=2*b WHERE a=1;
|
||||||
SELECT * FROM t1_nodef ORDER BY a;
|
SELECT * FROM t1_nodef ORDER BY a;
|
||||||
|
|
||||||
--echo **** On Slave ****
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT * FROM t1_nodef ORDER BY a;
|
SELECT * FROM t1_nodef ORDER BY a;
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
DELETE FROM t1_nodef WHERE a=2;
|
DELETE FROM t1_nodef WHERE a=2;
|
||||||
SELECT * FROM t1_nodef ORDER BY a;
|
SELECT * FROM t1_nodef ORDER BY a;
|
||||||
|
|
||||||
--echo **** On Slave ****
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT * FROM t1_nodef ORDER BY a;
|
SELECT * FROM t1_nodef ORDER BY a;
|
||||||
|
|
||||||
|
@ -140,11 +140,11 @@ CREATE TABLE t1 (a INT );
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--connection slave1
|
--connection slave1
|
||||||
--echo # Slave1: lock table for synchronization
|
--echo # lock table for synchronization
|
||||||
LOCK TABLES t1 WRITE;
|
LOCK TABLES t1 WRITE;
|
||||||
|
|
||||||
--connection master
|
--connection master
|
||||||
--echo # Master: insert into the table
|
--echo # insert into the table
|
||||||
INSERT INTO t1 SELECT SLEEP(4);
|
INSERT INTO t1 SELECT SLEEP(4);
|
||||||
|
|
||||||
--connection slave
|
--connection slave
|
||||||
@ -155,11 +155,11 @@ let $wait_condition=
|
|||||||
AND INFO = "INSERT INTO t1 SELECT SLEEP(4)";
|
AND INFO = "INSERT INTO t1 SELECT SLEEP(4)";
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
--echo # Slave: send slave stop
|
--echo # send slave stop
|
||||||
--send STOP SLAVE
|
--send STOP SLAVE
|
||||||
|
|
||||||
--connection slave1
|
--connection slave1
|
||||||
--echo # Slave1: wait for stop slave
|
--echo # wait for stop slave
|
||||||
let $wait_condition=
|
let $wait_condition=
|
||||||
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||||
WHERE INFO = "STOP SLAVE";
|
WHERE INFO = "STOP SLAVE";
|
||||||
@ -169,7 +169,7 @@ let $wait_condition=
|
|||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--connection slave
|
--connection slave
|
||||||
--echo # Slave: wait for the slave to stop
|
--echo # wait for the slave to stop
|
||||||
--reap
|
--reap
|
||||||
--source include/wait_for_slave_to_stop.inc
|
--source include/wait_for_slave_to_stop.inc
|
||||||
|
|
||||||
|
@ -15,8 +15,6 @@ if (!$tmp_table_stm)
|
|||||||
--die $tmp_table_stm is NULL
|
--die $tmp_table_stm is NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo [ On Master ]
|
|
||||||
connection master;
|
connection master;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
@ -25,8 +23,6 @@ INSERT INTO t1 VALUES (1);
|
|||||||
DROP TEMPORARY TABLE tt1;
|
DROP TEMPORARY TABLE tt1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo [ On Slave ]
|
|
||||||
connection slave;
|
connection slave;
|
||||||
|
|
||||||
# To check if slave SQL thread is applying INSERT statement
|
# To check if slave SQL thread is applying INSERT statement
|
||||||
@ -37,16 +33,12 @@ source include/wait_show_condition.inc;
|
|||||||
|
|
||||||
send STOP SLAVE SQL_THREAD;
|
send STOP SLAVE SQL_THREAD;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo [ On Slave1 ]
|
|
||||||
connection slave1;
|
connection slave1;
|
||||||
--echo # To resume slave SQL thread
|
--echo # To resume slave SQL thread
|
||||||
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
||||||
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
|
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
|
||||||
SET DEBUG_SYNC= 'RESET';
|
SET DEBUG_SYNC= 'RESET';
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo [ On Slave ]
|
|
||||||
connection slave;
|
connection slave;
|
||||||
reap;
|
reap;
|
||||||
source include/wait_for_slave_sql_to_stop.inc;
|
source include/wait_for_slave_sql_to_stop.inc;
|
||||||
|
@ -62,8 +62,7 @@ while ($masters)
|
|||||||
--let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
|
--let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
|
||||||
|
|
||||||
# Connect to master and execute statement
|
# Connect to master and execute statement
|
||||||
--let $rpl_connection_name= server_$master_i
|
connection server_$master_i;
|
||||||
--source include/rpl_connection.inc
|
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
--eval INSERT INTO t1 VALUES ($next_number)
|
--eval INSERT INTO t1 VALUES ($next_number)
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
--source include/rpl_reset.inc
|
--source include/rpl_reset.inc
|
||||||
|
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine;
|
eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine;
|
||||||
INSERT INTO t1 VALUES (1,1), (2,2);
|
INSERT INTO t1 VALUES (1,1), (2,2);
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
eval $trunc_stmt t1;
|
eval $trunc_stmt t1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
@ -14,13 +12,11 @@ let $diff_tables= master:t1, slave:t1;
|
|||||||
source include/diff_tables.inc;
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
--echo ==== Test using a table with delete triggers ====
|
--echo ==== Test using a table with delete triggers ====
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
SET @count := 1;
|
SET @count := 1;
|
||||||
eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine;
|
eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine;
|
||||||
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
|
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo **** On Master ****
|
|
||||||
connection master;
|
connection master;
|
||||||
eval $trunc_stmt t1;
|
eval $trunc_stmt t1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
@ -2,16 +2,12 @@
|
|||||||
--echo
|
--echo
|
||||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo # connection: con1 (mysqltest_u1@mysqltest_db1)
|
|
||||||
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
|
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
|
||||||
--connection con1
|
--connection con1
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo # connection: default
|
|
||||||
--connection default
|
--connection default
|
||||||
|
|
||||||
--disconnect con1
|
--disconnect con1
|
||||||
|
@ -64,7 +64,6 @@ drop table if exists t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** two UPDATE's running and both changing distinct result sets
|
--echo ** two UPDATE's running and both changing distinct result sets
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
connect (thread1, localhost, mysqltest,,);
|
connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -84,7 +83,6 @@ drop table if exists t1;
|
|||||||
--echo ** Get user level lock (ULL) for thread 1
|
--echo ** Get user level lock (ULL) for thread 1
|
||||||
select get_lock("hello",10);
|
select get_lock("hello",10);
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connect (thread2, localhost, mysqltest,,);
|
connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Start transaction for thread 2
|
--echo ** Start transaction for thread 2
|
||||||
@ -93,7 +91,6 @@ drop table if exists t1;
|
|||||||
--echo ** be created and blocked on the first row where tipo=11.
|
--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;
|
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
@ -121,7 +118,6 @@ drop table if exists t1;
|
|||||||
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
|
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Release the lock and collect result from update on thread 2
|
--echo ** Release the lock and collect result from update on thread 2
|
||||||
reap;
|
reap;
|
||||||
@ -134,7 +130,6 @@ drop table if exists t1;
|
|||||||
--echo ** Sending commit on thread 2.
|
--echo ** Sending commit on thread 2.
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Make sure table reads didn't change yet on thread 1.
|
--echo ** Make sure table reads didn't change yet on thread 1.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
@ -144,16 +139,13 @@ drop table if exists t1;
|
|||||||
--echo ** thread 1,2.
|
--echo ** thread 1,2.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Make sure the output is similar for t1.
|
--echo ** Make sure the output is similar for t1.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -162,7 +154,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** two UPDATE's running and one changing result set
|
--echo ** two UPDATE's running and one changing result set
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -182,7 +173,6 @@ drop table t1;
|
|||||||
--echo ** Get ULL "hello" on thread 1
|
--echo ** Get ULL "hello" on thread 1
|
||||||
select get_lock("hello",10);
|
select get_lock("hello",10);
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Start transaction on thread 2
|
--echo ** Start transaction on thread 2
|
||||||
@ -192,7 +182,6 @@ drop table t1;
|
|||||||
--echo ** blocking ULL is released.
|
--echo ** blocking ULL is released.
|
||||||
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
|
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
@ -219,7 +208,6 @@ drop table t1;
|
|||||||
--echo ** The table should still be updated with updates for thread 1 only:
|
--echo ** The table should still be updated with updates for thread 1 only:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Release the lock and collect result from thread 2:
|
--echo ** Release the lock and collect result from thread 2:
|
||||||
reap;
|
reap;
|
||||||
@ -231,7 +219,6 @@ drop table t1;
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Thread 2 has committed but the result should remain the same for
|
--echo ** Thread 2 has committed but the result should remain the same for
|
||||||
--echo ** thread 1 (updated on three places):
|
--echo ** thread 1 (updated on three places):
|
||||||
@ -242,15 +229,12 @@ drop table t1;
|
|||||||
--echo ** This select should show both updates:
|
--echo ** This select should show both updates:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -259,7 +243,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** One UPDATE and one INSERT .... Monty's test
|
--echo ** One UPDATE and one INSERT .... Monty's test
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -269,7 +252,6 @@ drop table t1;
|
|||||||
--echo ** Create ULL 'hello2'
|
--echo ** Create ULL 'hello2'
|
||||||
select get_lock("hello2",10);
|
select get_lock("hello2",10);
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Begin a new transaction on thread 2
|
--echo ** Begin a new transaction on thread 2
|
||||||
@ -278,7 +260,6 @@ drop table t1;
|
|||||||
--echo ** this will hang waiting on thread 1.
|
--echo ** this will hang waiting on thread 1.
|
||||||
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
|
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
@ -292,7 +273,6 @@ drop table t1;
|
|||||||
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
|
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Collect results from thread 2 and release the lock.
|
--echo ** Collect results from thread 2 and release the lock.
|
||||||
reap;
|
reap;
|
||||||
@ -305,7 +285,6 @@ drop table t1;
|
|||||||
--echo ** Commit changes from thread 2
|
--echo ** Commit changes from thread 2
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -314,7 +293,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** one UPDATE changing result set and SELECT ... FOR UPDATE
|
--echo ** one UPDATE changing result set and SELECT ... FOR UPDATE
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -332,7 +310,6 @@ drop table t1;
|
|||||||
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
||||||
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Begin a new transaction on thread 2
|
--echo ** Begin a new transaction on thread 2
|
||||||
@ -340,7 +317,6 @@ drop table t1;
|
|||||||
--echo ** Select a range for update.
|
--echo ** Select a range for update.
|
||||||
select * from t1 where tipo=2 FOR UPDATE;
|
select * from t1 where tipo=2 FOR UPDATE;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Begin a new transaction on thread 1
|
--echo ** Begin a new transaction on thread 1
|
||||||
begin;
|
begin;
|
||||||
@ -352,7 +328,6 @@ drop table t1;
|
|||||||
--echo ** transaction failed and was rolled back.
|
--echo ** transaction failed and was rolled back.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** The table should look unmodified from thread 2.
|
--echo ** The table should look unmodified from thread 2.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
@ -360,22 +335,18 @@ drop table t1;
|
|||||||
--echo ** thread 1 to complete the transaction.
|
--echo ** thread 1 to complete the transaction.
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Commit on thread 1.
|
--echo ** Commit on thread 1.
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** The table should not have been changed.
|
--echo ** The table should not have been changed.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Even on thread 1:
|
--echo ** Even on thread 1:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -384,7 +355,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
|
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -402,7 +372,6 @@ drop table t1;
|
|||||||
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
||||||
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Starting new transaction on thread 2.
|
--echo ** Starting new transaction on thread 2.
|
||||||
@ -410,7 +379,6 @@ drop table t1;
|
|||||||
--echo ** Starting SELECT .. FOR UPDATE
|
--echo ** Starting SELECT .. FOR UPDATE
|
||||||
select * from t1 where tipo=2 FOR UPDATE;
|
select * from t1 where tipo=2 FOR UPDATE;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo
|
--echo
|
||||||
--echo ** Starting new transaction on thread 1
|
--echo ** Starting new transaction on thread 1
|
||||||
@ -433,28 +401,23 @@ drop table t1;
|
|||||||
--echo ** have changed.
|
--echo ** have changed.
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** The same thing should hold true for the transaction on
|
--echo ** The same thing should hold true for the transaction on
|
||||||
--echo ** thread 2
|
--echo ** thread 2
|
||||||
select * from t1;
|
select * from t1;
|
||||||
send commit;
|
send commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Even after committing:
|
--echo ** Even after committing:
|
||||||
reap;
|
reap;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -463,7 +426,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** two SELECT ... FOR UPDATE
|
--echo ** two SELECT ... FOR UPDATE
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -481,14 +443,12 @@ drop table t1;
|
|||||||
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
||||||
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Begin a new transaction on thread 2
|
--echo ** Begin a new transaction on thread 2
|
||||||
begin;
|
begin;
|
||||||
select * from t1 where tipo=2 FOR UPDATE;
|
select * from t1 where tipo=2 FOR UPDATE;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Begin a new transaction on thread 1
|
--echo ** Begin a new transaction on thread 1
|
||||||
begin;
|
begin;
|
||||||
@ -497,7 +457,6 @@ drop table t1;
|
|||||||
--error ER_LOCK_WAIT_TIMEOUT
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
select * from t1 where tipo=1 FOR UPDATE;
|
select * from t1 where tipo=1 FOR UPDATE;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Table will be unchanged and the select command will not be
|
--echo ** Table will be unchanged and the select command will not be
|
||||||
--echo ** blocked:
|
--echo ** blocked:
|
||||||
@ -505,22 +464,18 @@ drop table t1;
|
|||||||
--echo ** Commit transacton on thread 2.
|
--echo ** Commit transacton on thread 2.
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Commit transaction on thread 1.
|
--echo ** Commit transaction on thread 1.
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
--echo ** Make sure table isn't blocked on thread 2:
|
--echo ** Make sure table isn't blocked on thread 2:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Make sure table isn't blocked on thread 1:
|
--echo ** Make sure table isn't blocked on thread 1:
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -529,7 +484,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** one UPDATE changing result set and DELETE
|
--echo ** one UPDATE changing result set and DELETE
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -547,7 +501,6 @@ drop table t1;
|
|||||||
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
||||||
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
begin;
|
begin;
|
||||||
@ -557,33 +510,27 @@ drop table t1;
|
|||||||
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
||||||
sleep 1;
|
sleep 1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
begin;
|
begin;
|
||||||
--error ER_LOCK_WAIT_TIMEOUT
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
update t1 set tipo=1 where tipo=2;
|
update t1 set tipo=1 where tipo=2;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
reap;
|
reap;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
send commit;
|
send commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
reap;
|
reap;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
@ -592,7 +539,6 @@ drop table t1;
|
|||||||
--echo **
|
--echo **
|
||||||
--echo ** one UPDATE not changing result set and DELETE
|
--echo ** one UPDATE not changing result set and DELETE
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** connection thread1
|
|
||||||
#connect (thread1, localhost, mysqltest,,);
|
#connect (thread1, localhost, mysqltest,,);
|
||||||
connection thread1;
|
connection thread1;
|
||||||
--echo ** Set up table
|
--echo ** Set up table
|
||||||
@ -610,7 +556,6 @@ drop table t1;
|
|||||||
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
|
||||||
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
#connect (thread2, localhost, mysqltest,,);
|
#connect (thread2, localhost, mysqltest,,);
|
||||||
connection thread2;
|
connection thread2;
|
||||||
begin;
|
begin;
|
||||||
@ -620,7 +565,6 @@ drop table t1;
|
|||||||
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
|
||||||
sleep 1;
|
sleep 1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
begin;
|
begin;
|
||||||
--echo ** Update on t1 will cause a table scan which will be blocked because
|
--echo ** Update on t1 will cause a table scan which will be blocked because
|
||||||
@ -639,22 +583,18 @@ drop table t1;
|
|||||||
}
|
}
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
reap;
|
reap;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
send commit;
|
send commit;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
reap;
|
reap;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo ** connection thread1
|
|
||||||
connection thread1;
|
connection thread1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
@ -662,11 +602,9 @@ drop table t1;
|
|||||||
connection thread1;
|
connection thread1;
|
||||||
disconnect thread1;
|
disconnect thread1;
|
||||||
--source include/wait_until_disconnected.inc
|
--source include/wait_until_disconnected.inc
|
||||||
--echo ** connection thread2
|
|
||||||
connection thread2;
|
connection thread2;
|
||||||
disconnect thread2;
|
disconnect thread2;
|
||||||
--source include/wait_until_disconnected.inc
|
--source include/wait_until_disconnected.inc
|
||||||
--echo ** connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop user mysqltest@localhost;
|
drop user mysqltest@localhost;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
SELECT strcmp('a','a ');
|
SELECT strcmp('a','a '), strcmp('a ','a');
|
||||||
SELECT strcmp('a\0','a' );
|
SELECT strcmp('a\0','a' ), strcmp('a','a\0');
|
||||||
SELECT strcmp('a\0','a ');
|
SELECT strcmp('a\0','a '), strcmp('a ','a\0');
|
||||||
SELECT strcmp('a\t','a' );
|
SELECT strcmp('a\t','a' ), strcmp('a', 'a\t');
|
||||||
SELECT strcmp('a\t','a ');
|
SELECT strcmp('a\t','a '), strcmp('a ', 'a\t');
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
# main code went into include/deadlock.inc
|
# main code went into include/deadlock.inc
|
||||||
#
|
#
|
||||||
|
|
||||||
--echo # Establish connection con1 (user=root)
|
|
||||||
connect (con1,localhost,root,,);
|
connect (con1,localhost,root,,);
|
||||||
--echo # Establish connection con2 (user=root)
|
|
||||||
connect (con2,localhost,root,,);
|
connect (con2,localhost,root,,);
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
@ -23,14 +21,12 @@ drop table if exists t1,t2;
|
|||||||
# Testing of FOR UPDATE
|
# Testing of FOR UPDATE
|
||||||
#
|
#
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
eval create table t1 (id integer, x integer) engine = $engine_type;
|
eval create table t1 (id integer, x integer) engine = $engine_type;
|
||||||
insert into t1 values(0, 0);
|
insert into t1 values(0, 0);
|
||||||
set autocommit=0;
|
set autocommit=0;
|
||||||
SELECT * from t1 where id = 0 FOR UPDATE;
|
SELECT * from t1 where id = 0 FOR UPDATE;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
set autocommit=0;
|
set autocommit=0;
|
||||||
|
|
||||||
@ -39,18 +35,15 @@ set autocommit=0;
|
|||||||
update t1 set x=2 where id = 0;
|
update t1 set x=2 where id = 0;
|
||||||
--sleep 2
|
--sleep 2
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
update t1 set x=1 where id = 0;
|
update t1 set x=1 where id = 0;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
reap;
|
reap;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
@ -60,7 +53,6 @@ drop table t1;
|
|||||||
# Testing of FOR UPDATE
|
# Testing of FOR UPDATE
|
||||||
#
|
#
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
eval create table t1 (id integer, x integer) engine = $engine_type;
|
eval create table t1 (id integer, x integer) engine = $engine_type;
|
||||||
eval create table t2 (b integer, a integer) engine = $engine_type;
|
eval create table t2 (b integer, a integer) engine = $engine_type;
|
||||||
@ -73,7 +65,6 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
|
|||||||
select * from t2;
|
select * from t2;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
set autocommit=0;
|
set autocommit=0;
|
||||||
|
|
||||||
@ -82,18 +73,15 @@ set autocommit=0;
|
|||||||
update t1 set x=2 where id = 0;
|
update t1 set x=2 where id = 0;
|
||||||
--sleep 2
|
--sleep 2
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
update t1 set x=1 where id = 0;
|
update t1 set x=1 where id = 0;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
reap;
|
reap;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
@ -105,13 +93,11 @@ insert into t1 values(0, 0), (300, 300);
|
|||||||
insert into t2 values(0, 0), (1, 20), (2, 30);
|
insert into t2 values(0, 0), (1, 20), (2, 30);
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
|
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
|
||||||
select * from t2;
|
select * from t2;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
|
|
||||||
# The following query should hang because con1 is locking the record
|
# The following query should hang because con1 is locking the record
|
||||||
@ -121,24 +107,20 @@ select * from t2;
|
|||||||
update t1 set x=2 where id = 0;
|
update t1 set x=2 where id = 0;
|
||||||
--sleep 2
|
--sleep 2
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
update t1 set x=1 where id = 0;
|
update t1 set x=1 where id = 0;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
reap;
|
reap;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
--echo # Switch to connection default + disconnect con1 and con2
|
|
||||||
connection default;
|
connection default;
|
||||||
disconnect con1;
|
disconnect con1;
|
||||||
disconnect con2;
|
disconnect con2;
|
||||||
|
@ -51,7 +51,6 @@ set GLOBAL query_cache_size=1355776;
|
|||||||
|
|
||||||
reset query cache;
|
reset query cache;
|
||||||
flush status;
|
flush status;
|
||||||
--echo ----- establish connection root -----
|
|
||||||
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection root;
|
connection root;
|
||||||
show grants for current_user;
|
show grants for current_user;
|
||||||
@ -67,7 +66,6 @@ insert into mysqltest.t2 values (3,3,3);
|
|||||||
create table test.t1 (a char (10));
|
create table test.t1 (a char (10));
|
||||||
insert into test.t1 values ("test.t1");
|
insert into test.t1 values ("test.t1");
|
||||||
select * from t1;
|
select * from t1;
|
||||||
--echo ----- establish connection root2 -----
|
|
||||||
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection root2;
|
connection root2;
|
||||||
# put queries in cache
|
# put queries in cache
|
||||||
@ -86,7 +84,6 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
|
|||||||
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
|
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
|
||||||
|
|
||||||
# The following queries should be fetched from cache
|
# The following queries should be fetched from cache
|
||||||
--echo ----- establish connection user1 (user=mysqltest_1) -----
|
|
||||||
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection user1;
|
connection user1;
|
||||||
show grants for current_user();
|
show grants for current_user();
|
||||||
@ -112,14 +109,12 @@ show status like "Qcache_hits";
|
|||||||
show status like "Qcache_not_cached";
|
show status like "Qcache_not_cached";
|
||||||
|
|
||||||
|
|
||||||
--echo ----- establish connection unkuser (user=unkuser) -----
|
|
||||||
# Don't use '' as user because it will pick Unix login
|
# Don't use '' as user because it will pick Unix login
|
||||||
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection unkuser;
|
connection unkuser;
|
||||||
show grants for current_user();
|
show grants for current_user();
|
||||||
|
|
||||||
# The following queries should be fetched from cache
|
# The following queries should be fetched from cache
|
||||||
--echo ----- establish connection user2 (user=mysqltest_2) -----
|
|
||||||
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection user2;
|
connection user2;
|
||||||
select "user2";
|
select "user2";
|
||||||
@ -135,7 +130,6 @@ show status like "Qcache_hits";
|
|||||||
show status like "Qcache_not_cached";
|
show status like "Qcache_not_cached";
|
||||||
|
|
||||||
# The following queries should not be fetched from cache
|
# The following queries should not be fetched from cache
|
||||||
--echo ----- establish connection user3 (user=mysqltest_3) -----
|
|
||||||
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection user3;
|
connection user3;
|
||||||
select "user3";
|
select "user3";
|
||||||
@ -157,7 +151,6 @@ show status like "Qcache_hits";
|
|||||||
show status like "Qcache_not_cached";
|
show status like "Qcache_not_cached";
|
||||||
|
|
||||||
# Connect without a database
|
# Connect without a database
|
||||||
--echo ----- establish connection user4 (user=mysqltest_1) -----
|
|
||||||
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
|
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||||
connection user4;
|
connection user4;
|
||||||
select "user4";
|
select "user4";
|
||||||
@ -175,7 +168,6 @@ show status like "Qcache_not_cached";
|
|||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
||||||
--echo ----- close connections -----
|
|
||||||
connection root;
|
connection root;
|
||||||
disconnect root;
|
disconnect root;
|
||||||
--source include/wait_until_disconnected.inc
|
--source include/wait_until_disconnected.inc
|
||||||
@ -197,7 +189,6 @@ disconnect user4;
|
|||||||
connection unkuser;
|
connection unkuser;
|
||||||
disconnect unkuser;
|
disconnect unkuser;
|
||||||
--source include/wait_until_disconnected.inc
|
--source include/wait_until_disconnected.inc
|
||||||
--echo ----- switch to connection default -----
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -647,23 +647,19 @@ CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
|||||||
CONNECT (c1,localhost,root,,);
|
CONNECT (c1,localhost,root,,);
|
||||||
CONNECT (c2,localhost,root,,);
|
CONNECT (c2,localhost,root,,);
|
||||||
|
|
||||||
--echo switch to connection c1
|
|
||||||
CONNECTION c1;
|
CONNECTION c1;
|
||||||
SET AUTOCOMMIT=0;
|
SET AUTOCOMMIT=0;
|
||||||
INSERT INTO t2 VALUES (1);
|
INSERT INTO t2 VALUES (1);
|
||||||
|
|
||||||
--echo switch to connection c2
|
|
||||||
CONNECTION c2;
|
CONNECTION c2;
|
||||||
SET AUTOCOMMIT=0;
|
SET AUTOCOMMIT=0;
|
||||||
--error ER_LOCK_WAIT_TIMEOUT
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
LOCK TABLES t1 READ, t2 READ;
|
LOCK TABLES t1 READ, t2 READ;
|
||||||
|
|
||||||
--echo switch to connection c1
|
|
||||||
CONNECTION c1;
|
CONNECTION c1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
|
|
||||||
--echo switch to connection default
|
|
||||||
CONNECTION default;
|
CONNECTION default;
|
||||||
SET AUTOCOMMIT=default;
|
SET AUTOCOMMIT=default;
|
||||||
DISCONNECT c1;
|
DISCONNECT c1;
|
||||||
@ -1327,7 +1323,6 @@ connect (con2,localhost,root,,);
|
|||||||
SET SESSION AUTOCOMMIT = 0;
|
SET SESSION AUTOCOMMIT = 0;
|
||||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||||
set binlog_format=mixed;
|
set binlog_format=mixed;
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
|
||||||
eval
|
eval
|
||||||
@ -1343,7 +1338,6 @@ UPDATE t1 SET b = 12 WHERE a = 1;
|
|||||||
--disable_info
|
--disable_info
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
|
|
||||||
--enable_info
|
--enable_info
|
||||||
@ -1352,16 +1346,13 @@ connection con2;
|
|||||||
UPDATE t1 SET b = 21 WHERE a = 1;
|
UPDATE t1 SET b = 21 WHERE a = 1;
|
||||||
--disable_info
|
--disable_info
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
|
||||||
--echo # 2. test for serialized update:
|
--echo # 2. test for serialized update:
|
||||||
@ -1395,12 +1386,10 @@ UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
|
|||||||
--disable_info
|
--disable_info
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
|
|
||||||
--send CALL p1;
|
--send CALL p1;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@ -1413,13 +1402,11 @@ while ($bug31310)
|
|||||||
|
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--reap
|
--reap
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
|
||||||
--echo # 3. test for updated key column:
|
--echo # 3. test for updated key column:
|
||||||
@ -1435,12 +1422,10 @@ UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
|
|||||||
--disable_info
|
--disable_info
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
|
|
||||||
--send CALL p1;
|
--send CALL p1;
|
||||||
|
|
||||||
--echo # Switch to connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
@ -1453,7 +1438,6 @@ while ($bug31310)
|
|||||||
|
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--echo # Switch to connection con2
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--reap
|
--reap
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
@ -1616,23 +1600,18 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
|
|||||||
INSERT INTO t1 VALUES (1),(2),(3);
|
INSERT INTO t1 VALUES (1),(2),(3);
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
--echo # Connection con1
|
|
||||||
connect (con1, localhost, root,,);
|
connect (con1, localhost, root,,);
|
||||||
--send TRUNCATE TABLE t1;
|
--send TRUNCATE TABLE t1;
|
||||||
--echo # Connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
|
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||||
WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
|
WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
--echo # Connection con1
|
|
||||||
connection con1;
|
connection con1;
|
||||||
--echo # Reaping TRUNCATE TABLE
|
--echo # Reaping TRUNCATE TABLE
|
||||||
--reap
|
--reap
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
--echo # Disconnect con1
|
|
||||||
disconnect con1;
|
disconnect con1;
|
||||||
--echo # Connection default
|
|
||||||
connection default;
|
connection default;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -124,7 +124,6 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
|
|||||||
SET @@autocommit=1;
|
SET @@autocommit=1;
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
--echo connection default
|
|
||||||
# This should be 'YES'.
|
# This should be 'YES'.
|
||||||
SHOW VARIABLES LIKE 'have_query_cache';
|
SHOW VARIABLES LIKE 'have_query_cache';
|
||||||
|
|
||||||
@ -142,7 +141,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
|
|
||||||
connection connection1;
|
connection connection1;
|
||||||
--echo connection connection1
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
INSERT INTO t2 VALUES (5,'w');
|
INSERT INTO t2 VALUES (5,'w');
|
||||||
@ -153,7 +151,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
--echo connection default
|
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
@ -163,7 +160,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
|
|
||||||
connection connection1;
|
connection connection1;
|
||||||
--echo connection connection1
|
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
@ -172,7 +168,6 @@ INSERT INTO t2 VALUES (6,'w');
|
|||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
--echo connection default
|
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
@ -181,7 +176,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
|||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
connection connection1;
|
connection connection1;
|
||||||
--echo connection connection1
|
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
|
@ -23,9 +23,7 @@
|
|||||||
set GLOBAL query_cache_type=ON;
|
set GLOBAL query_cache_type=ON;
|
||||||
set LOCAL query_cache_type=ON;
|
set LOCAL query_cache_type=ON;
|
||||||
|
|
||||||
--echo ---- establish connection con1 (root) ----
|
|
||||||
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
|
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
set @initial_query_cache_size = @@global.query_cache_size;
|
set @initial_query_cache_size = @@global.query_cache_size;
|
||||||
@ -55,7 +53,6 @@ show status like 'Qcache_hits';
|
|||||||
execute stmt2;
|
execute stmt2;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
# Another prepared statement (same text, other connection), should hit the QC
|
# Another prepared statement (same text, other connection), should hit the QC
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
prepare stmt3 from "select * from t1 where c1=10";
|
prepare stmt3 from "select * from t1 where c1=10";
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
@ -64,7 +61,6 @@ execute stmt3;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
|
# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
|
||||||
@ -89,20 +85,16 @@ execute stmt10;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
eval $my_stmt;
|
eval $my_stmt;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
eval $my_stmt;
|
eval $my_stmt;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
#
|
#
|
||||||
# Statement without PREPARE.../EXECUTE.... first
|
# Statement without PREPARE.../EXECUTE.... first
|
||||||
let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
|
let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
|
||||||
eval prepare stmt11 from "$my_stmt";
|
eval prepare stmt11 from "$my_stmt";
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
eval prepare stmt12 from "$my_stmt";
|
eval prepare stmt12 from "$my_stmt";
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
eval $my_stmt;
|
eval $my_stmt;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
@ -110,11 +102,9 @@ eval $my_stmt;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt11;
|
execute stmt11;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
execute stmt12;
|
execute stmt12;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
# Query caching also works when statement has parameters
|
# Query caching also works when statement has parameters
|
||||||
@ -127,7 +117,6 @@ execute stmt1 using @a;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt1 using @a;
|
execute stmt1 using @a;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
set @a=1;
|
set @a=1;
|
||||||
prepare stmt4 from "select * from t1 where c1=?";
|
prepare stmt4 from "select * from t1 where c1=?";
|
||||||
@ -139,7 +128,6 @@ execute stmt4 using @a;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt4 using @a;
|
execute stmt4 using @a;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
# See if enabling/disabling the query cache between PREPARE and
|
# See if enabling/disabling the query cache between PREPARE and
|
||||||
@ -168,7 +156,6 @@ execute stmt1;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
# The QC is global = affects also other connections.
|
# The QC is global = affects also other connections.
|
||||||
# Expect to see no additional Qcache_hits.
|
# Expect to see no additional Qcache_hits.
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
@ -178,7 +165,6 @@ execute stmt3;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
#
|
#
|
||||||
# then QC is re-enabled for more EXECUTE.
|
# then QC is re-enabled for more EXECUTE.
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
set global query_cache_size=102400;
|
set global query_cache_size=102400;
|
||||||
# Expect to see additional Qcache_hits.
|
# Expect to see additional Qcache_hits.
|
||||||
@ -193,7 +179,6 @@ show status like 'Qcache_hits';
|
|||||||
execute stmt1;
|
execute stmt1;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
# The QC is global = affects also other connections.
|
# The QC is global = affects also other connections.
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
@ -201,7 +186,6 @@ execute stmt3;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
#
|
#
|
||||||
# then QC is re-disabled for more EXECUTE.
|
# then QC is re-disabled for more EXECUTE.
|
||||||
@ -216,7 +200,6 @@ show status like 'Qcache_hits';
|
|||||||
execute stmt1;
|
execute stmt1;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
# The QC is global = affects also other connections.
|
# The QC is global = affects also other connections.
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
@ -226,15 +209,12 @@ execute stmt3;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
#
|
#
|
||||||
|
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
# QC is disabled at PREPARE
|
# QC is disabled at PREPARE
|
||||||
set global query_cache_size=0;
|
set global query_cache_size=0;
|
||||||
prepare stmt1 from "select * from t1 where c1=10";
|
prepare stmt1 from "select * from t1 where c1=10";
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
prepare stmt3 from "select * from t1 where c1=10";
|
prepare stmt3 from "select * from t1 where c1=10";
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
# then QC is enabled at EXECUTE
|
# then QC is enabled at EXECUTE
|
||||||
set global query_cache_size=102400;
|
set global query_cache_size=102400;
|
||||||
@ -246,7 +226,6 @@ show status like 'Qcache_hits';
|
|||||||
execute stmt1;
|
execute stmt1;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
# The QC is global = affects also other connections.
|
# The QC is global = affects also other connections.
|
||||||
--echo ---- switch to connection con1 ----
|
|
||||||
connection con1;
|
connection con1;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
@ -255,7 +234,6 @@ execute stmt3;
|
|||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
execute stmt3;
|
execute stmt3;
|
||||||
show status like 'Qcache_hits';
|
show status like 'Qcache_hits';
|
||||||
--echo ---- switch to connection default ----
|
|
||||||
connection default;
|
connection default;
|
||||||
#
|
#
|
||||||
# QC is disabled at PREPARE
|
# QC is disabled at PREPARE
|
||||||
@ -276,7 +254,6 @@ show status like 'Qcache_hits';
|
|||||||
|
|
||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
--echo ---- disconnect connection con1 ----
|
|
||||||
disconnect con1;
|
disconnect con1;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -51,7 +51,9 @@ if ($rpl_debug)
|
|||||||
{
|
{
|
||||||
--echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
|
--echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
|
||||||
}
|
}
|
||||||
|
disable_connect_log;
|
||||||
--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
|
--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
|
||||||
|
enable_connect_log;
|
||||||
|
|
||||||
|
|
||||||
--let $include_filename= rpl_connect.inc
|
--let $include_filename= rpl_connect.inc
|
||||||
|
@ -43,5 +43,7 @@ if ($_include_file_depth)
|
|||||||
--echo [connection $rpl_connection_name]
|
--echo [connection $rpl_connection_name]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
disable_connect_log;
|
||||||
--connection $rpl_connection_name
|
--connection $rpl_connection_name
|
||||||
|
enable_connect_log;
|
||||||
--let $rpl_connection_name=
|
--let $rpl_connection_name=
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
let $rpl_connection_name= master;
|
|
||||||
source include/rpl_connection.inc;
|
|
@ -1,2 +0,0 @@
|
|||||||
let $rpl_connection_name= slave;
|
|
||||||
source include/rpl_connection.inc;
|
|
@ -1,2 +0,0 @@
|
|||||||
let $rpl_connection_name= slave1;
|
|
||||||
source include/rpl_connection.inc;
|
|
@ -1,13 +1,9 @@
|
|||||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
|
||||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||||
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
|
|
||||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||||
--echo connection master;
|
|
||||||
connection master;
|
connection master;
|
||||||
reset master;
|
reset master;
|
||||||
source include/show_master_status.inc;
|
source include/show_master_status.inc;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
--echo connection slave;
|
|
||||||
connection slave;
|
connection slave;
|
||||||
reset slave;
|
reset slave;
|
||||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||||
@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
|||||||
eval change master to master_host='$IPv6';
|
eval change master to master_host='$IPv6';
|
||||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||||
--echo Master-Host: $master_host
|
--echo Master-Host: $master_host
|
||||||
--echo disconnect slave;
|
|
||||||
disconnect slave;
|
disconnect slave;
|
||||||
--echo disconnect master;
|
|
||||||
disconnect master;
|
disconnect master;
|
||||||
--echo connection default;
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
|
|
||||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
|
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
|
||||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
|
||||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||||
--echo connection master;
|
|
||||||
connection master;
|
connection master;
|
||||||
reset master;
|
reset master;
|
||||||
source include/show_master_status.inc;
|
source include/show_master_status.inc;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
--echo connection slave;
|
|
||||||
connection slave;
|
connection slave;
|
||||||
reset slave;
|
reset slave;
|
||||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||||
@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
|||||||
eval change master to master_host='$IPv6';
|
eval change master to master_host='$IPv6';
|
||||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||||
--echo Master-Host: $master_host
|
--echo Master-Host: $master_host
|
||||||
--echo disconnect slave;
|
|
||||||
disconnect slave;
|
disconnect slave;
|
||||||
--echo disconnect master;
|
|
||||||
disconnect master;
|
disconnect master;
|
||||||
--echo connection default;
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
|
@ -1,22 +1,15 @@
|
|||||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
|
||||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
|
||||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||||
--echo connection master;
|
|
||||||
connection master;
|
connection master;
|
||||||
reset master;
|
reset master;
|
||||||
source include/show_master_status.inc;
|
source include/show_master_status.inc;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
--echo connection slave;
|
|
||||||
connection slave;
|
connection slave;
|
||||||
reset slave;
|
reset slave;
|
||||||
eval change master to master_host='$IPv6';
|
eval change master to master_host='$IPv6';
|
||||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||||
--echo Master-Host: $master_host
|
--echo Master-Host: $master_host
|
||||||
--echo disconnect slave;
|
|
||||||
disconnect slave;
|
disconnect slave;
|
||||||
--echo disconnect master;
|
|
||||||
disconnect master;
|
disconnect master;
|
||||||
--echo connection default;
|
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
|
@ -19,12 +19,10 @@ if ($LOAD_LOCAL)
|
|||||||
}
|
}
|
||||||
|
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
echo ----------content on master----------;
|
|
||||||
SELECT hex(cl) FROM t;
|
SELECT hex(cl) FROM t;
|
||||||
|
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
echo ----------content on slave----------;
|
|
||||||
USE mysqltest;
|
USE mysqltest;
|
||||||
SELECT hex(cl) FROM t;
|
SELECT hex(cl) FROM t;
|
||||||
|
|
||||||
|
@ -70,8 +70,6 @@ let $_log_num_s= `select @aux`;
|
|||||||
###############################################################
|
###############################################################
|
||||||
# INSERT
|
# INSERT
|
||||||
###############################################################
|
###############################################################
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
# Maybe it would be smarter to use a table with an autoincrement column.
|
# Maybe it would be smarter to use a table with an autoincrement column.
|
||||||
let $MAX= `SELECT MAX(f1) FROM t1` ;
|
let $MAX= `SELECT MAX(f1) FROM t1` ;
|
||||||
@ -85,8 +83,6 @@ if ($show_binlog)
|
|||||||
}
|
}
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
# results before DDL(to be tested)
|
# results before DDL(to be tested)
|
||||||
SELECT MAX(f1) FROM t1;
|
SELECT MAX(f1) FROM t1;
|
||||||
@ -99,8 +95,6 @@ if ($show_binlog)
|
|||||||
###############################################################
|
###############################################################
|
||||||
# command to be tested
|
# command to be tested
|
||||||
###############################################################
|
###############################################################
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
eval $my_stmt;
|
eval $my_stmt;
|
||||||
# Devaluate $my_stmt, to detect script bugs
|
# Devaluate $my_stmt, to detect script bugs
|
||||||
@ -114,8 +108,6 @@ if ($show_binlog)
|
|||||||
}
|
}
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
# results after DDL(to be tested)
|
# results after DDL(to be tested)
|
||||||
SELECT MAX(f1) FROM t1;
|
SELECT MAX(f1) FROM t1;
|
||||||
@ -128,8 +120,6 @@ if ($show_binlog)
|
|||||||
###############################################################
|
###############################################################
|
||||||
# ROLLBACK
|
# ROLLBACK
|
||||||
###############################################################
|
###############################################################
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
# results after final ROLLBACK
|
# results after final ROLLBACK
|
||||||
@ -151,8 +141,6 @@ if ($show_binlog)
|
|||||||
}
|
}
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
# results after final ROLLBACK
|
# results after final ROLLBACK
|
||||||
SELECT MAX(f1) FROM t1;
|
SELECT MAX(f1) FROM t1;
|
||||||
@ -181,16 +169,12 @@ if ($manipulate)
|
|||||||
# - flush the master and the slave log
|
# - flush the master and the slave log
|
||||||
# ---> both start to write into new logs with incremented number
|
# ---> both start to write into new logs with incremented number
|
||||||
# - increment $_log_num_n
|
# - increment $_log_num_n
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
flush logs;
|
flush logs;
|
||||||
# sleep 1;
|
# sleep 1;
|
||||||
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
|
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to slave --------
|
|
||||||
connection slave;
|
connection slave;
|
||||||
# the final content of the binary log
|
# the final content of the binary log
|
||||||
flush logs;
|
flush logs;
|
||||||
@ -202,6 +186,4 @@ flush logs;
|
|||||||
inc $_log_num_n;
|
inc $_log_num_n;
|
||||||
}
|
}
|
||||||
|
|
||||||
--echo
|
|
||||||
--echo -------- switch to master -------
|
|
||||||
connection master;
|
connection master;
|
||||||
|
@ -81,7 +81,9 @@ while ($_rpl_i) {
|
|||||||
}
|
}
|
||||||
if ($rpl_only_running_threads)
|
if ($rpl_only_running_threads)
|
||||||
{
|
{
|
||||||
|
disable_connect_log;
|
||||||
--connection server_$_rpl_server
|
--connection server_$_rpl_server
|
||||||
|
enable_connect_log;
|
||||||
--let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
|
--let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
|
||||||
--let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
|
--let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
|
||||||
if ($rpl_debug)
|
if ($rpl_debug)
|
||||||
@ -92,7 +94,9 @@ while ($_rpl_i) {
|
|||||||
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
|
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
|
||||||
if ($_rpl_slave_io_running)
|
if ($_rpl_slave_io_running)
|
||||||
{
|
{
|
||||||
|
disable_query_log;
|
||||||
--connection server_$_rpl_prev_server
|
--connection server_$_rpl_prev_server
|
||||||
|
enable_query_log;
|
||||||
if ($_rpl_slave_sql_running)
|
if ($_rpl_slave_sql_running)
|
||||||
{
|
{
|
||||||
if ($rpl_debug)
|
if ($rpl_debug)
|
||||||
@ -101,7 +105,9 @@ while ($_rpl_i) {
|
|||||||
--let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
|
--let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
|
||||||
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
|
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
|
||||||
}
|
}
|
||||||
|
disable_connect_log;
|
||||||
--sync_slave_with_master server_$_rpl_server
|
--sync_slave_with_master server_$_rpl_server
|
||||||
|
enable_connect_log;
|
||||||
}
|
}
|
||||||
if (!$_rpl_slave_sql_running)
|
if (!$_rpl_slave_sql_running)
|
||||||
{
|
{
|
||||||
@ -119,6 +125,7 @@ while ($_rpl_i) {
|
|||||||
}
|
}
|
||||||
if (!$rpl_only_running_threads)
|
if (!$rpl_only_running_threads)
|
||||||
{
|
{
|
||||||
|
disable_connect_log;
|
||||||
--connection server_$_rpl_prev_server
|
--connection server_$_rpl_prev_server
|
||||||
if ($rpl_debug)
|
if ($rpl_debug)
|
||||||
{
|
{
|
||||||
@ -127,6 +134,7 @@ while ($_rpl_i) {
|
|||||||
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
|
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
|
||||||
}
|
}
|
||||||
--sync_slave_with_master server_$_rpl_server
|
--sync_slave_with_master server_$_rpl_server
|
||||||
|
enable_connect_log;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ drop table if exists t1;
|
|||||||
# Test 1) Test UDFs via loadable libraries
|
# Test 1) Test UDFs via loadable libraries
|
||||||
#
|
#
|
||||||
--echo "*** Test 1) Test UDFs via loadable libraries ***
|
--echo "*** Test 1) Test UDFs via loadable libraries ***
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
|
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
|
||||||
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
|
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
|
||||||
@ -48,7 +47,6 @@ connection slave;
|
|||||||
sync_with_master;
|
sync_with_master;
|
||||||
|
|
||||||
# Check to see that UDF CREATE statements were replicated
|
# Check to see that UDF CREATE statements were replicated
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
--replace_column 3 UDF_LIB
|
--replace_column 3 UDF_LIB
|
||||||
SELECT * FROM mysql.func ORDER BY name;
|
SELECT * FROM mysql.func ORDER BY name;
|
||||||
@ -57,7 +55,6 @@ SELECT * FROM mysql.func ORDER BY name;
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Use the UDFs to do something
|
# Use the UDFs to do something
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
|
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
@ -72,7 +69,6 @@ SELECT * FROM t1 ORDER BY sum;
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see if data was replicated
|
# Check to see if data was replicated
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT * FROM t1 ORDER BY sum;
|
SELECT * FROM t1 ORDER BY sum;
|
||||||
|
|
||||||
@ -84,7 +80,6 @@ SELECT myfunc_double(75.00);
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Drop the functions
|
# Drop the functions
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
DROP FUNCTION myfunc_double;
|
DROP FUNCTION myfunc_double;
|
||||||
DROP FUNCTION myfunc_int;
|
DROP FUNCTION myfunc_int;
|
||||||
@ -94,7 +89,6 @@ SELECT * FROM mysql.func ORDER BY name;
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see if the UDFs were dropped on the slave
|
# Check to see if the UDFs were dropped on the slave
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT * FROM mysql.func ORDER BY name;
|
SELECT * FROM mysql.func ORDER BY name;
|
||||||
--disable_info
|
--disable_info
|
||||||
@ -102,7 +96,6 @@ SELECT * FROM mysql.func ORDER BY name;
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
--disable_info
|
--disable_info
|
||||||
@ -111,7 +104,6 @@ DROP TABLE t1;
|
|||||||
# Test 2) Test UDFs with SQL body
|
# Test 2) Test UDFs with SQL body
|
||||||
#
|
#
|
||||||
--echo "*** Test 2) Test UDFs with SQL body ***
|
--echo "*** Test 2) Test UDFs with SQL body ***
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
|
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
|
||||||
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
|
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
|
||||||
@ -121,7 +113,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see that UDF CREATE statements were replicated
|
# Check to see that UDF CREATE statements were replicated
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||||
--disable_info
|
--disable_info
|
||||||
@ -129,7 +120,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Use the UDFs to do something
|
# Use the UDFs to do something
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
|
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
|
||||||
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
|
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
|
||||||
@ -142,7 +132,6 @@ SELECT * FROM t1 ORDER BY sum;
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see if data was replicated
|
# Check to see if data was replicated
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT * FROM t1 ORDER BY sum;
|
SELECT * FROM t1 ORDER BY sum;
|
||||||
--disable_info
|
--disable_info
|
||||||
@ -150,7 +139,6 @@ SELECT * FROM t1 ORDER BY sum;
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Modify the UDFs to add a comment
|
# Modify the UDFs to add a comment
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
|
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
|
||||||
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
|
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
|
||||||
@ -160,7 +148,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see if data was replicated
|
# Check to see if data was replicated
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||||
|
|
||||||
@ -172,7 +159,6 @@ SELECT myfuncsql_double(75.00);
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Drop the functions
|
# Drop the functions
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
DROP FUNCTION myfuncsql_double;
|
DROP FUNCTION myfuncsql_double;
|
||||||
DROP FUNCTION myfuncsql_int;
|
DROP FUNCTION myfuncsql_int;
|
||||||
@ -182,7 +168,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
# Check to see if the UDFs were dropped on the slave
|
# Check to see if the UDFs were dropped on the slave
|
||||||
--echo "Running on the slave"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||||
--disable_info
|
--disable_info
|
||||||
@ -190,7 +175,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
|
|||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
--echo "Running on the master"
|
|
||||||
--enable_info
|
--enable_info
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
--disable_info
|
--disable_info
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
FLUSH STATUS;
|
FLUSH STATUS;
|
||||||
|
connect con1,localhost,root,,;
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
|
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
|
||||||
VARIABLE_VALUE
|
VARIABLE_VALUE
|
||||||
0
|
0
|
||||||
|
connect con2,localhost,root,,;
|
||||||
KILL CONNECTION_ID();
|
KILL CONNECTION_ID();
|
||||||
ERROR 70100: Connection was killed
|
ERROR 70100: Connection was killed
|
||||||
|
disconnect con2;
|
||||||
|
connection default;
|
||||||
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
|
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
|
||||||
VARIABLE_VALUE
|
VARIABLE_VALUE
|
||||||
1
|
1
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,8 @@
|
|||||||
drop table if exists t1, t2;
|
drop table if exists t1, t2;
|
||||||
set debug_sync='RESET';
|
set debug_sync='RESET';
|
||||||
|
connect addconroot, localhost, root,,;
|
||||||
|
connect addconroot2, localhost, root,,;
|
||||||
|
connection default;
|
||||||
create table t1 (n1 int, n2 int, n3 int,
|
create table t1 (n1 int, n2 int, n3 int,
|
||||||
key (n1, n2, n3),
|
key (n1, n2, n3),
|
||||||
key (n2, n3, n1),
|
key (n2, n3, n1),
|
||||||
@ -10,10 +13,15 @@ insert into t1 values (1, 2, 3);
|
|||||||
reset master;
|
reset master;
|
||||||
set debug_sync='alter_table_enable_indexes SIGNAL parked WAIT_FOR go';
|
set debug_sync='alter_table_enable_indexes SIGNAL parked WAIT_FOR go';
|
||||||
alter table t1 enable keys;;
|
alter table t1 enable keys;;
|
||||||
|
connection addconroot;
|
||||||
set debug_sync='now WAIT_FOR parked';
|
set debug_sync='now WAIT_FOR parked';
|
||||||
insert into t2 values (1);
|
insert into t2 values (1);
|
||||||
insert into t1 values (1, 1, 1);;
|
insert into t1 values (1, 1, 1);;
|
||||||
|
connection addconroot2;
|
||||||
set debug_sync='now SIGNAL go';
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
connection addconroot;
|
||||||
|
connection default;
|
||||||
include/show_binlog_events.inc
|
include/show_binlog_events.inc
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||||
@ -25,36 +33,60 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
|||||||
master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1)
|
master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1)
|
||||||
master-bin.000001 # Query # # COMMIT
|
master-bin.000001 # Query # # COMMIT
|
||||||
drop tables t1, t2;
|
drop tables t1, t2;
|
||||||
|
disconnect addconroot;
|
||||||
|
disconnect addconroot2;
|
||||||
set debug_sync='RESET';
|
set debug_sync='RESET';
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
drop table if exists t1, t2, t3;
|
drop table if exists t1, t2, t3;
|
||||||
|
connect addconroot, localhost, root,,;
|
||||||
|
connect addconroot2, localhost, root,,;
|
||||||
|
connection default;
|
||||||
create table t1 (i int);
|
create table t1 (i int);
|
||||||
reset master;
|
reset master;
|
||||||
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
||||||
alter table t1 change i c char(10) default 'Test1';;
|
alter table t1 change i c char(10) default 'Test1';;
|
||||||
|
connection addconroot;
|
||||||
set debug_sync='now WAIT_FOR parked';
|
set debug_sync='now WAIT_FOR parked';
|
||||||
insert into t1 values ();;
|
insert into t1 values ();;
|
||||||
|
connection addconroot2;
|
||||||
set debug_sync='now SIGNAL go';
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
connection addconroot;
|
||||||
|
connection default;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
c
|
c
|
||||||
Test1
|
Test1
|
||||||
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
||||||
alter table t1 change c vc varchar(100) default 'Test2';;
|
alter table t1 change c vc varchar(100) default 'Test2';;
|
||||||
|
connection addconroot;
|
||||||
set debug_sync='now WAIT_FOR parked';
|
set debug_sync='now WAIT_FOR parked';
|
||||||
rename table t1 to t2;;
|
rename table t1 to t2;;
|
||||||
|
connection addconroot2;
|
||||||
set debug_sync='now SIGNAL go';
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
connection addconroot;
|
||||||
|
connection default;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
create table t1 (i int);
|
create table t1 (i int);
|
||||||
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
||||||
alter table t1 change i c char(10) default 'Test3', rename to t2;;
|
alter table t1 change i c char(10) default 'Test3', rename to t2;;
|
||||||
|
connection addconroot;
|
||||||
set debug_sync='now WAIT_FOR parked';
|
set debug_sync='now WAIT_FOR parked';
|
||||||
insert into t2 values();;
|
insert into t2 values();;
|
||||||
|
connection addconroot2;
|
||||||
set debug_sync='now SIGNAL go';
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
connection addconroot;
|
||||||
|
connection default;
|
||||||
select * from t2;
|
select * from t2;
|
||||||
c
|
c
|
||||||
Test3
|
Test3
|
||||||
alter table t2 change c vc varchar(100) default 'Test2', rename to t1;;
|
alter table t2 change c vc varchar(100) default 'Test2', rename to t1;;
|
||||||
|
connection addconroot;
|
||||||
|
connection default;
|
||||||
rename table t1 to t3;
|
rename table t1 to t3;
|
||||||
|
disconnect addconroot;
|
||||||
|
disconnect addconroot2;
|
||||||
drop table t3;
|
drop table t3;
|
||||||
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
|
||||||
set debug_sync='RESET';
|
set debug_sync='RESET';
|
||||||
|
@ -1681,16 +1681,17 @@ CREATE TABLE t1(a INT PRIMARY KEY, b INT);
|
|||||||
INSERT INTO t1 VALUES (1,1), (2,2);
|
INSERT INTO t1 VALUES (1,1), (2,2);
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES (3,3);
|
INSERT INTO t1 VALUES (3,3);
|
||||||
# Connection con1
|
connect con1, localhost, root;
|
||||||
# Sending:
|
# Sending:
|
||||||
ALTER TABLE t1 DISABLE KEYS;
|
ALTER TABLE t1 DISABLE KEYS;
|
||||||
# Connection default
|
connection default;
|
||||||
# Waiting until ALTER TABLE is blocked.
|
# Waiting until ALTER TABLE is blocked.
|
||||||
UPDATE t1 SET b = 4;
|
UPDATE t1 SET b = 4;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
# Connection con1
|
connection con1;
|
||||||
# Reaping: ALTER TABLE t1 DISABLE KEYS
|
# Reaping: ALTER TABLE t1 DISABLE KEYS
|
||||||
# Connection default
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
# 7: Which operations require copy and which can be done in-place?
|
# 7: Which operations require copy and which can be done in-place?
|
||||||
|
@ -242,6 +242,8 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
|||||||
select database();
|
select database();
|
||||||
database()
|
database()
|
||||||
test
|
test
|
||||||
|
connect con1,localhost,root,,*NO-ONE*;
|
||||||
|
connection con1;
|
||||||
select database();
|
select database();
|
||||||
database()
|
database()
|
||||||
NULL
|
NULL
|
||||||
@ -265,6 +267,8 @@ ANALYZE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
#
|
#
|
||||||
# MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print
|
# MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
create table t1 (f int, key(f)) engine=myisam;
|
create table t1 (f int, key(f)) engine=myisam;
|
||||||
set global kc1.key_buffer_size = 65536;
|
set global kc1.key_buffer_size = 65536;
|
||||||
|
connect con1, localhost, root;
|
||||||
set debug_sync='assign_key_cache_op_unlock wait_for op_locked';
|
set debug_sync='assign_key_cache_op_unlock wait_for op_locked';
|
||||||
cache index t1 in kc1;
|
cache index t1 in kc1;
|
||||||
|
connection default;
|
||||||
set debug_sync='assign_key_cache_op_lock signal op_locked wait_for assigned';
|
set debug_sync='assign_key_cache_op_lock signal op_locked wait_for assigned';
|
||||||
cache index t1 in kc1;
|
cache index t1 in kc1;
|
||||||
|
connection con1;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 assign_to_keycache status OK
|
test.t1 assign_to_keycache status OK
|
||||||
set debug_sync='now signal assigned';
|
set debug_sync='now signal assigned';
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 assign_to_keycache status OK
|
test.t1 assign_to_keycache status OK
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
INSTALL SONAME 'auth_named_pipe';
|
INSTALL SONAME 'auth_named_pipe';
|
||||||
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
|
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
|
||||||
|
connect pipe_con,localhost,$USERNAME,,,,,PIPE;
|
||||||
SELECT USER(),CURRENT_USER();
|
SELECT USER(),CURRENT_USER();
|
||||||
USER() CURRENT_USER()
|
USER() CURRENT_USER()
|
||||||
USERNAME@localhost USERNAME@%
|
USERNAME@localhost USERNAME@%
|
||||||
|
disconnect pipe_con;
|
||||||
|
connection default;
|
||||||
DROP USER 'USERNAME';
|
DROP USER 'USERNAME';
|
||||||
CREATE USER nosuchuser IDENTIFIED WITH named_pipe;
|
CREATE USER nosuchuser IDENTIFIED WITH named_pipe;
|
||||||
ERROR 28000: Access denied for user 'nosuchuser'@'localhost'
|
ERROR 28000: Access denied for user 'nosuchuser'@'localhost'
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
include/master-slave.inc
|
include/master-slave.inc
|
||||||
[connection master]
|
[connection master]
|
||||||
[connection slave]
|
connection slave;
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
[connection master]
|
connection master;
|
||||||
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
|
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
|
||||||
GRANT REPLICATION SLAVE ON *.* TO plug_user;
|
GRANT REPLICATION SLAVE ON *.* TO plug_user;
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
[connection slave]
|
connection slave;
|
||||||
CHANGE MASTER TO
|
CHANGE MASTER TO
|
||||||
MASTER_USER= 'plug_user',
|
MASTER_USER= 'plug_user',
|
||||||
MASTER_PASSWORD= 'plug_user';
|
MASTER_PASSWORD= 'plug_user';
|
||||||
include/start_slave.inc
|
include/start_slave.inc
|
||||||
|
connection master;
|
||||||
|
connection slave;
|
||||||
# Slave in-sync with master now.
|
# Slave in-sync with master now.
|
||||||
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
|
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
|
||||||
user plugin authentication_string
|
user plugin authentication_string
|
||||||
@ -20,5 +22,6 @@ include/stop_slave.inc
|
|||||||
CHANGE MASTER TO MASTER_USER='root';
|
CHANGE MASTER TO MASTER_USER='root';
|
||||||
DROP USER 'plug_user';
|
DROP USER 'plug_user';
|
||||||
# Cleanup (on master).
|
# Cleanup (on master).
|
||||||
|
connection master;
|
||||||
DROP USER 'plug_user';
|
DROP USER 'plug_user';
|
||||||
include/rpl_end.inc
|
include/rpl_end.inc
|
||||||
|
@ -8,25 +8,30 @@ INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
|
|||||||
(12,13),(7,14);
|
(12,13),(7,14);
|
||||||
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
|
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
|
||||||
(11),(12),(13),(14);
|
(11),(12),(13),(14);
|
||||||
# in thread1
|
connect thread1, localhost, root,,;
|
||||||
|
connect thread2, localhost, root,,;
|
||||||
|
connection thread1;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
# in thread2
|
connection thread2;
|
||||||
REPLACE INTO t2 VALUES (-17);
|
REPLACE INTO t2 VALUES (-17);
|
||||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
||||||
d
|
d
|
||||||
# in thread1
|
connection thread1;
|
||||||
REPLACE INTO t1(a,b) VALUES (67,20);
|
REPLACE INTO t1(a,b) VALUES (67,20);
|
||||||
# in thread2
|
connection thread2;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
REPLACE INTO t1(a,b) VALUES (65,-50);
|
REPLACE INTO t1(a,b) VALUES (65,-50);
|
||||||
REPLACE INTO t2 VALUES (-91);
|
REPLACE INTO t2 VALUES (-91);
|
||||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
||||||
# in thread1
|
connection thread1;
|
||||||
# should not crash
|
# should not crash
|
||||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
|
||||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||||
# in thread2
|
connection thread2;
|
||||||
d
|
d
|
||||||
# in thread1;
|
disconnect thread2;
|
||||||
|
connection thread1;
|
||||||
|
disconnect thread1;
|
||||||
|
connection default;
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
@ -5,6 +5,8 @@ CREATE USER user1@localhost;
|
|||||||
CREATE DATABASE db1;
|
CREATE DATABASE db1;
|
||||||
GRANT ALL PRIVILEGES ON db1.* TO user1@localhost;
|
GRANT ALL PRIVILEGES ON db1.* TO user1@localhost;
|
||||||
CREATE TABLE db1.t1(a INT);
|
CREATE TABLE db1.t1(a INT);
|
||||||
|
connect con1,localhost,user1,,;
|
||||||
|
connection con1;
|
||||||
SELECT CURRENT_USER();
|
SELECT CURRENT_USER();
|
||||||
CURRENT_USER()
|
CURRENT_USER()
|
||||||
user1@localhost
|
user1@localhost
|
||||||
@ -13,5 +15,7 @@ Variable_name Value
|
|||||||
read_only ON
|
read_only ON
|
||||||
INSERT INTO db1.t1 VALUES (1);
|
INSERT INTO db1.t1 VALUES (1);
|
||||||
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
||||||
|
connection default;
|
||||||
|
disconnect con1;
|
||||||
DROP DATABASE db1;
|
DROP DATABASE db1;
|
||||||
DROP USER user1@localhost;
|
DROP USER user1@localhost;
|
||||||
|
@ -131,9 +131,10 @@ select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t
|
|||||||
id a
|
id a
|
||||||
1 me
|
1 me
|
||||||
drop table t3,t2,t1;
|
drop table t3,t2,t1;
|
||||||
|
connect connection1,localhost,root,,;
|
||||||
SET SESSION STORAGE_ENGINE = InnoDB;
|
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||||
SET @@autocommit=1;
|
SET @@autocommit=1;
|
||||||
connection default
|
connection default;
|
||||||
SHOW VARIABLES LIKE 'have_query_cache';
|
SHOW VARIABLES LIKE 'have_query_cache';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
have_query_cache YES
|
have_query_cache YES
|
||||||
@ -155,7 +156,7 @@ count(*)
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 0
|
Qcache_queries_in_cache 0
|
||||||
connection connection1
|
connection connection1;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
@ -171,7 +172,7 @@ count(*)
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 0
|
Qcache_queries_in_cache 0
|
||||||
connection default
|
connection default;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
@ -185,7 +186,7 @@ count(*)
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 1
|
Qcache_queries_in_cache 1
|
||||||
connection connection1
|
connection connection1;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
2
|
2
|
||||||
@ -197,7 +198,7 @@ INSERT INTO t2 VALUES (6,'w');
|
|||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
3
|
3
|
||||||
connection default
|
connection default;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
2
|
2
|
||||||
@ -210,7 +211,7 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
|||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection connection1
|
connection connection1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||||
count(*)
|
count(*)
|
||||||
@ -221,6 +222,8 @@ Qcache_queries_in_cache 1
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 1
|
Qcache_hits 1
|
||||||
|
disconnect connection1;
|
||||||
|
connection default;
|
||||||
set @@global.query_cache_size = @save_query_cache_size;
|
set @@global.query_cache_size = @save_query_cache_size;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
SET global query_cache_type=default;
|
SET global query_cache_type=default;
|
||||||
|
@ -713,6 +713,7 @@ DROP TABLE t1;
|
|||||||
SET @@GLOBAL.max_allowed_packet=2048;
|
SET @@GLOBAL.max_allowed_packet=2048;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
|
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
|
||||||
|
connect newconn, localhost, root,,;
|
||||||
SELECT CONVERT('a', BINARY(2049));
|
SELECT CONVERT('a', BINARY(2049));
|
||||||
CONVERT('a', BINARY(2049))
|
CONVERT('a', BINARY(2049))
|
||||||
a |