mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
merge
This commit is contained in:
commit
7ddb103b8e
241 changed files with 7437 additions and 1144 deletions
|
@ -1,4 +1,4 @@
|
|||
[MYSQL]
|
||||
post_commit_to = "commits@lists.mysql.com"
|
||||
post_push_to = "commits@lists.mysql.com"
|
||||
tree_name = "mysql-5.4"
|
||||
tree_name = "mysql-5.4.5-next-mr"
|
||||
|
|
|
@ -73,6 +73,11 @@ check_cpu () {
|
|||
Alpha*EV6*)
|
||||
cpu_arg="ev6";
|
||||
;;
|
||||
#Core 2 Duo
|
||||
*Intel*Core\(TM\)2*)
|
||||
cpu_arg="nocona"
|
||||
core2="yes"
|
||||
;;
|
||||
# Intel ia32
|
||||
*Intel*Core*|*X[eE][oO][nN]*)
|
||||
# a Xeon is just another pentium4 ...
|
||||
|
@ -137,10 +142,6 @@ check_cpu () {
|
|||
*i386*)
|
||||
cpu_arg="i386"
|
||||
;;
|
||||
#Core 2 Duo
|
||||
*Intel*Core\(TM\)2*)
|
||||
cpu_arg="nocona"
|
||||
;;
|
||||
# Intel ia64
|
||||
*Itanium*)
|
||||
cpu_arg="itanium"
|
||||
|
|
|
@ -137,6 +137,7 @@ ENDIF(MSVC)
|
|||
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
|
||||
ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# default to x86 platform. We'll check for X64 in a bit
|
||||
|
|
|
@ -86,7 +86,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#undef bcmp // Fix problem with new readline
|
||||
#if defined( __WIN__)
|
||||
#if defined(__WIN__)
|
||||
#include <conio.h>
|
||||
#elif !defined(__NETWARE__)
|
||||
#include <readline/readline.h>
|
||||
|
@ -106,7 +106,7 @@ extern "C" {
|
|||
#define cmp_database(cs,A,B) strcmp((A),(B))
|
||||
#endif
|
||||
|
||||
#if !defined( __WIN__) && !defined(__NETWARE__) && !defined(THREAD)
|
||||
#if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD)
|
||||
#define USE_POPEN
|
||||
#endif
|
||||
|
||||
|
@ -1862,7 +1862,7 @@ static int read_and_execute(bool interactive)
|
|||
if (opt_outfile && glob_buffer.is_empty())
|
||||
fflush(OUTFILE);
|
||||
|
||||
#if defined( __WIN__) || defined(__NETWARE__)
|
||||
#if defined(__WIN__) || defined(__NETWARE__)
|
||||
tee_fputs(prompt, stdout);
|
||||
#if defined(__NETWARE__)
|
||||
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
|
||||
|
@ -1873,7 +1873,7 @@ static int read_and_execute(bool interactive)
|
|||
if (p != NULL)
|
||||
*p = '\0';
|
||||
}
|
||||
#else defined(__WIN__)
|
||||
#else
|
||||
if (!tmpbuf.is_alloced())
|
||||
tmpbuf.alloc(65535);
|
||||
tmpbuf.length(0);
|
||||
|
@ -1899,7 +1899,7 @@ static int read_and_execute(bool interactive)
|
|||
if (opt_outfile)
|
||||
fputs(prompt, OUTFILE);
|
||||
line= readline(prompt);
|
||||
#endif /* defined( __WIN__) || defined(__NETWARE__) */
|
||||
#endif /* defined(__WIN__) || defined(__NETWARE__) */
|
||||
|
||||
/*
|
||||
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
|
||||
|
@ -1947,10 +1947,10 @@ static int read_and_execute(bool interactive)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( __WIN__) || defined(__NETWARE__)
|
||||
#if defined(__WIN__) || defined(__NETWARE__)
|
||||
buffer.free();
|
||||
#endif
|
||||
#if defined( __WIN__)
|
||||
#if defined(__WIN__)
|
||||
tmpbuf.free();
|
||||
#endif
|
||||
|
||||
|
@ -3819,7 +3819,8 @@ com_edit(String *buffer,char *line __attribute__((unused)))
|
|||
!(editor = (char *)getenv("VISUAL")))
|
||||
editor = "vi";
|
||||
strxmov(buff,editor," ",filename,NullS);
|
||||
(void) system(buff);
|
||||
if(system(buff) == -1)
|
||||
goto err;
|
||||
|
||||
MY_STAT stat_arg;
|
||||
if (!my_stat(filename,&stat_arg,MYF(MY_WME)))
|
||||
|
@ -4602,7 +4603,7 @@ void tee_putc(int c, FILE *file)
|
|||
putc(c, OUTFILE);
|
||||
}
|
||||
|
||||
#if defined( __WIN__) || defined(__NETWARE__)
|
||||
#if defined(__WIN__) || defined(__NETWARE__)
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/times.h>
|
||||
|
@ -4614,7 +4615,7 @@ void tee_putc(int c, FILE *file)
|
|||
|
||||
static ulong start_timer(void)
|
||||
{
|
||||
#if defined( __WIN__) || defined(__NETWARE__)
|
||||
#if defined(__WIN__) || defined(__NETWARE__)
|
||||
return clock();
|
||||
#else
|
||||
struct tms tms_tmp;
|
||||
|
|
|
@ -552,6 +552,7 @@ static int upgrade_already_done(void)
|
|||
FILE *in;
|
||||
char upgrade_info_file[FN_REFLEN]= {0};
|
||||
char buf[sizeof(MYSQL_SERVER_VERSION)+1];
|
||||
char *res;
|
||||
|
||||
if (get_upgrade_info_file_name(upgrade_info_file))
|
||||
return 0; /* Could not get filename => not sure */
|
||||
|
@ -564,7 +565,7 @@ static int upgrade_already_done(void)
|
|||
will be detected by the strncmp
|
||||
*/
|
||||
bzero(buf, sizeof(buf));
|
||||
fgets(buf, sizeof(buf), in);
|
||||
res= fgets(buf, sizeof(buf), in);
|
||||
|
||||
my_fclose(in, MYF(0));
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <mysql.h>
|
||||
#include <sql_common.h>
|
||||
|
||||
#define ADMIN_VERSION "8.42"
|
||||
#define MAX_MYSQL_VAR 512
|
||||
|
@ -353,6 +354,11 @@ int main(int argc,char *argv[])
|
|||
|
||||
if (sql_connect(&mysql, option_wait))
|
||||
{
|
||||
/*
|
||||
We couldn't get an initial connection and will definitely exit.
|
||||
The following just determines the exit-code we'll give.
|
||||
*/
|
||||
|
||||
unsigned int err= mysql_errno(&mysql);
|
||||
if (err >= CR_MIN_ERROR && err <= CR_MAX_ERROR)
|
||||
error= 1;
|
||||
|
@ -371,41 +377,79 @@ int main(int argc,char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
while (!interrupted)
|
||||
/*
|
||||
--count=0 aborts right here. Otherwise iff --sleep=t ("interval")
|
||||
is given a t!=0, we get an endless loop, or n iterations if --count=n
|
||||
was given an n!=0. If --sleep wasn't given, we get one iteration.
|
||||
|
||||
To wit, --wait loops the connection-attempts, while --sleep loops
|
||||
the command execution (endlessly if no --count is given).
|
||||
*/
|
||||
|
||||
while (!interrupted && (!opt_count_iterations || nr_iterations))
|
||||
{
|
||||
new_line = 0;
|
||||
if ((error=execute_commands(&mysql,argc,commands)))
|
||||
|
||||
if ((error= execute_commands(&mysql,argc,commands)))
|
||||
{
|
||||
/*
|
||||
Unknown/malformed command always aborts and can't be --forced.
|
||||
If the user got confused about the syntax, proceeding would be
|
||||
dangerous ...
|
||||
*/
|
||||
if (error > 0)
|
||||
break; /* Wrong command error */
|
||||
if (!option_force)
|
||||
break;
|
||||
|
||||
/*
|
||||
Command was well-formed, but failed on the server. Might succeed
|
||||
on retry (if conditions on server change etc.), but needs --force
|
||||
to retry.
|
||||
*/
|
||||
if (!option_force)
|
||||
break;
|
||||
} /* if((error= ... */
|
||||
|
||||
if (interval) /* --sleep=interval given */
|
||||
{
|
||||
/*
|
||||
If connection was dropped (unintentionally, or due to SHUTDOWN),
|
||||
re-establish it if --wait ("retry-connect") was given and user
|
||||
didn't signal for us to die. Otherwise, signal failure.
|
||||
*/
|
||||
|
||||
if (mysql.net.vio == 0)
|
||||
{
|
||||
if (option_wait && !interrupted)
|
||||
{
|
||||
mysql_close(&mysql);
|
||||
if (!sql_connect(&mysql, option_wait))
|
||||
{
|
||||
sleep(1); /* Don't retry too rapidly */
|
||||
continue; /* Retry */
|
||||
}
|
||||
sleep(1);
|
||||
sql_connect(&mysql, option_wait);
|
||||
/*
|
||||
continue normally and decrease counters so that
|
||||
"mysqladmin --count=1 --wait=1 shutdown"
|
||||
cannot loop endlessly.
|
||||
*/
|
||||
}
|
||||
error=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (interval)
|
||||
{
|
||||
if (opt_count_iterations && --nr_iterations == 0)
|
||||
break;
|
||||
else
|
||||
{
|
||||
/*
|
||||
connexion broke, and we have no order to re-establish it. fail.
|
||||
*/
|
||||
if (!option_force)
|
||||
error= 1;
|
||||
break;
|
||||
}
|
||||
} /* lost connection */
|
||||
|
||||
sleep(interval);
|
||||
if (new_line)
|
||||
puts("");
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
mysql_close(&mysql);
|
||||
}
|
||||
break; /* no --sleep, done looping */
|
||||
} /* command-loop */
|
||||
} /* got connection */
|
||||
|
||||
mysql_close(&mysql);
|
||||
my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(user,MYF(MY_ALLOW_ZERO_PTR));
|
||||
#ifdef HAVE_SMEM
|
||||
|
@ -423,6 +467,17 @@ sig_handler endprog(int signal_number __attribute__((unused)))
|
|||
interrupted=1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief connect to server, optionally waiting for same to come up
|
||||
|
||||
@param mysql connection struct
|
||||
@param wait wait for server to come up?
|
||||
(0: no, ~0: forever, n: cycles)
|
||||
|
||||
@return Operation result
|
||||
@retval 0 success
|
||||
@retval 1 failure
|
||||
*/
|
||||
|
||||
static my_bool sql_connect(MYSQL *mysql, uint wait)
|
||||
{
|
||||
|
@ -431,7 +486,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
for (;;)
|
||||
{
|
||||
if (mysql_real_connect(mysql,host,user,opt_password,NullS,tcp_port,
|
||||
unix_port, 0))
|
||||
unix_port, CLIENT_REMEMBER_OPTIONS))
|
||||
{
|
||||
mysql->reconnect= 1;
|
||||
if (info)
|
||||
|
@ -442,9 +497,9 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!wait)
|
||||
if (!wait) // was or reached 0, fail
|
||||
{
|
||||
if (!option_silent)
|
||||
if (!option_silent) // print diagnostics
|
||||
{
|
||||
if (!host)
|
||||
host= (char*) LOCAL_HOST;
|
||||
|
@ -468,11 +523,18 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (wait != (uint) ~0)
|
||||
wait--; /* One less retry */
|
||||
wait--; /* count down, one less retry */
|
||||
|
||||
if ((mysql_errno(mysql) != CR_CONN_HOST_ERROR) &&
|
||||
(mysql_errno(mysql) != CR_CONNECTION_ERROR))
|
||||
{
|
||||
/*
|
||||
Error is worse than "server doesn't answer (yet?)";
|
||||
fail even if we still have "wait-coins" unless --force
|
||||
was also given.
|
||||
*/
|
||||
fprintf(stderr,"Got error: %s\n", mysql_error(mysql));
|
||||
if (!option_force)
|
||||
return 1;
|
||||
|
@ -496,11 +558,18 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Execute a command.
|
||||
Return 0 on ok
|
||||
-1 on retryable error
|
||||
1 on fatal error
|
||||
/**
|
||||
@brief Execute all commands
|
||||
|
||||
@details We try to execute all commands we were given, in the order
|
||||
given, but return with non-zero as soon as we encounter trouble.
|
||||
By that token, individual commands can be considered a conjunction
|
||||
with boolean short-cut.
|
||||
|
||||
@return success?
|
||||
@retval 0 Yes! ALL commands worked!
|
||||
@retval 1 No, one failed and will never work (malformed): fatal error!
|
||||
@retval -1 No, one failed on the server, may work next time!
|
||||
*/
|
||||
|
||||
static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
|
@ -570,7 +639,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
mysql_error(mysql));
|
||||
return -1;
|
||||
}
|
||||
mysql_close(mysql); /* Close connection to avoid error messages */
|
||||
argc=1; /* force SHUTDOWN to be the last command */
|
||||
if (got_pidfile)
|
||||
{
|
||||
|
@ -1036,14 +1104,16 @@ static void usage(void)
|
|||
static int drop_db(MYSQL *mysql, const char *db)
|
||||
{
|
||||
char name_buff[FN_REFLEN+20], buf[10];
|
||||
char *input;
|
||||
|
||||
if (!option_force)
|
||||
{
|
||||
puts("Dropping the database is potentially a very bad thing to do.");
|
||||
puts("Any data stored in the database will be destroyed.\n");
|
||||
printf("Do you really want to drop the '%s' database [y/N] ",db);
|
||||
fflush(stdout);
|
||||
VOID(fgets(buf,sizeof(buf)-1,stdin));
|
||||
if ((*buf != 'y') && (*buf != 'Y'))
|
||||
input= fgets(buf, sizeof(buf)-1, stdin);
|
||||
if (!input || ((*input != 'y') && (*input != 'Y')))
|
||||
{
|
||||
puts("\nOK, aborting database drop!");
|
||||
return -1;
|
||||
|
|
|
@ -5008,7 +5008,7 @@ int main(int argc, char **argv)
|
|||
exit_code= get_options(&argc, &argv);
|
||||
if (exit_code)
|
||||
{
|
||||
free_resources(0);
|
||||
free_resources();
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
|
@ -5016,14 +5016,14 @@ int main(int argc, char **argv)
|
|||
{
|
||||
if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
|
||||
{
|
||||
free_resources(0);
|
||||
free_resources();
|
||||
exit(EX_MYSQLERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (connect_to_db(current_host, current_user, opt_password))
|
||||
{
|
||||
free_resources(0);
|
||||
free_resources();
|
||||
exit(EX_MYSQLERR);
|
||||
}
|
||||
if (!path)
|
||||
|
|
|
@ -417,6 +417,7 @@ static struct st_expected_errors saved_expected_errors;
|
|||
struct st_command
|
||||
{
|
||||
char *query, *query_buf,*first_argument,*last_argument,*end;
|
||||
DYNAMIC_STRING content;
|
||||
int first_word_len, query_len;
|
||||
my_bool abort_on_error;
|
||||
struct st_expected_errors expected_errors;
|
||||
|
@ -431,10 +432,12 @@ DYNAMIC_STRING ds_res;
|
|||
|
||||
char builtin_echo[FN_REFLEN];
|
||||
|
||||
static void cleanup_and_exit(int exit_code) __attribute__((noreturn));
|
||||
|
||||
void die(const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
|
||||
void abort_not_supported_test(const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
|
||||
void verbose_msg(const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
void log_msg(const char *fmt, ...)
|
||||
|
@ -1138,6 +1141,8 @@ void free_used_memory()
|
|||
{
|
||||
struct st_command **q= dynamic_element(&q_lines, i, struct st_command**);
|
||||
my_free((*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR));
|
||||
if ((*q)->content.str)
|
||||
dynstr_free(&(*q)->content);
|
||||
my_free((*q),MYF(0));
|
||||
}
|
||||
for (i= 0; i < 10; i++)
|
||||
|
@ -1163,6 +1168,7 @@ void free_used_memory()
|
|||
mysql_server_end();
|
||||
|
||||
/* Don't use DBUG after mysql_server_end() */
|
||||
DBUG_VIOLATION_HELPER_LEAVE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2485,7 +2491,7 @@ void do_source(struct st_command *command)
|
|||
}
|
||||
|
||||
dynstr_free(&ds_filename);
|
||||
return;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3287,21 +3293,30 @@ void do_write_file_command(struct st_command *command, my_bool append)
|
|||
sizeof(write_file_args)/sizeof(struct command_arg),
|
||||
' ');
|
||||
|
||||
/* If no delimiter was provided, use EOF */
|
||||
if (ds_delimiter.length == 0)
|
||||
dynstr_set(&ds_delimiter, "EOF");
|
||||
|
||||
if (!append && access(ds_filename.str, F_OK) == 0)
|
||||
{
|
||||
/* The file should not be overwritten */
|
||||
die("File already exist: '%s'", ds_filename.str);
|
||||
}
|
||||
|
||||
init_dynamic_string(&ds_content, "", 1024, 1024);
|
||||
read_until_delimiter(&ds_content, &ds_delimiter);
|
||||
DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str));
|
||||
str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
|
||||
dynstr_free(&ds_content);
|
||||
ds_content= command->content;
|
||||
/* If it hasn't been done already by a loop iteration, fill it in */
|
||||
if (! ds_content.str)
|
||||
{
|
||||
/* If no delimiter was provided, use EOF */
|
||||
if (ds_delimiter.length == 0)
|
||||
dynstr_set(&ds_delimiter, "EOF");
|
||||
|
||||
init_dynamic_string(&ds_content, "", 1024, 1024);
|
||||
read_until_delimiter(&ds_content, &ds_delimiter);
|
||||
command->content= ds_content;
|
||||
}
|
||||
/* This function could be called even if "false", so check before printing */
|
||||
if (cur_block->ok)
|
||||
{
|
||||
DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str));
|
||||
str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
|
||||
}
|
||||
dynstr_free(&ds_filename);
|
||||
dynstr_free(&ds_delimiter);
|
||||
DBUG_VOID_RETURN;
|
||||
|
@ -3444,12 +3459,17 @@ void do_diff_files(struct st_command *command)
|
|||
die("command \"diff_files\" failed, file '%s' does not exist",
|
||||
ds_filename2.str);
|
||||
|
||||
if ((error= compare_files(ds_filename.str, ds_filename2.str)))
|
||||
if ((error= compare_files(ds_filename.str, ds_filename2.str)) &&
|
||||
match_expected_error(command, error, NULL) < 0)
|
||||
{
|
||||
/* Compare of the two files failed, append them to output
|
||||
so the failure can be analyzed
|
||||
so the failure can be analyzed, but only if it was not
|
||||
expected to fail.
|
||||
*/
|
||||
show_diff(&ds_res, ds_filename.str, ds_filename2.str);
|
||||
log_file.write(&ds_res);
|
||||
log_file.flush();
|
||||
dynstr_set(&ds_res, 0);
|
||||
}
|
||||
|
||||
dynstr_free(&ds_filename);
|
||||
|
@ -3705,10 +3725,9 @@ void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
|
|||
MYSQL* mysql = &cur_con->mysql;
|
||||
for (;;)
|
||||
{
|
||||
MYSQL_RES *res;
|
||||
MYSQL_RES *UNINIT_VAR(res);
|
||||
MYSQL_ROW row;
|
||||
int done;
|
||||
LINT_INIT(res);
|
||||
|
||||
if (mysql_query(mysql,"show status like 'Slave_running'") ||
|
||||
!(res=mysql_store_result(mysql)))
|
||||
|
@ -5240,13 +5259,12 @@ my_bool end_of_query(int c)
|
|||
|
||||
int read_line(char *buf, int size)
|
||||
{
|
||||
char c, last_quote;
|
||||
char c, UNINIT_VAR(last_quote);
|
||||
char *p= buf, *buf_end= buf + size - 1;
|
||||
int skip_char= 0;
|
||||
enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
|
||||
R_COMMENT, R_LINE_START} state= R_LINE_START;
|
||||
DBUG_ENTER("read_line");
|
||||
LINT_INIT(last_quote);
|
||||
|
||||
start_lineno= cur_file->lineno;
|
||||
DBUG_PRINT("info", ("Starting to read at lineno: %d", start_lineno));
|
||||
|
@ -6478,8 +6496,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
|
||||
if (!disable_result_log)
|
||||
{
|
||||
ulonglong affected_rows; /* Ok to be undef if 'disable_info' is set */
|
||||
LINT_INIT(affected_rows);
|
||||
ulonglong UNINIT_VAR(affected_rows); /* Ok to be undef if 'disable_info' is set */
|
||||
|
||||
if (res)
|
||||
{
|
||||
|
@ -7165,6 +7182,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
run_query_normal(cn, command, flags, query, query_len,
|
||||
ds, &ds_warnings);
|
||||
|
||||
dynstr_free(&ds_warnings);
|
||||
if (command->type == Q_EVAL)
|
||||
dynstr_free(&eval_query);
|
||||
|
||||
if (display_result_sorted)
|
||||
{
|
||||
/* Sort the result set and append it to result */
|
||||
|
@ -7195,11 +7216,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
check_require(ds, command->require_file);
|
||||
}
|
||||
|
||||
dynstr_free(&ds_warnings);
|
||||
if (ds == &ds_result)
|
||||
dynstr_free(&ds_result);
|
||||
if (command->type == Q_EVAL)
|
||||
dynstr_free(&eval_query);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
@ -7508,6 +7526,8 @@ static void init_signal_handling(void)
|
|||
#endif
|
||||
sigaction(SIGILL, &sa, NULL);
|
||||
sigaction(SIGFPE, &sa, NULL);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
#endif /* !__WIN__ */
|
||||
|
@ -7682,7 +7702,31 @@ int main(int argc, char **argv)
|
|||
command->type= Q_COMMENT;
|
||||
}
|
||||
|
||||
if (cur_block->ok)
|
||||
my_bool ok_to_do= cur_block->ok;
|
||||
/*
|
||||
Some commands need to be "done" the first time if they may get
|
||||
re-iterated over in a true context. This can only happen if there's
|
||||
a while loop at some level above the current block.
|
||||
*/
|
||||
if (!ok_to_do)
|
||||
{
|
||||
if (command->type == Q_SOURCE ||
|
||||
command->type == Q_WRITE_FILE ||
|
||||
command->type == Q_APPEND_FILE ||
|
||||
command->type == Q_PERL)
|
||||
{
|
||||
for (struct st_block *stb= cur_block-1; stb >= block_stack; stb--)
|
||||
{
|
||||
if (stb->cmd == cmd_while)
|
||||
{
|
||||
ok_to_do= 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ok_to_do)
|
||||
{
|
||||
command->last_argument= command->first_argument;
|
||||
processed = 1;
|
||||
|
@ -7991,6 +8035,8 @@ int main(int argc, char **argv)
|
|||
if (parsing_disabled)
|
||||
die("Test ended with parsing disabled");
|
||||
|
||||
my_bool empty_result= FALSE;
|
||||
|
||||
/*
|
||||
The whole test has been executed _sucessfully_.
|
||||
Time to compare result or save it to record file.
|
||||
|
@ -8031,11 +8077,20 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
die("The test didn't produce any output");
|
||||
/* Empty output is an error *unless* we also have an empty result file */
|
||||
if (! result_file_name || record ||
|
||||
compare_files (log_file.file_name(), result_file_name))
|
||||
{
|
||||
die("The test didn't produce any output");
|
||||
}
|
||||
else
|
||||
{
|
||||
empty_result= TRUE; /* Meaning empty was expected */
|
||||
}
|
||||
}
|
||||
|
||||
if (!command_executed && result_file_name)
|
||||
die("No queries executed but result file found!");
|
||||
if (!command_executed && result_file_name && !empty_result)
|
||||
die("No queries executed but non-empty result file found!");
|
||||
|
||||
verbose_msg("Test has succeeded!");
|
||||
timer_output();
|
||||
|
@ -8122,6 +8177,8 @@ void do_get_replace_column(struct st_command *command)
|
|||
}
|
||||
my_free(start, MYF(0));
|
||||
command->last_argument= command->end;
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -339,9 +339,7 @@ rl_generic_bind (type, keyseq, data, map)
|
|||
char *keys;
|
||||
int keys_len;
|
||||
register int i;
|
||||
KEYMAP_ENTRY k;
|
||||
|
||||
k.function = 0;
|
||||
KEYMAP_ENTRY k= { 0, NULL };
|
||||
|
||||
/* If no keys to bind to, exit right away. */
|
||||
if (keyseq == 0 || *keyseq == 0)
|
||||
|
@ -776,7 +774,7 @@ _rl_read_file (filename, sizep)
|
|||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
if (file >= 0)
|
||||
|
|
|
@ -186,7 +186,7 @@ read_history_range (filename, from, to)
|
|||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
errno = overflow_errno;
|
||||
|
@ -311,6 +311,7 @@ history_truncate_file (fname, lines)
|
|||
int file, chars_read, rv;
|
||||
struct stat finfo;
|
||||
size_t file_size;
|
||||
size_t bytes_written;
|
||||
|
||||
buffer = (char *)NULL;
|
||||
filename = history_filename (fname);
|
||||
|
@ -340,7 +341,7 @@ history_truncate_file (fname, lines)
|
|||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
close (file);
|
||||
|
@ -400,7 +401,7 @@ if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
|||
truncate to. */
|
||||
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
||||
{
|
||||
write (file, bp, chars_read - (bp - buffer));
|
||||
bytes_written= write (file, bp, chars_read - (bp - buffer));
|
||||
|
||||
#if defined (__BEOS__)
|
||||
/* BeOS ignores O_TRUNC. */
|
||||
|
|
|
@ -137,7 +137,8 @@ UNDO_LIST *
|
|||
_rl_copy_undo_list (head)
|
||||
UNDO_LIST *head;
|
||||
{
|
||||
UNDO_LIST *list, *new, *roving, *c;
|
||||
UNDO_LIST *list, *new, *c;
|
||||
UNDO_LIST *roving= NULL;
|
||||
|
||||
list = head;
|
||||
new = 0;
|
||||
|
|
|
@ -81,8 +81,13 @@ rl_alphabetic (c)
|
|||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
int
|
||||
_rl_walphabetic (wc)
|
||||
wchar_t wc;
|
||||
/*
|
||||
Portability issue with VisualAge C++ Professional / C for AIX Compiler, Version 6:
|
||||
"util.c", line 84.1: 1506-343 (S) Redeclaration of _rl_walphabetic differs
|
||||
from previous declaration on line 110 of "rlmbutil.h".
|
||||
So, put type in the function signature here.
|
||||
*/
|
||||
_rl_walphabetic (wchar_t wc)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
|
|||
#
|
||||
# When changing major version number please also check switch statement
|
||||
# in client/mysqlbinlog.cc:check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.4.3-beta)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.4.5-beta)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
|
|
@ -16,6 +16,29 @@
|
|||
#ifndef _dbug_h
|
||||
#define _dbug_h
|
||||
|
||||
#if defined(__cplusplus) && !defined(DBUG_OFF)
|
||||
class Dbug_violation_helper
|
||||
{
|
||||
public:
|
||||
inline Dbug_violation_helper() :
|
||||
_entered(TRUE)
|
||||
{ }
|
||||
|
||||
inline ~Dbug_violation_helper()
|
||||
{
|
||||
assert(!_entered);
|
||||
}
|
||||
|
||||
inline void leave()
|
||||
{
|
||||
_entered= FALSE;
|
||||
}
|
||||
|
||||
private:
|
||||
bool _entered;
|
||||
};
|
||||
#endif /* C++ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -47,11 +70,31 @@ extern void _db_lock_file_(void);
|
|||
extern void _db_unlock_file_(void);
|
||||
extern FILE *_db_fp_(void);
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
|
||||
&_db_framep_)
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define DBUG_ENTER(a) \
|
||||
const char *_db_func_, *_db_file_; \
|
||||
uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
Dbug_violation_helper dbug_violation_helper; \
|
||||
_db_enter_ (a, __FILE__, __LINE__, &_db_func_, &_db_file_, \
|
||||
&_db_level_, &_db_framep_)
|
||||
#define DBUG_VIOLATION_HELPER_LEAVE dbug_violation_helper.leave()
|
||||
|
||||
#else /* C */
|
||||
|
||||
#define DBUG_ENTER(a) \
|
||||
const char *_db_func_, *_db_file_; \
|
||||
uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a, __FILE__, __LINE__, &_db_func_, &_db_file_, \
|
||||
&_db_level_, &_db_framep_)
|
||||
#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
|
||||
|
||||
#endif /* C++ */
|
||||
|
||||
#define DBUG_LEAVE \
|
||||
DBUG_VIOLATION_HELPER_LEAVE; \
|
||||
_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)
|
||||
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
|
||||
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
|
||||
|
@ -85,6 +128,7 @@ extern FILE *_db_fp_(void);
|
|||
|
||||
#define DBUG_ENTER(a1)
|
||||
#define DBUG_LEAVE
|
||||
#define DBUG_VIOLATION_HELPER_LEAVE
|
||||
#define DBUG_RETURN(a1) do { return(a1); } while(0)
|
||||
#define DBUG_VOID_RETURN do { return; } while(0)
|
||||
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
|
||||
|
|
|
@ -564,6 +564,25 @@ int __void__;
|
|||
#define PURIFY_OR_LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Suppress uninitialized variable warning without generating code.
|
||||
|
||||
The _cplusplus is a temporary workaround for C++ code pending a fix
|
||||
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
|
||||
*/
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \
|
||||
!defined(__GNUC__)
|
||||
#define UNINIT_VAR(x) x= 0
|
||||
#else
|
||||
#define UNINIT_VAR(x) x= x
|
||||
#endif
|
||||
|
||||
/* Define some useful general macros */
|
||||
#if !defined(max)
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_UINT)
|
||||
#undef HAVE_UINT
|
||||
#define HAVE_UINT
|
||||
|
|
|
@ -67,6 +67,7 @@ extern int NEAR my_errno; /* Last error in mysys */
|
|||
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
|
||||
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
|
||||
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
|
||||
#define MY_SYNC 4096 /* my_copy(): sync dst file */
|
||||
|
||||
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
|
||||
#define MY_GIVE_INFO 2 /* Give time info about process*/
|
||||
|
|
|
@ -1635,8 +1635,7 @@ myodbc_remove_escape(MYSQL *mysql,char *name)
|
|||
char *to;
|
||||
#ifdef USE_MB
|
||||
my_bool use_mb_flag=use_mb(mysql->charset);
|
||||
char *end;
|
||||
LINT_INIT(end);
|
||||
char *UNINIT_VAR(end);
|
||||
if (use_mb_flag)
|
||||
for (end=name; *end ; end++) ;
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
## Process this file with automake to create Makefile.in
|
||||
|
||||
testdir = $(prefix)/mysql-test
|
||||
testroot = $(prefix)
|
||||
testdir = $(testroot)/mysql-test
|
||||
|
||||
test_SCRIPTS = mtr \
|
||||
mysql-test-run \
|
||||
|
|
|
@ -23,3 +23,10 @@ The syntax is as follows:
|
|||
start with the same characters up to the last letter before the asterisk
|
||||
are considered experimental:
|
||||
main.a* # get rid of main.alias, main.alibaba and main.agliolio
|
||||
|
||||
6) Optionally, the test case may be followed by one or more platform
|
||||
qualifiers beginning with @ or @!. The test will then be considered
|
||||
experimental only/except on that platform. Basic OS names as
|
||||
reported by $^O in Perl, or 'windows' are supported, this includes
|
||||
solaris, linux, windows, aix, darwin, ... Example:
|
||||
main.alias @aix @windows # Fails on those
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
# For easier human reading (MTR doesn't care), please keep entries
|
||||
# in alphabetical order. This also helps with merge conflict resolution.
|
||||
|
||||
binlog.binlog_tmp_table* # Bug#45578:2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
|
||||
funcs_1.charset_collation_1 # depends on compile-time decisions
|
||||
binlog.binlog_tmp_table # Bug#45578: Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
|
||||
main.ctype_gbk_binlog # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
|
||||
rpl.rpl_row_create_table # Bug#45576: rpl_row_create_table fails on PB2
|
||||
innodb.innodb_information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
|
||||
main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
|
||||
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
|
||||
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
|
||||
main.plugin* @solaris # Bug#47146 Linking problem with example plugin when dtrace enabled
|
||||
main.plugin_load @solaris # Bug#47146
|
||||
rpl.rpl_get_master_version_and_clock* # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31
|
||||
rpl.rpl_innodb_bug28430* @solaris # Bug#46029
|
||||
rpl.rpl_plugin_load* @solaris # Bug#47146
|
||||
rpl.rpl_row_create_table* # Bug#45576: rpl_row_create_table fails on PB2
|
||||
rpl_ndb.rpl_ndb_log # Bug#38998
|
||||
rpl.rpl_innodb_bug28430 # Bug#46029
|
||||
|
||||
ndb.n* # Consider all NDB tests experimental.
|
||||
rpl_ndb.r* # Consider all NDB tests experimental.
|
||||
|
|
|
@ -163,5 +163,81 @@ show create table t1;
|
|||
connection master;
|
||||
drop table t1;
|
||||
|
||||
# End cleanup
|
||||
#
|
||||
# BUG#45999 Row based replication fails when auto_increment field = 0.
|
||||
# Store engine of Slaves auto-generates new sequence numbers for
|
||||
# auto_increment fields if the values of them are 0. There is an inconsistency
|
||||
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
|
||||
#
|
||||
source include/master-slave-reset.inc;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
eval CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type;
|
||||
eval CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type2;
|
||||
SET SQL_MODE='';
|
||||
# Value of the id will be 1;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t2 VALUES(NULL);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
# Value of the id will be 2;
|
||||
INSERT INTO t1 VALUES();
|
||||
INSERT INTO t2 VALUES();
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
# Value of the id will be 3. The master treats 0 as NULL or empty because
|
||||
# NO_AUTO_VALUE_ON_ZERO is not assign to SQL_MODE.
|
||||
INSERT INTO t1 VALUES(0);
|
||||
INSERT INTO t2 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
# Value of the id will be 0. The master does not treat 0 as NULL or empty
|
||||
# because NO_AUTO_VALUE_ON_ZERO has assigned to SQL_MODE.
|
||||
INSERT INTO t1 VALUES(0);
|
||||
INSERT INTO t2 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
INSERT INTO t1 VALUES(4);
|
||||
INSERT INTO t2 VALUES(4);
|
||||
FLUSH LOGS;
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_table_1= master:test.t1;
|
||||
let $diff_table_2= slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
let $diff_table_1= master:test.t2;
|
||||
let $diff_table_2= slave:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
|
||||
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_table_1= master:test.t1;
|
||||
let $diff_table_2= slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
let $diff_table_1= master:test.t2;
|
||||
let $diff_table_2= slave:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# End cleanup
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET SQL_MODE='';
|
||||
sync_slave_with_master;
|
||||
|
|
|
@ -22,6 +22,8 @@ DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t1
|
|||
# should stop the slave. #
|
||||
#################################################
|
||||
|
||||
call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
|
||||
|
||||
--echo **** Diff Table Def Start ****
|
||||
|
||||
##############################################
|
||||
|
|
710
mysql-test/extra/rpl_tests/rpl_mixing_engines.test
Normal file
710
mysql-test/extra/rpl_tests/rpl_mixing_engines.test
Normal file
|
@ -0,0 +1,710 @@
|
|||
###################################################################################
|
||||
# This test checks if transactions that mixes transactional and non-transactional
|
||||
# tables are correctly handled in statement mode. In an nutshell, we have what
|
||||
# follows:
|
||||
#
|
||||
# 1) "B T T C" generates in binlog the "B T T C" entries.
|
||||
#
|
||||
# 2) "B T T R" generates in binlog an "empty" entry.
|
||||
#
|
||||
# 3) "B T N C" generates in binlog the "B T N C" entries.
|
||||
#
|
||||
# 4) "B T N R" generates in binlog the "B T N R" entries.
|
||||
#
|
||||
# 5) "T" generates in binlog the "B T C" entry.
|
||||
#
|
||||
# 6) "N" generates in binlog the "N" entry.
|
||||
#
|
||||
# 7) "M" generates in binglog the "B M C" entries.
|
||||
#
|
||||
# 8) "B N N T C" generates in binglog the "N N B T C" entries.
|
||||
#
|
||||
# 9) "B N N T R" generates in binlog the "N N B T R" entries.
|
||||
#
|
||||
# 10) "B N N C" generates in binglog the "N N" entries.
|
||||
#
|
||||
# 11) "B N N R" generates in binlog the "N N" entries.
|
||||
#
|
||||
# 12) "B M T C" generates in the binlog the "B M T C" entries.
|
||||
#
|
||||
# 13) "B M T R" generates in the binlog the "B M T R" entries.
|
||||
###################################################################################
|
||||
|
||||
--echo ###################################################################################
|
||||
--echo # CONFIGURATION
|
||||
--echo ###################################################################################
|
||||
connection master;
|
||||
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
connection slave;
|
||||
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
|
||||
CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
connection master;
|
||||
|
||||
DELIMITER |;
|
||||
|
||||
CREATE FUNCTION f1 () RETURNS VARCHAR(64)
|
||||
BEGIN
|
||||
RETURN "Testing...";
|
||||
END|
|
||||
|
||||
CREATE FUNCTION f2 () RETURNS VARCHAR(64)
|
||||
BEGIN
|
||||
RETURN f1();
|
||||
END|
|
||||
|
||||
CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64))
|
||||
BEGIN
|
||||
INSERT INTO tt_3 VALUES (y,x,x);
|
||||
END|
|
||||
|
||||
CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c);
|
||||
END|
|
||||
|
||||
CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c);
|
||||
END|
|
||||
|
||||
DELIMITER ;|
|
||||
|
||||
--echo ###################################################################################
|
||||
--echo # MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
|
||||
--echo ###################################################################################
|
||||
connection master;
|
||||
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #1) "B T T C" generates in binlog the "B T T C" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4");
|
||||
INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #1.e) "B T T C" with error in T generates in binlog the "B T T C" entries.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2");
|
||||
BEGIN;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2");
|
||||
INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3");
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #2) "B T T R" generates in binlog an "empty" entry.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5");
|
||||
INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #2.e) "B T T R" with error in T generates in binlog an "empty" entry.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7");
|
||||
BEGIN;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7");
|
||||
INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8");
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #3) "B T N C" generates in binlog the "B T N C" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6");
|
||||
INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12");
|
||||
BEGIN;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12");
|
||||
INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13");
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14");
|
||||
INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #4) "B T N R" generates in binlog the "B T N R" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7");
|
||||
INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17");
|
||||
BEGIN;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17");
|
||||
INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18");
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19");
|
||||
INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #5) "T" generates in binlog the "B T C" entry.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8");
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #5.e) "T" with error in T generates in binlog an "empty" entry.
|
||||
--echo #
|
||||
INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1");
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #6) "N" generates in binlog the "N" entry.
|
||||
--echo #
|
||||
INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9");
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #6.e) "N" with error in N generates in binlog an empty entry if the error
|
||||
--echo # happens in the first tuple. Otherwise, generates the "N" entry and
|
||||
--echo # the error is appended.
|
||||
--echo #
|
||||
INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1");
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #7) "M" generates in binglog the "B M C" entries.
|
||||
--echo #
|
||||
|
||||
DELETE FROM nt_1;
|
||||
|
||||
INSERT INTO nt_1 SELECT * FROM tt_1;
|
||||
|
||||
DELETE FROM tt_1;
|
||||
|
||||
INSERT INTO tt_1 SELECT * FROM nt_1;
|
||||
|
||||
INSERT INTO tt_3 VALUES ("new text 000", 000, '');
|
||||
|
||||
INSERT INTO tt_3 VALUES("new text 100", 100, f1());
|
||||
|
||||
INSERT INTO nt_4 VALUES("new text 100", 100, f1());
|
||||
|
||||
INSERT INTO tt_3 VALUES("new text 200", 200, f2());
|
||||
|
||||
INSERT INTO nt_4 VALUES ("new text 300", 300, '');
|
||||
|
||||
INSERT INTO nt_4 VALUES ("new text 400", 400, f1());
|
||||
|
||||
INSERT INTO nt_4 VALUES ("new text 500", 500, f2());
|
||||
|
||||
CALL pc_i_tt_3(600, "Testing...");
|
||||
|
||||
UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
|
||||
UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #7.e) "M" with error in M generates in binglog the "B M R" entries.
|
||||
--echo #
|
||||
|
||||
INSERT INTO nt_3 VALUES ("new text -26", -26, '');
|
||||
SELECT * FROM tt_3;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
|
||||
SELECT * FROM tt_3;
|
||||
|
||||
INSERT INTO tt_4 VALUES ("new text -26", -26, '');
|
||||
SELECT * FROM nt_4;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
|
||||
SELECT * FROM nt_4;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #8) "B N N T C" generates in binglog the "N N B T C" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10");
|
||||
INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10");
|
||||
INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo #
|
||||
--echo #8.e) "B N N T R" See 6.e and 9.e.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #9) "B N N T R" generates in binlog the "N N B T R" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11");
|
||||
INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11");
|
||||
INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25");
|
||||
INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25");
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25");
|
||||
INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #10) "B N N C" generates in binglog the "N N" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12");
|
||||
INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12");
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo #
|
||||
--echo #10.e) "B N N C" See 6.e and 9.e.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #11) "B N N R" generates in binlog the "N N" entries.
|
||||
--echo #
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13");
|
||||
INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13");
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo #
|
||||
--echo #11.e) "B N N R" See 6.e and 9.e.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #12) "B M T C" generates in the binlog the "B M T C" entries.
|
||||
--echo #
|
||||
DELETE FROM nt_1;
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 SELECT * FROM tt_1;
|
||||
INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14");
|
||||
COMMIT;
|
||||
|
||||
DELETE FROM tt_1;
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 SELECT * FROM nt_1;
|
||||
INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15");
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES ("new text 700", 700, '');
|
||||
INSERT INTO tt_1 VALUES ("new text 800", 800, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES("new text 900", 900, f1());
|
||||
INSERT INTO tt_1 VALUES ("new text 1000", 1000, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES(1100, 1100, f2());
|
||||
INSERT INTO tt_1 VALUES ("new text 1200", 1200, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES ("new text 1300", 1300, '');
|
||||
INSERT INTO tt_1 VALUES ("new text 1400", 1400, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES("new text 1500", 1500, f1());
|
||||
INSERT INTO tt_1 VALUES ("new text 1600", 1600, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES("new text 1700", 1700, f2());
|
||||
INSERT INTO tt_1 VALUES ("new text 1800", 1800, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
CALL pc_i_tt_3(1900, "Testing...");
|
||||
INSERT INTO tt_1 VALUES ("new text 2000", 2000, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 2100", 2100, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 2200", 2200, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 2300", 2300, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 2400", 2400, '');
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries.
|
||||
--echo #
|
||||
|
||||
--echo # There is a bug in the slave that needs to be fixed before enabling
|
||||
--echo # this part of the test. A bug report will be filed referencing this
|
||||
--echo # test case.
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_3 VALUES ("new text -28", -28, '');
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
|
||||
INSERT INTO tt_1 VALUES ("new text -27", -27, '');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_4 VALUES ("new text -28", -28, '');
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
|
||||
INSERT INTO tt_1 VALUES ("new text -28", -28, '');
|
||||
COMMIT;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #13) "B M T R" generates in the binlog the "B M T R" entries
|
||||
--echo #
|
||||
|
||||
DELETE FROM nt_1;
|
||||
BEGIN;
|
||||
INSERT INTO nt_1 SELECT * FROM tt_1;
|
||||
INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17");
|
||||
ROLLBACK;
|
||||
|
||||
DELETE FROM tt_1;
|
||||
BEGIN;
|
||||
INSERT INTO tt_1 SELECT * FROM nt_1;
|
||||
INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18");
|
||||
ROLLBACK;
|
||||
INSERT INTO tt_1 SELECT * FROM nt_1;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES ("new text 2500", 2500, '');
|
||||
INSERT INTO tt_1 VALUES ("new text 2600", 2600, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES("new text 2700", 2700, f1());
|
||||
INSERT INTO tt_1 VALUES ("new text 2800", 2800, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_3 VALUES(2900, 2900, f2());
|
||||
INSERT INTO tt_1 VALUES ("new text 3000", 3000, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES ("new text 3100", 3100, '');
|
||||
INSERT INTO tt_1 VALUES ("new text 3200", 3200, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES("new text 3300", 3300, f1());
|
||||
INSERT INTO tt_1 VALUES ("new text 3400", 3400, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_4 VALUES("new text 3500", 3500, f2());
|
||||
INSERT INTO tt_1 VALUES ("new text 3600", 3600, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
CALL pc_i_tt_3(3700, "Testing...");
|
||||
INSERT INTO tt_1 VALUES ("new text 3700", 3700, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 3800", 3800, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 3900", 3900, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 4000", 4000, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
|
||||
INSERT INTO tt_1 VALUES ("new text 4100", 4100, '');
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
--echo
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
--echo #
|
||||
--echo #13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries.
|
||||
--echo #
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO nt_3 VALUES ("new text -30", -30, '');
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
|
||||
INSERT INTO tt_1 VALUES ("new text -30", -30, '');
|
||||
ROLLBACK;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO tt_4 VALUES ("new text -30", -30, '');
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
|
||||
INSERT INTO tt_1 VALUES ("new text -31", -31, '');
|
||||
ROLLBACK;
|
||||
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-master.sql
|
||||
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-slave.sql
|
||||
--diff_files $MYSQLTEST_VARDIR/tmp/test-master.sql $MYSQLTEST_VARDIR/tmp/test-slave.sql
|
||||
|
||||
--echo ###################################################################################
|
||||
--echo # CLEAN
|
||||
--echo ###################################################################################
|
||||
|
||||
connection master;
|
||||
DROP TABLE tt_1;
|
||||
DROP TABLE tt_2;
|
||||
DROP TABLE tt_3;
|
||||
DROP TABLE tt_4;
|
||||
DROP TABLE nt_1;
|
||||
DROP TABLE nt_2;
|
||||
DROP TABLE nt_3;
|
||||
DROP TABLE nt_4;
|
||||
DROP PROCEDURE pc_i_tt_3;
|
||||
DROP FUNCTION f1;
|
||||
DROP FUNCTION f2;
|
||||
|
||||
sync_slave_with_master;
|
|
@ -9,29 +9,27 @@
|
|||
#############################################################################
|
||||
|
||||
# Begin clean up test section
|
||||
connection master;
|
||||
--disable_warnings
|
||||
create database if not exists mysqltest1;
|
||||
DROP PROCEDURE IF EXISTS mysqltest1.p1;
|
||||
DROP PROCEDURE IF EXISTS mysqltest1.p2;
|
||||
DROP TABLE IF EXISTS mysqltest1.t2;
|
||||
DROP TABLE IF EXISTS mysqltest1.t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP PROCEDURE IF EXISTS p2;
|
||||
--enable_warnings
|
||||
# End of cleanup
|
||||
|
||||
# Begin test section 1
|
||||
eval CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
|
||||
eval CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
|
||||
eval CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
|
||||
eval CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
|
||||
|
||||
delimiter |;
|
||||
CREATE PROCEDURE mysqltest1.p1()
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE spa CHAR(16);
|
||||
DECLARE spb INT;
|
||||
DECLARE cur1 CURSOR FOR SELECT name,
|
||||
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
|
||||
FROM mysqltest1.t1;
|
||||
FROM t1;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
|
||||
OPEN cur1;
|
||||
|
@ -41,7 +39,7 @@ BEGIN
|
|||
FETCH cur1 INTO spa, spb;
|
||||
IF NOT done THEN
|
||||
START TRANSACTION;
|
||||
INSERT INTO mysqltest1.t2 VALUES (spa,spb);
|
||||
INSERT INTO t2 VALUES (spa,spb);
|
||||
COMMIT;
|
||||
END IF;
|
||||
UNTIL done END REPEAT;
|
||||
|
@ -49,30 +47,29 @@ BEGIN
|
|||
SET AUTOCOMMIT=1;
|
||||
CLOSE cur1;
|
||||
END|
|
||||
CREATE PROCEDURE mysqltest1.p2()
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
|
||||
INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
|
||||
END|
|
||||
delimiter ;|
|
||||
|
||||
CALL mysqltest1.p2();
|
||||
CALL p2();
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
CALL mysqltest1.p1();
|
||||
CALL p1();
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/sp006_master.sql
|
||||
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/sp006_slave.sql
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp006_master.sql
|
||||
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp006_slave.sql
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS mysqltest1.p1;
|
||||
DROP PROCEDURE IF EXISTS mysqltest1.p2;
|
||||
DROP TABLE IF EXISTS mysqltest1.t1;
|
||||
DROP TABLE IF EXISTS mysqltest1.t2;
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
|
||||
# Lets compare. Note: If they match test will pass, if they do not match
|
||||
# the test will show that the diff statement failed and not reject file
|
||||
|
|
|
@ -725,9 +725,9 @@ call p_verify_status_increment(4, 4, 4, 4);
|
|||
alter table t3 add column (b int);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
alter table t3 rename t4;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
rename table t4 to t3;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
truncate table t3;
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
create view v1 as select * from t2;
|
||||
|
|
7
mysql-test/include/have_dynamic_loading.inc
Normal file
7
mysql-test/include/have_dynamic_loading.inc
Normal file
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# Whether server supports dynamic loading.
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
|
@ -2,10 +2,7 @@
|
|||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
--source include/have_dynamic_loading.inc
|
||||
|
||||
#
|
||||
# Check if the variable EXAMPLE_PLUGIN is set
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
--source include/have_dynamic_loading.inc
|
||||
|
||||
#
|
||||
# Check if the variable SIMPLE_PARSER is set
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
--source include/have_dynamic_loading.inc
|
||||
|
||||
#
|
||||
# Check if the variable UDF_EXAMPLE_LIB is set
|
||||
|
|
|
@ -132,7 +132,7 @@ INSERT INTO global_suppressions VALUES
|
|||
|
||||
("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
|
||||
|
||||
("Statement is not safe to log in statement format"),
|
||||
("Statement may not be safe to log in statement format"),
|
||||
|
||||
/* test case for Bug#bug29807 copies a stray frm into database */
|
||||
("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
|
||||
|
@ -162,6 +162,8 @@ INSERT INTO global_suppressions VALUES
|
|||
("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
|
||||
("Slave: Can't DROP 'c7'.* 1091"),
|
||||
("Slave: Key column 'c6'.* 1072"),
|
||||
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
|
||||
(".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
|
||||
|
||||
/* Test case for Bug#31590 in order_by.test produces the following error */
|
||||
("Out of sort memory; increase server sort buffer size"),
|
||||
|
@ -172,6 +174,17 @@ INSERT INTO global_suppressions VALUES
|
|||
*/
|
||||
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
|
||||
|
||||
/* Added 2009-08-XX after fixing Bug #42408 */
|
||||
|
||||
("Although a path was specified for the .* option, log tables are used"),
|
||||
("Backup: Operation aborted"),
|
||||
("Restore: Operation aborted"),
|
||||
("Restore: The grant .* was skipped because the user does not exist"),
|
||||
("The path specified for the variable .* is not a directory or cannot be written:"),
|
||||
("Master server does not support or not configured semi-sync replication, fallback to asynchronous"),
|
||||
(": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"),
|
||||
("Slave: Unknown table 't1' Error_code: 1051"),
|
||||
|
||||
("THE_LAST_SUPPRESSION")||
|
||||
|
||||
|
||||
|
|
69
mysql-test/include/partition_date_range.inc
Normal file
69
mysql-test/include/partition_date_range.inc
Normal file
|
@ -0,0 +1,69 @@
|
|||
# Created for verifying bug#20577.
|
||||
# expects TABLE t1 (... , a DATE, ...)
|
||||
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
--echo # Disabling warnings for the invalid date
|
||||
--disable_warnings
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
--enable_warnings
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
--sorted_result
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
if ($explain_partitions)
|
||||
{
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
--echo # Disabling warnings for the invalid date
|
||||
--disable_warnings
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
--enable_warnings
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
}
|
|
@ -204,8 +204,10 @@ my @mysqld_rules=
|
|||
{ 'port' => \&fix_port },
|
||||
{ 'socket' => \&fix_socket },
|
||||
{ '#log-error' => \&fix_log_error },
|
||||
{ 'log' => \&fix_log },
|
||||
{ 'log-slow-queries' => \&fix_log_slow_queries },
|
||||
{ 'general_log' => 1 },
|
||||
{ 'general_log_file' => \&fix_log },
|
||||
{ 'slow_query_log' => 1 },
|
||||
{ 'slow_query_log_file' => \&fix_log_slow_queries },
|
||||
{ '#user' => sub { return shift->{ARGS}->{user} || ""; } },
|
||||
{ '#password' => sub { return shift->{ARGS}->{password} || ""; } },
|
||||
{ 'server-id' => \&fix_server_id, },
|
||||
|
|
|
@ -106,10 +106,13 @@ sub check_socket_path_length {
|
|||
my ($path)= @_;
|
||||
|
||||
return 0 if IS_WINDOWS;
|
||||
# This may not be true, but we can't test for it on AIX due to Perl bug
|
||||
# See Bug #45771
|
||||
return 0 if ($^O eq 'aix');
|
||||
|
||||
require IO::Socket::UNIX;
|
||||
|
||||
my $truncated= 1; # Be negative
|
||||
my $truncated= undef;
|
||||
|
||||
# Create a tempfile name with same length as "path"
|
||||
my $tmpdir = tempdir( CLEANUP => 0);
|
||||
|
@ -122,6 +125,7 @@ sub check_socket_path_length {
|
|||
Local => $testfile,
|
||||
Listen => 1,
|
||||
);
|
||||
$truncated= 1; # Be negatvie
|
||||
|
||||
die "Could not create UNIX domain socket: $!"
|
||||
unless defined $sock;
|
||||
|
@ -133,6 +137,9 @@ sub check_socket_path_length {
|
|||
|
||||
};
|
||||
|
||||
die "Unexpected failure when checking socket path length: $@"
|
||||
if $@ and not defined $truncated;
|
||||
|
||||
$sock= undef; # Close socket
|
||||
rmtree($tmpdir); # Remove the tempdir and any socket file created
|
||||
return $truncated;
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
safedir = $(prefix)/mysql-test/lib/My/SafeProcess
|
||||
testroot = $(prefix)
|
||||
safedir = $(testroot)/mysql-test/lib/My/SafeProcess
|
||||
#nobase_bin_PROGRAMS = ...
|
||||
safe_PROGRAMS = my_safe_process
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ int main(int argc, const char** argv )
|
|||
HANDLE job_handle;
|
||||
HANDLE wait_handles[NUM_HANDLES]= {0};
|
||||
PROCESS_INFORMATION process_info= {0};
|
||||
BOOL nocore= FALSE;
|
||||
|
||||
sprintf(safe_process_name, "safe_process[%d]", pid);
|
||||
|
||||
|
@ -188,22 +189,33 @@ int main(int argc, const char** argv )
|
|||
die("No real args -> nothing to do");
|
||||
/* Copy the remaining args to child_arg */
|
||||
for (int j= i+1; j < argc; j++) {
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to, "%s ", argv[j]);
|
||||
if (strchr (argv[j], ' ')) {
|
||||
/* Protect with "" if this arg contains a space */
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"\"%s\" ", argv[j]);
|
||||
} else {
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"%s ", argv[j]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
if ( strcmp(arg, "--verbose") == 0 )
|
||||
if (strcmp(arg, "--verbose") == 0)
|
||||
verbose++;
|
||||
else if ( strncmp(arg, "--parent-pid", 10) == 0 )
|
||||
{
|
||||
/* Override parent_pid with a value provided by user */
|
||||
const char* start;
|
||||
else if (strncmp(arg, "--parent-pid", 10) == 0)
|
||||
{
|
||||
/* Override parent_pid with a value provided by user */
|
||||
const char* start;
|
||||
if ((start= strstr(arg, "=")) == NULL)
|
||||
die("Could not find start of option value in '%s'", arg);
|
||||
start++; /* Step past = */
|
||||
if ((parent_pid= atoi(start)) == 0)
|
||||
die("Invalid value '%s' passed to --parent-id", start);
|
||||
}
|
||||
die("Could not find start of option value in '%s'", arg);
|
||||
start++; /* Step past = */
|
||||
if ((parent_pid= atoi(start)) == 0)
|
||||
die("Invalid value '%s' passed to --parent-id", start);
|
||||
}
|
||||
else if (strcmp(arg, "--nocore") == 0)
|
||||
{
|
||||
nocore= TRUE;
|
||||
}
|
||||
else
|
||||
die("Unknown option: %s", arg);
|
||||
}
|
||||
|
@ -241,6 +253,11 @@ int main(int argc, const char** argv )
|
|||
&jeli, sizeof(jeli)) == 0)
|
||||
message("SetInformationJobObject failed, continue anyway...");
|
||||
|
||||
/* Avoid popup box */
|
||||
if (nocore)
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX
|
||||
| SEM_NOOPENFILEERRORBOX);
|
||||
|
||||
#if 0
|
||||
/* Setup stdin, stdout and stderr redirect */
|
||||
si.dwFlags= STARTF_USESTDHANDLES;
|
||||
|
|
|
@ -41,6 +41,7 @@ our $opt_with_ndbcluster_only;
|
|||
our $defaults_file;
|
||||
our $defaults_extra_file;
|
||||
our $reorder= 1;
|
||||
our $quick_collect;
|
||||
|
||||
sub collect_option {
|
||||
my ($opt, $value)= @_;
|
||||
|
@ -68,6 +69,9 @@ require "mtr_misc.pl";
|
|||
my $do_test_reg;
|
||||
my $skip_test_reg;
|
||||
|
||||
# If "Quick collect", set to 1 once a test to run has been found.
|
||||
my $some_test_found;
|
||||
|
||||
sub init_pattern {
|
||||
my ($from, $what)= @_;
|
||||
return undef unless defined $from;
|
||||
|
@ -102,6 +106,7 @@ sub collect_test_cases ($$) {
|
|||
foreach my $suite (split(",", $suites))
|
||||
{
|
||||
push(@$cases, collect_one_suite($suite, $opt_cases));
|
||||
last if $some_test_found;
|
||||
}
|
||||
|
||||
if ( @$opt_cases )
|
||||
|
@ -139,7 +144,7 @@ sub collect_test_cases ($$) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( $reorder )
|
||||
if ( $reorder && !$quick_collect)
|
||||
{
|
||||
# Reorder the test cases in an order that will make them faster to run
|
||||
my %sort_criteria;
|
||||
|
@ -386,7 +391,7 @@ sub collect_one_suite($)
|
|||
# Read combinations for this suite and build testcases x combinations
|
||||
# if any combinations exists
|
||||
# ----------------------------------------------------------------------
|
||||
if ( ! $skip_combinations )
|
||||
if ( ! $skip_combinations && ! $quick_collect )
|
||||
{
|
||||
my @combinations;
|
||||
my $combination_file= "$suitedir/combinations";
|
||||
|
@ -584,6 +589,12 @@ sub optimize_cases {
|
|||
if ( $default_engine =~ /^innodb/i );
|
||||
}
|
||||
}
|
||||
|
||||
if ($quick_collect && ! $tinfo->{'skip'})
|
||||
{
|
||||
$some_test_found= 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -848,14 +859,14 @@ sub collect_one_test_case {
|
|||
if ( $tinfo->{'big_test'} and ! $::opt_big_test )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Test need 'big-test' option";
|
||||
$tinfo->{'comment'}= "Test needs 'big-test' option";
|
||||
return $tinfo
|
||||
}
|
||||
|
||||
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Test need debug binaries";
|
||||
$tinfo->{'comment'}= "Test needs debug binaries";
|
||||
return $tinfo
|
||||
}
|
||||
|
||||
|
@ -891,14 +902,14 @@ sub collect_one_test_case {
|
|||
|
||||
if ($tinfo->{'federated_test'})
|
||||
{
|
||||
# This is a test that need federated, enable it
|
||||
# This is a test that needs federated, enable it
|
||||
push(@{$tinfo->{'master_opt'}}, "--loose-federated");
|
||||
push(@{$tinfo->{'slave_opt'}}, "--loose-federated");
|
||||
}
|
||||
|
||||
if ( $tinfo->{'innodb_test'} )
|
||||
{
|
||||
# This is a test that need innodb
|
||||
# This is a test that needs innodb
|
||||
if ( $::mysqld_variables{'innodb'} eq "OFF" ||
|
||||
! exists $::mysqld_variables{'innodb'} )
|
||||
{
|
||||
|
@ -919,7 +930,7 @@ sub collect_one_test_case {
|
|||
if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Test need binlog";
|
||||
$tinfo->{'comment'}= "Test needs binlog";
|
||||
return $tinfo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,8 +134,8 @@ sub mtr_report_test ($) {
|
|||
# an asterisk at the end, determine if the characters up to
|
||||
# but excluding the asterisk are the same
|
||||
if ( $exp ne "" && substr($exp, -1, 1) eq "*" ) {
|
||||
$exp = substr($exp, 0, length($exp) - 1);
|
||||
if ( substr($test_name, 0, length($exp)) ne $exp ) {
|
||||
my $nexp = substr($exp, 0, length($exp) - 1);
|
||||
if ( substr($test_name, 0, length($nexp)) ne $nexp ) {
|
||||
# no match, try next entry
|
||||
next;
|
||||
}
|
||||
|
|
6
mysql-test/lib/v1/incompatible.tests
Normal file
6
mysql-test/lib/v1/incompatible.tests
Normal file
|
@ -0,0 +1,6 @@
|
|||
# This file lists tests that cannot run in MTR v1 for some reason.
|
||||
# They will be skipped.
|
||||
# Any text following white space after full test name is ignored
|
||||
# Only exact test names can be used, no regexp.
|
||||
|
||||
main.fulltext_plugin # Refers to $SIMPLE_PARSER_OPT which is not set
|
|
@ -32,6 +32,7 @@ sub mtr_options_from_test_file($$);
|
|||
|
||||
my $do_test;
|
||||
my $skip_test;
|
||||
my %incompatible;
|
||||
|
||||
sub init_pattern {
|
||||
my ($from, $what)= @_;
|
||||
|
@ -47,6 +48,15 @@ sub init_pattern {
|
|||
}
|
||||
|
||||
|
||||
sub collect_incomp_tests {
|
||||
open (INCOMP, "lib/v1/incompatible.tests");
|
||||
while (<INCOMP>)
|
||||
{
|
||||
next unless /^\w/;
|
||||
s/\s.*\n//; # Ignore anything from first white space
|
||||
$incompatible{$_}= 1;
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
|
@ -58,6 +68,8 @@ sub collect_test_cases ($) {
|
|||
$do_test= init_pattern($::opt_do_test, "--do-test");
|
||||
$skip_test= init_pattern($::opt_skip_test, "--skip-test");
|
||||
|
||||
collect_incomp_tests();
|
||||
|
||||
my $suites= shift; # Semicolon separated list of test suites
|
||||
my $cases = []; # Array of hash
|
||||
|
||||
|
@ -528,6 +540,17 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||
$tinfo->{'component_id'} = $component_id;
|
||||
push(@$cases, $tinfo);
|
||||
|
||||
# Remove "combinations" part of test name
|
||||
my $test_base_name= $tinfo->{'name'};
|
||||
$test_base_name=~ s/\s.*\n//;
|
||||
|
||||
if (exists ($incompatible{$test_base_name}))
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Test cannot run in mtr v1";
|
||||
return;
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Skip some tests but include in list, just mark them to skip
|
||||
# ----------------------------------------------------------------------
|
||||
|
@ -841,7 +864,7 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||
if ( $tinfo->{'innodb_test'} )
|
||||
{
|
||||
# This is a test that need innodb
|
||||
if ( $::mysqld_variables{'innodb'} ne "TRUE" )
|
||||
if ( $::mysqld_variables{'innodb'} eq "OFF" )
|
||||
{
|
||||
# innodb is not supported, skip it
|
||||
$tinfo->{'skip'}= 1;
|
||||
|
|
|
@ -209,6 +209,7 @@ sub check_timeout { return $opt_testcase_timeout * 6; };
|
|||
|
||||
my $opt_start;
|
||||
my $opt_start_dirty;
|
||||
my $start_only;
|
||||
my $opt_wait_all;
|
||||
my $opt_repeat= 1;
|
||||
my $opt_retry= 3;
|
||||
|
@ -984,6 +985,9 @@ sub command_line_setup {
|
|||
|
||||
if ( $opt_experimental )
|
||||
{
|
||||
# $^O on Windows considered not generic enough
|
||||
my $plat= (IS_WINDOWS) ? 'windows' : $^O;
|
||||
|
||||
# read the list of experimental test cases from the file specified on
|
||||
# the command line
|
||||
open(FILE, "<", $opt_experimental) or mtr_error("Can't read experimental file: $opt_experimental");
|
||||
|
@ -994,6 +998,15 @@ sub command_line_setup {
|
|||
# remove comments (# foo) at the beginning of the line, or after a
|
||||
# blank at the end of the line
|
||||
s/( +|^)#.*$//;
|
||||
# If @ platform specifier given, use this entry only if it contains
|
||||
# @<platform> or @!<xxx> where xxx != platform
|
||||
if (/\@.*/)
|
||||
{
|
||||
next if (/\@!$plat/);
|
||||
next unless (/\@$plat/ or /\@!/);
|
||||
# Then remove @ and everything after it
|
||||
s/\@.*$//;
|
||||
}
|
||||
# remove whitespace
|
||||
s/^ +//;
|
||||
s/ +$//;
|
||||
|
@ -1241,13 +1254,28 @@ sub command_line_setup {
|
|||
{
|
||||
mtr_error("Can't use --extern when using debugger");
|
||||
}
|
||||
# Set one week timeout (check-testcase timeout will be 1/10th)
|
||||
$opt_testcase_timeout= 7 * 24 * 60;
|
||||
$opt_suite_timeout= 7 * 24 * 60;
|
||||
# One day to shutdown
|
||||
$opt_shutdown_timeout= 24 * 60;
|
||||
# One day for PID file creation (this is given in seconds not minutes)
|
||||
$opt_start_timeout= 24 * 60 * 60;
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Modified behavior with --start options
|
||||
# --------------------------------------------------------------------------
|
||||
if ($opt_start or $opt_start_dirty) {
|
||||
collect_option ('quick-collect', 1);
|
||||
$start_only= 1;
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Check use of wait-all
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
if ($opt_wait_all && ! ($opt_start_dirty || $opt_start))
|
||||
if ($opt_wait_all && ! $start_only)
|
||||
{
|
||||
mtr_error("--wait-all can only be used with --start or --start-dirty");
|
||||
}
|
||||
|
@ -1506,6 +1534,10 @@ sub collect_mysqld_features_from_running_server ()
|
|||
}
|
||||
}
|
||||
|
||||
# "Convert" innodb flag
|
||||
$mysqld_variables{'innodb'}= "ON"
|
||||
if ($mysqld_variables{'have_innodb'} eq "YES");
|
||||
|
||||
# Parse version
|
||||
my $version_str= $mysqld_variables{'version'};
|
||||
if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)/ )
|
||||
|
@ -1764,7 +1796,7 @@ sub environment_setup {
|
|||
my $plugin_filename;
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
$plugin_filename = "ha_example.dll";
|
||||
$plugin_filename = "ha_example.dll";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1772,7 +1804,8 @@ sub environment_setup {
|
|||
}
|
||||
my $lib_example_plugin=
|
||||
mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
|
||||
"$basedir/storage/example/.libs/".$plugin_filename);
|
||||
"$basedir/storage/example/.libs/".$plugin_filename,
|
||||
"$basedir/lib/mysql/plugin/".$plugin_filename);
|
||||
$ENV{'EXAMPLE_PLUGIN'}=
|
||||
($lib_example_plugin ? basename($lib_example_plugin) : "");
|
||||
$ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
|
||||
|
@ -1781,6 +1814,14 @@ sub environment_setup {
|
|||
$ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
|
||||
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=;EXAMPLE=".$plugin_filename.";";
|
||||
}
|
||||
else
|
||||
{
|
||||
# Some ".opt" files use some of these variables, so they must be defined
|
||||
$ENV{'EXAMPLE_PLUGIN'}= "";
|
||||
$ENV{'EXAMPLE_PLUGIN_OPT'}= "";
|
||||
$ENV{'HA_EXAMPLE_SO'}= "";
|
||||
$ENV{'EXAMPLE_PLUGIN_LOAD'}= "";
|
||||
}
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Add the path where mysqld will find mypluglib.so
|
||||
|
@ -2811,7 +2852,7 @@ sub run_testcase_check_skip_test($)
|
|||
|
||||
if ( $tinfo->{'skip'} )
|
||||
{
|
||||
mtr_report_test_skipped($tinfo);
|
||||
mtr_report_test_skipped($tinfo) unless $start_only;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -3298,9 +3339,16 @@ sub run_testcase ($) {
|
|||
# server exits
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
if ( $opt_start or $opt_start_dirty )
|
||||
if ( $start_only )
|
||||
{
|
||||
mtr_print("\nStarted", started(all_servers()));
|
||||
mtr_print("Using config for test", $tinfo->{name});
|
||||
mtr_print("Port and socket path for server(s):");
|
||||
foreach my $mysqld ( mysqlds() )
|
||||
{
|
||||
mtr_print ($mysqld->name() . " " . $mysqld->value('port') .
|
||||
" " . $mysqld->value('socket'));
|
||||
}
|
||||
mtr_print("Waiting for server(s) to exit...");
|
||||
if ( $opt_wait_all ) {
|
||||
My::SafeProcess->wait_all();
|
||||
|
@ -3542,8 +3590,8 @@ sub run_testcase ($) {
|
|||
# error log and write all lines that look
|
||||
# suspicious into $error_log.warnings
|
||||
#
|
||||
sub extract_warning_lines ($) {
|
||||
my ($error_log) = @_;
|
||||
sub extract_warning_lines ($$) {
|
||||
my ($error_log, $tname) = @_;
|
||||
|
||||
# Open the servers .err log file and read all lines
|
||||
# belonging to current tets into @lines
|
||||
|
@ -3551,14 +3599,27 @@ sub extract_warning_lines ($) {
|
|||
or mtr_error("Could not open file '$error_log' for reading: $!");
|
||||
|
||||
my @lines;
|
||||
my $found_test= 0; # Set once we've found the log of this test
|
||||
while ( my $line = <$Ferr> )
|
||||
{
|
||||
if ( $line =~ /^CURRENT_TEST:/ )
|
||||
if ($found_test)
|
||||
{
|
||||
# Throw away lines from previous tests
|
||||
@lines = ();
|
||||
# If test wasn't last after all, discard what we found, test again.
|
||||
if ( $line =~ /^CURRENT_TEST:/)
|
||||
{
|
||||
@lines= ();
|
||||
$found_test= $line =~ /^CURRENT_TEST: $tname/;
|
||||
}
|
||||
else
|
||||
{
|
||||
push(@lines, $line);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# Search for beginning of test, until found
|
||||
$found_test= 1 if ($line =~ /^CURRENT_TEST: $tname/);
|
||||
}
|
||||
push(@lines, $line);
|
||||
}
|
||||
$Ferr = undef; # Close error log file
|
||||
|
||||
|
@ -3595,10 +3656,8 @@ sub extract_warning_lines ($) {
|
|||
# and correcting them shows a few additional harmless warnings.
|
||||
# Thus those patterns are temporarily removed from the list
|
||||
# of patterns. For more info see BUG#42408
|
||||
# qr/^Warning:|mysqld: Warning|\[Warning\]/,
|
||||
# qr/^Error:|\[ERROR\]/,
|
||||
qr/^Warning:|mysqld: Warning/,
|
||||
qr/^Error:/,
|
||||
qr/^Warning:|mysqld: Warning|\[Warning\]/,
|
||||
qr/^Error:|\[ERROR\]/,
|
||||
qr/^==.* at 0x/,
|
||||
qr/InnoDB: Warning|InnoDB: Error/,
|
||||
qr/^safe_mutex:|allocated at line/,
|
||||
|
@ -3638,7 +3697,7 @@ sub start_check_warnings ($$) {
|
|||
my $log_error= $mysqld->value('#log-error');
|
||||
# To be communicated to the test
|
||||
$ENV{MTR_LOG_ERROR}= $log_error;
|
||||
extract_warning_lines($log_error);
|
||||
extract_warning_lines($log_error, $tinfo->{name});
|
||||
|
||||
my $args;
|
||||
mtr_init_args(\$args);
|
||||
|
@ -4078,8 +4137,8 @@ sub mysqld_arguments ($$$) {
|
|||
|
||||
if ( $mysql_version_id >= 50106 )
|
||||
{
|
||||
# Turn on logging to both tables and file
|
||||
mtr_add_arg($args, "--log-output=table,file");
|
||||
# Turn on logging to file
|
||||
mtr_add_arg($args, "--log-output=file");
|
||||
}
|
||||
|
||||
# Check if "extra_opt" contains skip-log-bin
|
||||
|
@ -5123,7 +5182,7 @@ Options to control what test suites or cases to run
|
|||
skip-rpl Skip the replication test cases.
|
||||
big-test Also run tests marked as "big"
|
||||
enable-disabled Run also tests marked as disabled
|
||||
print_testcases Don't run the tests but print details about all the
|
||||
print-testcases Don't run the tests but print details about all the
|
||||
selected tests, in the order they would be run.
|
||||
|
||||
Options that specify ports
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("The table 't1' is full");
|
||||
drop table if exists t1;
|
||||
set global myisam_data_pointer_size=2;
|
||||
CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;
|
||||
|
|
|
@ -28,9 +28,7 @@ test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL
|
|||
test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL
|
||||
drop table t1,t2;
|
||||
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
create table t1 (a int not null);
|
||||
create table t2 select * from t1 where 0=1 procedure analyse();
|
||||
show create table t2;
|
||||
|
@ -153,4 +151,9 @@ select f3 from t1 procedure analyse(1, 1);
|
|||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.f3 5.99999 9.55555 7 7 0 0 7.77777 1.77778 FLOAT(6,5) NOT NULL
|
||||
drop table t1;
|
||||
CREATE TABLE t1(a INT,b INT,c INT,d INT,e INT,f INT,g INT,h INT,i INT,j INT,k INT);
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
|
|
|
@ -12695,3 +12695,25 @@ a b
|
|||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a INT, b BLOB) ENGINE=archive;
|
||||
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
|
||||
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
|
||||
DATA_LENGTH AVG_ROW_LENGTH
|
||||
8666 15
|
||||
INSERT INTO t1 VALUES(1, 'sampleblob1'),(2, 'sampleblob2');
|
||||
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
|
||||
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
|
||||
DATA_LENGTH AVG_ROW_LENGTH
|
||||
8700 4350
|
||||
DROP TABLE t1;
|
||||
SET @save_join_buffer_size= @@join_buffer_size;
|
||||
SET @@join_buffer_size= 8228;
|
||||
CREATE TABLE t1(a CHAR(255)) ENGINE=archive;
|
||||
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
|
||||
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
|
||||
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
|
||||
SELECT COUNT(t1.a) FROM t1, t1 a, t1 b, t1 c, t1 d, t1 e;
|
||||
COUNT(t1.a)
|
||||
729
|
||||
DROP TABLE t1;
|
||||
SET @@join_buffer_size= @save_join_buffer_size;
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# Bug #46080: group_concat(... order by) crashes server when
|
||||
# sort_buffer_size cannot allocate
|
||||
#
|
||||
call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
|
||||
call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
|
||||
CREATE TABLE t1(a CHAR(255));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
SET @@SESSION.sort_buffer_size=5*16*1000000;
|
||||
|
|
|
@ -841,17 +841,17 @@ call p_verify_status_increment(2, 0, 2, 0);
|
|||
SUCCESS
|
||||
|
||||
alter table t3 rename t4;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
SUCCESS
|
||||
|
||||
rename table t4 to t3;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
SUCCESS
|
||||
|
||||
truncate table t3;
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
ERROR
|
||||
Expected commit increment: 4 actual: 2
|
||||
SUCCESS
|
||||
|
||||
create view v1 as select * from t2;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
SUCCESS
|
||||
|
|
|
@ -1572,6 +1572,19 @@ CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
|||
SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# BUG#46384 - mysqld segfault when trying to create table with same
|
||||
# name as existing view
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
INSERT INTO t2 VALUES (1),(2),(3);
|
||||
CREATE VIEW v1 AS SELECT t1.a FROM t1, t2;
|
||||
CREATE TABLE v1 AS SELECT * FROM t1;
|
||||
ERROR 42S01: Table 'v1' already exists
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
RESET MASTER;
|
||||
SET NAMES gbk;
|
||||
CREATE TABLE t1 (
|
||||
f1 BLOB
|
||||
|
|
|
@ -763,4 +763,34 @@ a b d c
|
|||
1 2 0 2
|
||||
1 2 0 3
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #46159: simple query that never returns
|
||||
#
|
||||
SET @old_max_heap_table_size = @@max_heap_table_size;
|
||||
SET @@max_heap_table_size = 16384;
|
||||
SET @old_sort_buffer_size = @@sort_buffer_size;
|
||||
SET @@sort_buffer_size = 32804;
|
||||
CREATE TABLE t1(c1 int, c2 VARCHAR(20));
|
||||
INSERT INTO t1 VALUES (1, '1'), (1, '1'), (2, '2'), (3, '1'), (3, '1'), (4, '4');
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
INSERT INTO t1 SELECT 5 + 10000 * RAND(), '5' FROM t1;
|
||||
SELECT c1, c2, COUNT(*) FROM t1 GROUP BY c1 LIMIT 4;
|
||||
c1 c2 COUNT(*)
|
||||
1 1 2
|
||||
2 2 1
|
||||
3 1 2
|
||||
4 4 1
|
||||
SELECT DISTINCT c2 FROM t1 GROUP BY c1 HAVING COUNT(*) > 1;
|
||||
c2
|
||||
1
|
||||
5
|
||||
DROP TABLE t1;
|
||||
SET @@sort_buffer_size = @old_sort_buffer_size;
|
||||
SET @@max_heap_table_size = @old_max_heap_table_size;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -159,6 +159,14 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
|
|||
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
|
||||
ERROR 42000: Key 'a' doesn't exist in table 't1'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a LONGTEXT);
|
||||
INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
|
||||
INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
|
||||
EXPLAIN SELECT DISTINCT 1 FROM t1,
|
||||
(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) as d1
|
||||
WHERE t1.a = d1.a;
|
||||
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#37870: Usage of uninitialized value caused failed assertion.
|
||||
#
|
||||
|
|
|
@ -2534,6 +2534,15 @@ SELECT LOAD_FILE(a) FROM t1;
|
|||
LOAD_FILE(a)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f2 VARCHAR(20));
|
||||
CREATE TABLE t2 (f2 VARCHAR(20));
|
||||
INSERT INTO t1 VALUES ('MIN'),('MAX');
|
||||
INSERT INTO t2 VALUES ('LOAD');
|
||||
SELECT CONCAT_WS('_', (SELECT t2.f2 FROM t2), t1.f2) AS concat_name FROM t1;
|
||||
concat_name
|
||||
LOAD_MIN
|
||||
LOAD_MAX
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
drop table if exists t1;
|
||||
create table t1(f1 tinyint default null)engine=myisam;
|
||||
|
|
|
@ -2502,3 +2502,15 @@ a MAX(b)
|
|||
2 1
|
||||
DROP TABLE t;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM) results in
|
||||
# server crash
|
||||
#
|
||||
CREATE TABLE t (a INT, b INT, INDEX (a,b));
|
||||
INSERT INTO t VALUES (2,0), (2,0), (2,1), (2,1);
|
||||
INSERT INTO t SELECT * FROM t;
|
||||
SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
|
||||
a MAX(b)
|
||||
2 1
|
||||
DROP TABLE t;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -841,6 +841,7 @@ SET max_heap_table_size = 16384;
|
|||
SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size;
|
||||
SET GLOBAL myisam_data_pointer_size = 2;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
call mtr.add_suppression("mysqld: The table '.*#sql.*' is full");
|
||||
INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
|
||||
Got one of the listed errors
|
||||
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
SET @odl_sync_frm = @@global.sync_frm;
|
||||
SET @@global.sync_frm = OFF;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1( a INT, b INT );
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
|
@ -17,3 +19,4 @@ ALTER TABLE t1 ADD COLUMN a INT;
|
|||
# 2.2.1. normal mode
|
||||
# 2.2.2. PS mode
|
||||
DROP TABLE t1;
|
||||
SET @@global.sync_frm = @odl_sync_frm;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
SET @odl_sync_frm = @@global.sync_frm;
|
||||
SET @@global.sync_frm = OFF;
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
CREATE TABLE t1 (
|
||||
a int(11) unsigned default NULL,
|
||||
|
@ -15,3 +17,4 @@ CREATE TABLE t3 SELECT * FROM t1;
|
|||
# normal mode
|
||||
# PS mode
|
||||
DROP TABLE t1, t2, t3;
|
||||
SET @@global.sync_frm = @odl_sync_frm;
|
||||
|
|
6
mysql-test/r/lowercase_mixed_tmpdir_innodb.result
Executable file
6
mysql-test/r/lowercase_mixed_tmpdir_innodb.result
Executable file
|
@ -0,0 +1,6 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (id int) engine=InnoDB;
|
||||
insert into t1 values (1);
|
||||
create temporary table t2 engine=InnoDB select * from t1;
|
||||
drop temporary table t2;
|
||||
drop table t1;
|
|
@ -1,4 +1,4 @@
|
|||
call mtr.add_suppression("Cannot find or open table test/BUG29839 from .*");
|
||||
call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
|
||||
DROP TABLE IF EXISTS t1,T1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
SELECT * FROM T1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
flush logs;
|
||||
RESET MASTER;
|
||||
create table t3 (f text character set utf8);
|
||||
create table t4 (f text character set cp932);
|
||||
flush logs;
|
||||
|
|
|
@ -215,7 +215,7 @@ COMMIT/*!*/;
|
|||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t1
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
|
@ -223,6 +223,22 @@ SET TIMESTAMP=1000000000/*!*/;
|
|||
TRUNCATE TABLE t1
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Xid = #
|
||||
COMMIT/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t1
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Xid = #
|
||||
COMMIT/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
BEGIN
|
||||
|
@ -331,9 +347,17 @@ COMMIT/*!*/;
|
|||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t1
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Xid = #
|
||||
COMMIT/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t2
|
||||
|
@ -449,9 +473,17 @@ ROLLBACK
|
|||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t1
|
||||
/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Xid = #
|
||||
COMMIT/*!*/;
|
||||
# at #
|
||||
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
TRUNCATE TABLE t2
|
||||
|
|
|
@ -314,21 +314,10 @@ here is the sourced script
|
|||
1 = outer loop variable before dec
|
||||
|
||||
0 = outer loop variable after dec
|
||||
|
||||
2 = outer loop variable after while
|
||||
outer=2 ifval=0
|
||||
outer=1 ifval=1
|
||||
here is the sourced script
|
||||
|
||||
2 = outer loop variable before dec
|
||||
|
||||
1 = outer loop variable after dec
|
||||
|
||||
1 = outer loop variable after while
|
||||
here is the sourced script
|
||||
|
||||
1 = outer loop variable before dec
|
||||
|
||||
0 = outer loop variable after dec
|
||||
|
||||
In loop
|
||||
here is the sourced script
|
||||
|
||||
|
@ -538,6 +527,10 @@ mysqltest: At line 1: Missing required argument 'filename' to command 'write_fil
|
|||
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
|
||||
Content for test_file1
|
||||
mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp'
|
||||
These lines should be repeated,
|
||||
if things work as expected
|
||||
These lines should be repeated,
|
||||
if things work as expected
|
||||
Some data
|
||||
for cat_file command
|
||||
of mysqltest
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("Failed to write to mysql.general_log");
|
||||
drop table if exists t1;
|
||||
create table t1 (a int)
|
||||
engine = csv
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (a int not null,
|
||||
b datetime not null,
|
||||
primary key (a,b))
|
||||
engine=innodb
|
||||
partition by range (to_days(b))
|
||||
subpartition by hash (a)
|
||||
subpartitions 2
|
||||
( partition p0 values less than (to_days('2009-01-01')),
|
||||
partition p1 values less than (to_days('2009-02-01')),
|
||||
partition p2 values less than (to_days('2009-03-01')),
|
||||
partition p3 values less than maxvalue);
|
||||
alter table t1 reorganize partition p1,p2 into
|
||||
( partition p2 values less than (to_days('2009-03-01')));
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
|
||||
PARTITION BY RANGE(id) (
|
||||
PARTITION p0 VALUES LESS THAN (5),
|
||||
|
@ -250,3 +264,7 @@ SUBPARTITION BY KEY (char_column)
|
|||
SUBPARTITIONS 2
|
||||
(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB
|
||||
PARTITION BY list(a) (PARTITION p1 VALUES IN (1));
|
||||
CREATE INDEX i1 ON t1 (a);
|
||||
DROP TABLE t1;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -745,7 +745,7 @@ a
|
|||
EXPLAIN PARTITIONS SELECT * FROM t1
|
||||
WHERE a >= '2004-07-01' AND a <= '2004-09-30';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p407,p408,p409 ALL NULL NULL NULL NULL 9 Using where
|
||||
1 SIMPLE t1 p3xx,p407,p408,p409 ALL NULL NULL NULL NULL 18 Using where
|
||||
SELECT * from t1
|
||||
WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
|
||||
(a >= '2005-07-01' AND a <= '2005-09-30');
|
||||
|
@ -772,7 +772,7 @@ EXPLAIN PARTITIONS SELECT * from t1
|
|||
WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
|
||||
(a >= '2005-07-01' AND a <= '2005-09-30');
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where
|
||||
1 SIMPLE t1 p3xx,p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 27 Using where
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
|
|
@ -6963,6 +6963,22 @@ CALL p1();
|
|||
CALL p1();
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #46629: Item_in_subselect::val_int(): Assertion `0'
|
||||
# on subquery inside a SP
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(a INT, b INT PRIMARY KEY);
|
||||
CREATE PROCEDURE p1 ()
|
||||
BEGIN
|
||||
SELECT a FROM t1 A WHERE A.b IN (SELECT b FROM t2 AS B);
|
||||
END|
|
||||
CALL p1;
|
||||
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
|
||||
CALL p1;
|
||||
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1, t2;
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -75,7 +75,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
|
|||
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
|
||||
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
|
||||
ERROR 42S22: Unknown column 'a' in 'field list'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
|
||||
|
@ -4383,6 +4383,34 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||
1 PRIMARY C ALL NULL NULL NULL NULL 20 100.00 Using where
|
||||
DROP TABLE C;
|
||||
# End of test for bug#45061.
|
||||
#
|
||||
# Bug #46749: Segfault in add_key_fields() with outer subquery level
|
||||
# field references
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a int,
|
||||
b int,
|
||||
UNIQUE (a), KEY (b)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1,1), (2,1);
|
||||
CREATE TABLE st1 like t1;
|
||||
INSERT INTO st1 VALUES (1,1), (2,1);
|
||||
CREATE TABLE st2 like t1;
|
||||
INSERT INTO st2 VALUES (1,1), (2,1);
|
||||
EXPLAIN
|
||||
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
|
||||
FROM t1
|
||||
WHERE a = 230;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 DEPENDENT SUBQUERY st1 index NULL a 5 NULL 2 Using index
|
||||
2 DEPENDENT SUBQUERY st2 index b b 5 NULL 2 Using where; Using index; Using join buffer
|
||||
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
|
||||
FROM t1
|
||||
WHERE a = 230;
|
||||
MAX(b) (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
|
||||
NULL 0
|
||||
DROP TABLE t1, st1, st2;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
|
30
mysql-test/r/subselect4.result
Normal file
30
mysql-test/r/subselect4.result
Normal file
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Bug #46791: Assertion failed:(table->key_read==0),function unknown
|
||||
# function,file sql_base.cc
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, KEY(a));
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 VALUES (1,1),(2,2);
|
||||
CREATE TABLE t3 LIKE t1;
|
||||
# should have 1 impossible where and 2 dependent subqueries
|
||||
EXPLAIN
|
||||
SELECT 1 FROM t1
|
||||
WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
|
||||
ORDER BY count(*);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index NULL a 5 NULL 2 Using index; Using temporary
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||
# should not crash the next statement
|
||||
SELECT 1 FROM t1
|
||||
WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
|
||||
ORDER BY count(*);
|
||||
1
|
||||
1
|
||||
# should not crash: the crash is caused by the previous statement
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1,t2,t3;
|
||||
End of 5.0 tests.
|
|
@ -180,8 +180,6 @@ NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFOR
|
|||
DROP USER mysqltest_dfn@localhost;
|
||||
DROP USER mysqltest_inv@localhost;
|
||||
DROP DATABASE mysqltest_db1;
|
||||
Warnings:
|
||||
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
|
||||
DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
|
||||
DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
|
||||
DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
|
||||
|
|
|
@ -392,4 +392,20 @@ a
|
|||
4
|
||||
DROP FUNCTION sequence;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
|
||||
#
|
||||
CREATE TABLE t1 ( a INT );
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
SELECT IF( a = 1, a, a ) AS `b` FROM t1 ORDER BY field( `b` + 1, 1 );
|
||||
b
|
||||
1
|
||||
2
|
||||
3
|
||||
SELECT IF( a = 1, a, a ) AS `b` FROM t1 ORDER BY field( `b`, 1 );
|
||||
b
|
||||
2
|
||||
3
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
|
|
@ -108,11 +108,7 @@ a-b-c
|
|||
show create view `a-b-c`.v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`) utf8 utf8_general_ci
|
||||
Warnings:
|
||||
Note 1600 Creation context of view `a-b-c`.`v1' is invalid
|
||||
select * from `a-b-c`.v1;
|
||||
f1
|
||||
Warnings:
|
||||
Note 1600 Creation context of view `a-b-c`.`v1' is invalid
|
||||
drop database `a-b-c`;
|
||||
use test;
|
||||
|
|
|
@ -313,4 +313,9 @@ ERROR 22001: Data too long for column 'c_tinytext' at row 1
|
|||
insert into t2 values(@q);
|
||||
ERROR 22001: Data too long for column 'c_tinyblob' at row 1
|
||||
drop table t1, t2;
|
||||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
SHOW ERRORS;
|
||||
Level Code Message
|
||||
Error 1051 Unknown table 't1'
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
RESET MASTER;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT * FROM t1;
|
||||
|
|
|
@ -379,7 +379,9 @@ master-bin.000001 # Query # # BEGIN
|
|||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
|
@ -838,8 +840,10 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
|||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
count(*)
|
||||
4
|
||||
|
|
|
@ -17,5 +17,5 @@ master-bin.000001 # Query # # create database `drop-temp+table-test`
|
|||
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn1 (a int)
|
||||
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table `table:name` (a int)
|
||||
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn2 (a int)
|
||||
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1`
|
||||
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
|
||||
drop database `drop-temp+table-test`;
|
||||
|
|
|
@ -258,7 +258,7 @@ master-bin.000001 # Query # # use `test`; create table t0 (n int)
|
|||
master-bin.000001 # Query # # use `test`; insert t0 select * from t1
|
||||
master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null)
|
||||
master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
|
||||
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti`
|
||||
do release_lock("lock1");
|
||||
drop table t0,t2;
|
||||
set autocommit=0;
|
||||
|
@ -346,7 +346,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
|
|||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t2
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6)
|
||||
|
@ -545,8 +547,10 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
|||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
count(*)
|
||||
|
@ -782,8 +786,10 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
|||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
count(*)
|
||||
4
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
RESET MASTER;
|
||||
create table foo (a int);
|
||||
flush logs;
|
||||
create temporary table tmp1_foo like foo;
|
||||
|
|
|
@ -6,6 +6,7 @@ source include/have_log_bin.inc;
|
|||
source include/have_debug.inc;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
|
@ -24,4 +25,4 @@ exec $MYSQL_BINLOG --start-position=106 $MYSQLD_DATADIR/master-bin.000001 >$MYSQ
|
|||
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
|
||||
--enable_query_log
|
||||
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
|
||||
|
|
|
@ -30,6 +30,7 @@ source include/have_binlog_format_mixed_or_statement.inc;
|
|||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
RESET MASTER;
|
||||
|
||||
create table foo (a int);
|
||||
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
|
||||
ndb_trig_1011ext: Bug#47564
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
|
||||
select @@innodb_file_format;
|
||||
@@innodb_file_format
|
||||
Antelope
|
||||
|
|
|
@ -1 +1 @@
|
|||
innodb-index: InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
|
||||
innodb-index : Bug#47563 2009-06-11 svoj InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
-- source include/have_innodb.inc
|
||||
|
||||
call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
|
||||
|
||||
let $format=`select @@innodb_file_format`;
|
||||
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
|
||||
|
||||
|
|
|
@ -623,3 +623,195 @@ SHOW CREATE TABLE t1;
|
|||
SELECT * FROM t1 ORDER BY c1;
|
||||
DROP TABLE t1;
|
||||
|
||||
if (!$skip_negative_auto_inc)
|
||||
{
|
||||
--echo #############################################################################
|
||||
--echo # Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
|
||||
--echo # Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
|
||||
--echo ##############################################################################
|
||||
|
||||
--echo # Inserting negative autoincrement values into a partition table (partitions >= 4)
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Reading from a partition table (partitions >= 2 ) after inserting a negative
|
||||
--echo # value into the auto increment column
|
||||
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
|
||||
INSERT INTO t VALUES (-2,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Inserting negative auto increment value into a partition table (partitions >= 2)
|
||||
--echo # auto increment value > 2.
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
|
||||
INSERT INTO t VALUES (-4,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Inserting -1 into autoincrement column of a partition table (partition >= 4)
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Deleting from an auto increment table after inserting negative values
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t VALUES (-3,-20);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
if (!$skip_delete)
|
||||
{
|
||||
DELETE FROM t WHERE c1 > 1;
|
||||
}
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Inserting a positive value that exceeds maximum allowed value for an
|
||||
--echo # Auto Increment column (positive maximum)
|
||||
|
||||
eval CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t VALUES (128,50);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t VALUES (129,60);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Inserting a negative value that goes below minimum allowed value for an
|
||||
--echo # Auto Increment column (negative minimum)
|
||||
|
||||
eval CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-127,30);
|
||||
INSERT INTO t VALUES (-128,40);
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t VALUES (-129,50);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t VALUES (-130,60);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Updating the partition table with a negative Auto Increment value
|
||||
|
||||
eval CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
if (!$skip_update)
|
||||
{
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
}
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
INSERT INTO t(c2) VALUES (50);
|
||||
|
||||
if (!$skip_update)
|
||||
{
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
}
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # Updating the partition table with a value that crosses the upper limits
|
||||
--echo # on both the positive and the negative side.
|
||||
|
||||
eval CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE=$engine PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
if (!$skip_update)
|
||||
{
|
||||
UPDATE t SET c1 = 130 where c1 = 127;
|
||||
}
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
if (!$skip_update)
|
||||
{
|
||||
UPDATE t SET c1 = -140 where c1 = 126;
|
||||
}
|
||||
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo ##############################################################################
|
||||
}
|
||||
|
|
|
@ -825,3 +825,194 @@ c1
|
|||
4
|
||||
5
|
||||
DROP TABLE t1;
|
||||
#############################################################################
|
||||
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
|
||||
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
|
||||
##############################################################################
|
||||
# Inserting negative autoincrement values into a partition table (partitions >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DROP TABLE t;
|
||||
# Reading from a partition table (partitions >= 2 ) after inserting a negative
|
||||
# value into the auto increment column
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-2,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-2 -20
|
||||
1 30
|
||||
DROP TABLE t;
|
||||
# Inserting negative auto increment value into a partition table (partitions >= 2)
|
||||
# auto increment value > 2.
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-4,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-4 -20
|
||||
1 30
|
||||
2 40
|
||||
DROP TABLE t;
|
||||
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
DROP TABLE t;
|
||||
# Deleting from an auto increment table after inserting negative values
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t VALUES (-3,-20);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DELETE FROM t WHERE c1 > 1;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
DROP TABLE t;
|
||||
# Inserting a positive value that exceeds maximum allowed value for an
|
||||
# Auto Increment column (positive maximum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
INSERT INTO t VALUES (128,50);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (129,60);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
# Inserting a negative value that goes below minimum allowed value for an
|
||||
# Auto Increment column (negative minimum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-127,30);
|
||||
INSERT INTO t VALUES (-128,40);
|
||||
INSERT INTO t VALUES (-129,50);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (-130,60);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 40
|
||||
-127 30
|
||||
1 10
|
||||
2 20
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a negative Auto Increment value
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
INSERT INTO t(c2) VALUES (50);
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
4 40
|
||||
5 50
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a value that crosses the upper limits
|
||||
# on both the positive and the negative side.
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = 130 where c1 = 127;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = -140 where c1 = 126;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 30
|
||||
1 10
|
||||
2 20
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
##############################################################################
|
||||
|
|
|
@ -851,3 +851,194 @@ c1
|
|||
4
|
||||
5
|
||||
DROP TABLE t1;
|
||||
#############################################################################
|
||||
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
|
||||
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
|
||||
##############################################################################
|
||||
# Inserting negative autoincrement values into a partition table (partitions >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DROP TABLE t;
|
||||
# Reading from a partition table (partitions >= 2 ) after inserting a negative
|
||||
# value into the auto increment column
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-2,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-2 -20
|
||||
1 30
|
||||
DROP TABLE t;
|
||||
# Inserting negative auto increment value into a partition table (partitions >= 2)
|
||||
# auto increment value > 2.
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-4,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-4 -20
|
||||
1 30
|
||||
2 40
|
||||
DROP TABLE t;
|
||||
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
DROP TABLE t;
|
||||
# Deleting from an auto increment table after inserting negative values
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t VALUES (-3,-20);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DELETE FROM t WHERE c1 > 1;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
DROP TABLE t;
|
||||
# Inserting a positive value that exceeds maximum allowed value for an
|
||||
# Auto Increment column (positive maximum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
INSERT INTO t VALUES (128,50);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (129,60);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
# Inserting a negative value that goes below minimum allowed value for an
|
||||
# Auto Increment column (negative minimum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-127,30);
|
||||
INSERT INTO t VALUES (-128,40);
|
||||
INSERT INTO t VALUES (-129,50);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (-130,60);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 40
|
||||
-127 30
|
||||
1 10
|
||||
2 20
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a negative Auto Increment value
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
INSERT INTO t(c2) VALUES (50);
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
4 40
|
||||
5 50
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a value that crosses the upper limits
|
||||
# on both the positive and the negative side.
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = 130 where c1 = 127;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = -140 where c1 = 126;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 30
|
||||
1 10
|
||||
2 20
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
##############################################################################
|
||||
|
|
|
@ -870,3 +870,194 @@ c1
|
|||
4
|
||||
5
|
||||
DROP TABLE t1;
|
||||
#############################################################################
|
||||
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
|
||||
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
|
||||
##############################################################################
|
||||
# Inserting negative autoincrement values into a partition table (partitions >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DROP TABLE t;
|
||||
# Reading from a partition table (partitions >= 2 ) after inserting a negative
|
||||
# value into the auto increment column
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-2,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-2 -20
|
||||
1 30
|
||||
DROP TABLE t;
|
||||
# Inserting negative auto increment value into a partition table (partitions >= 2)
|
||||
# auto increment value > 2.
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-4,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-4 -20
|
||||
1 30
|
||||
2 40
|
||||
DROP TABLE t;
|
||||
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
DROP TABLE t;
|
||||
# Deleting from an auto increment table after inserting negative values
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t VALUES (-3,-20);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DELETE FROM t WHERE c1 > 1;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
DROP TABLE t;
|
||||
# Inserting a positive value that exceeds maximum allowed value for an
|
||||
# Auto Increment column (positive maximum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
INSERT INTO t VALUES (128,50);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (129,60);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
# Inserting a negative value that goes below minimum allowed value for an
|
||||
# Auto Increment column (negative minimum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-127,30);
|
||||
INSERT INTO t VALUES (-128,40);
|
||||
INSERT INTO t VALUES (-129,50);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (-130,60);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 40
|
||||
-127 30
|
||||
1 10
|
||||
2 20
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a negative Auto Increment value
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
INSERT INTO t(c2) VALUES (50);
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
4 40
|
||||
5 50
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a value that crosses the upper limits
|
||||
# on both the positive and the negative side.
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = 130 where c1 = 127;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = -140 where c1 = 126;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 30
|
||||
1 10
|
||||
2 20
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
##############################################################################
|
||||
|
|
|
@ -846,3 +846,194 @@ c1
|
|||
4
|
||||
5
|
||||
DROP TABLE t1;
|
||||
#############################################################################
|
||||
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
|
||||
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
|
||||
##############################################################################
|
||||
# Inserting negative autoincrement values into a partition table (partitions >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DROP TABLE t;
|
||||
# Reading from a partition table (partitions >= 2 ) after inserting a negative
|
||||
# value into the auto increment column
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-2,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-2 -20
|
||||
1 30
|
||||
DROP TABLE t;
|
||||
# Inserting negative auto increment value into a partition table (partitions >= 2)
|
||||
# auto increment value > 2.
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
|
||||
INSERT INTO t VALUES (-4,-20);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-4 -20
|
||||
1 30
|
||||
2 40
|
||||
DROP TABLE t;
|
||||
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
DROP TABLE t;
|
||||
# Deleting from an auto increment table after inserting negative values
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
INSERT INTO t VALUES (-3,-20);
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
4 40
|
||||
DELETE FROM t WHERE c1 > 1;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-3 -20
|
||||
-1 -10
|
||||
1 10
|
||||
DROP TABLE t;
|
||||
# Inserting a positive value that exceeds maximum allowed value for an
|
||||
# Auto Increment column (positive maximum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
INSERT INTO t VALUES (128,50);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (129,60);
|
||||
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
# Inserting a negative value that goes below minimum allowed value for an
|
||||
# Auto Increment column (negative minimum)
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-127,30);
|
||||
INSERT INTO t VALUES (-128,40);
|
||||
INSERT INTO t VALUES (-129,50);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
INSERT INTO t VALUES (-130,60);
|
||||
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 40
|
||||
-127 30
|
||||
1 10
|
||||
2 20
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a negative Auto Increment value
|
||||
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (-1,-10);
|
||||
INSERT INTO t(c2) VALUES (30);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-1 -10
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
INSERT INTO t(c2) VALUES (40);
|
||||
INSERT INTO t(c2) VALUES (50);
|
||||
UPDATE t SET c1 = -6 WHERE c1 = 2;
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-6 20
|
||||
-1 -10
|
||||
1 10
|
||||
3 30
|
||||
4 40
|
||||
5 50
|
||||
DROP TABLE t;
|
||||
# Updating the partition table with a value that crosses the upper limits
|
||||
# on both the positive and the negative side.
|
||||
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
|
||||
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
|
||||
INSERT INTO t(c2) VALUES (10);
|
||||
INSERT INTO t(c2) VALUES (20);
|
||||
INSERT INTO t VALUES (126,30);
|
||||
INSERT INTO t VALUES (127,40);
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = 130 where c1 = 127;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
1 10
|
||||
2 20
|
||||
126 30
|
||||
127 40
|
||||
UPDATE t SET c1 = -140 where c1 = 126;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t ORDER BY c1 ASC;
|
||||
c1 c2
|
||||
-128 30
|
||||
1 10
|
||||
2 20
|
||||
127 40
|
||||
DROP TABLE t;
|
||||
##############################################################################
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
call mtr.add_suppression("./test/t1_will_crash");
|
||||
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
|
||||
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
|
||||
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
|
||||
FLUSH TABLES;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
partition_basic_ndb : Bug#19899 Crashing the server
|
||||
partition_basic_ndb : Bug#44919 parts-suite in mtr tries to use features not supported by ndb
|
||||
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
|
||||
partition_syntax_ndb : Bug#36735 Not supported
|
||||
|
|
|
@ -30,6 +30,9 @@ let $skip_delete= 1;
|
|||
let $skip_truncate= 1;
|
||||
let $skip_update= 1;
|
||||
let $only_ai_pk= 1;
|
||||
# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
|
||||
# Archive does not handle negative autoincrement values correctly
|
||||
let $skip_negative_auto_inc= 1;
|
||||
|
||||
##### Storage engine to be tested
|
||||
let $engine= 'Archive';
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#------------------------------------------------------------------------------#
|
||||
# Engine specific settings and requirements
|
||||
--source include/have_blackhole.inc
|
||||
# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
|
||||
# Blackhole does not handle negative autoincrement values correctly
|
||||
let $skip_negative_auto_inc= 1;
|
||||
|
||||
##### Storage engine to be tested
|
||||
let $engine= 'Blackhole';
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
# test the auto-recover (--myisam-recover) of partitioned myisam tables
|
||||
|
||||
call mtr.add_suppression("./test/t1_will_crash");
|
||||
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
|
||||
|
||||
--source include/have_partition.inc
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
|
|
|
@ -244,3 +244,71 @@ t1 CREATE TABLE `t1` (
|
|||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
|
||||
CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
|
||||
SET SQL_MODE='';
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t2 VALUES(NULL);
|
||||
SELECT * FROM t1;
|
||||
id
|
||||
1
|
||||
SELECT * FROM t2;
|
||||
id
|
||||
1
|
||||
INSERT INTO t1 VALUES();
|
||||
INSERT INTO t2 VALUES();
|
||||
SELECT * FROM t1;
|
||||
id
|
||||
1
|
||||
2
|
||||
SELECT * FROM t2;
|
||||
id
|
||||
1
|
||||
2
|
||||
INSERT INTO t1 VALUES(0);
|
||||
INSERT INTO t2 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
id
|
||||
1
|
||||
2
|
||||
3
|
||||
SELECT * FROM t2;
|
||||
id
|
||||
1
|
||||
2
|
||||
3
|
||||
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
INSERT INTO t2 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
id
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
SELECT * FROM t2;
|
||||
id
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
INSERT INTO t1 VALUES(4);
|
||||
INSERT INTO t2 VALUES(4);
|
||||
FLUSH LOGS;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
Comparing tables master:test.t2 and slave:test.t2
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
Comparing tables master:test.t2 and slave:test.t2
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET SQL_MODE='';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
reset master;
|
||||
call mtr.add_suppression("Failed during slave thread initialization");
|
||||
call mtr.add_suppression("Failed during slave I/O thread initialization");
|
||||
stop slave;
|
||||
reset slave;
|
||||
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
|
||||
|
|
|
@ -29,5 +29,5 @@ t1
|
|||
t2
|
||||
SHOW EVENTS in mysqltest;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
mysqltest e @ SYSTEM ONE TIME # NULL NULL NULL NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
mysqltest e root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP DATABASE IF EXISTS mysqltest;
|
||||
|
|
|
@ -166,4 +166,7 @@ DROP FUNCTION upgrade_del_func;
|
|||
DROP FUNCTION upgrade_alter_func;
|
||||
DROP DATABASE bug42217_db;
|
||||
DROP USER 'create_rout_db'@'localhost';
|
||||
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
|
||||
USE mtr;
|
||||
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
|
||||
"End of test"
|
||||
|
|
|
@ -43,7 +43,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS db_bug_13684.t
|
|||
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
||||
master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
|
||||
master-bin.000001 # Query # # use `test`; CREATE EVENT db_bug_13684.e
|
||||
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
||||
DO
|
||||
UPDATE db_bug_13684.t SET a = a + 1
|
||||
|
@ -75,7 +75,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS db_bug_13684.t
|
|||
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
||||
master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
|
||||
master-bin.000001 # Query # # use `test`; CREATE EVENT db_bug_13684.e
|
||||
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
||||
DO
|
||||
UPDATE db_bug_13684.t SET a = a + 1
|
||||
|
|
|
@ -5,6 +5,7 @@ reset slave;
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create database if not exists mysqltest;
|
||||
use mysqltest;
|
||||
create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
|
||||
create temporary table mysqltest.t2 (n int)ENGINE=MyISAM;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
|
|
|
@ -191,5 +191,63 @@ select * from t28953;
|
|||
END;|
|
||||
ALTER EVENT event1 RENAME TO event2;
|
||||
DROP EVENT event2;
|
||||
CREATE TABLE test.t1(details CHAR(30));
|
||||
CREATE EVENT /*!50000 event44331_1 */
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP
|
||||
ON COMPLETION PRESERVE DISABLE
|
||||
DO INSERT INTO test.t1 VALUES('event event44331_1 fired - no definer');
|
||||
CREATE DEFINER=CURRENT_USER /*!50000 EVENT event44331_2 */
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP
|
||||
ON COMPLETION PRESERVE DISABLE
|
||||
DO INSERT INTO test.t1 VALUES('event event44331_2 fired - DEFINER=CURRENT_USER');
|
||||
CREATE DEFINER=CURRENT_USER() EVENT event44331_3
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP
|
||||
ON COMPLETION PRESERVE DISABLE
|
||||
DO INSERT INTO test.t1 VALUES('event event44331_3 fired - DEFINER=CURRENT_USER() function');
|
||||
CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP
|
||||
ON COMPLETION PRESERVE DISABLE
|
||||
DO INSERT INTO test.t1 VALUES('event event44331_4 fired - DEFINER=user1');
|
||||
Warnings:
|
||||
Note 1449 The user specified as a definer ('user44331'@'%') does not exist
|
||||
#on master
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_1';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_1 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_2';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_2 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_3';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_3 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_4';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_4 user44331@%
|
||||
#on slave
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_1';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_1 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_2';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_2 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_3';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_3 root@localhost
|
||||
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
|
||||
where EVENT_NAME='event44331_4';
|
||||
EVENT_SCHEMA EVENT_NAME DEFINER
|
||||
test event44331_4 user44331@%
|
||||
SET @@global.event_scheduler= @old_event_scheduler;
|
||||
DROP TABLE t28953;
|
||||
DROP TABLE t1;
|
||||
DROP EVENT event44331_1;
|
||||
DROP EVENT event44331_2;
|
||||
DROP EVENT event44331_3;
|
||||
DROP EVENT event44331_4;
|
||||
|
|
|
@ -4,6 +4,7 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
|
||||
**** Diff Table Def Start ****
|
||||
*** On Slave ***
|
||||
STOP SLAVE;
|
||||
|
|
|
@ -4,6 +4,7 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
|
||||
**** Diff Table Def Start ****
|
||||
*** On Slave ***
|
||||
STOP SLAVE;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue