Commit b0be97db authored by Evgeny Potemkin's avatar Evgeny Potemkin

Auto-merge.

parents 0a80d5bd 75c2a822
[MYSQL] [MYSQL]
post_commit_to = "commits@lists.mysql.com" post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.5-bugteam" tree_name = "mysql-5.5"
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
#include "client_priv.h" #include "client_priv.h"
#include <signal.h> #include <signal.h>
#ifdef THREAD
#include <my_pthread.h> /* because of signal() */ #include <my_pthread.h> /* because of signal() */
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <mysql.h> #include <mysql.h>
#include <sql_common.h> #include <sql_common.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/cmd-line-utils) ${CMAKE_SOURCE_DIR}/cmd-line-utils)
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS) ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR)
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH}) INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
......
/* Copyright (C) 2009 Sun Microsystems, Inc /* Copyright (C) 2009, 2011, Oracle and/or its affiliates. All rights
reserved
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -470,9 +471,6 @@ ...@@ -470,9 +471,6 @@
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@ #cmakedefine STACK_DIRECTION @STACK_DIRECTION@
#define THREAD 1
#define THREAD_SAFE_CLIENT 1
#define SYSTEM_TYPE "@SYSTEM_TYPE@" #define SYSTEM_TYPE "@SYSTEM_TYPE@"
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@" #define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
#cmakedefine HAVE_DTRACE 1 #cmakedefine HAVE_DTRACE 1
...@@ -604,6 +602,9 @@ ...@@ -604,6 +602,9 @@
#cmakedefine SO_EXT "@CMAKE_SHARED_MODULE_SUFFIX@" #cmakedefine SO_EXT "@CMAKE_SHARED_MODULE_SUFFIX@"
#define MYSQL_MAJOR_VERSION @MAJOR_VERSION@
#define MYSQL_MINOR_VERSION @MINOR_VERSION@
#define PACKAGE "mysql" #define PACKAGE "mysql"
#define PACKAGE_BUGREPORT "" #define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "MySQL Server" #define PACKAGE_NAME "MySQL Server"
......
...@@ -319,15 +319,6 @@ static void DbugExit(const char *why); ...@@ -319,15 +319,6 @@ static void DbugExit(const char *why);
static const char *DbugStrTok(const char *s); static const char *DbugStrTok(const char *s);
static void DbugVfprintf(FILE *stream, const char* format, va_list args); static void DbugVfprintf(FILE *stream, const char* format, va_list args);
#ifndef THREAD
/* Open profile output stream */
static FILE *OpenProfile(CODE_STATE *cs, const char *name);
/* Profile if asked for it */
static BOOLEAN DoProfile(CODE_STATE *);
/* Return current user time (ms) */
static unsigned long Clock(void);
#endif
/* /*
* Miscellaneous printf format strings. * Miscellaneous printf format strings.
*/ */
...@@ -355,7 +346,6 @@ static unsigned long Clock(void); ...@@ -355,7 +346,6 @@ static unsigned long Clock(void);
** Macros to allow dbugging with threads ** Macros to allow dbugging with threads
*/ */
#ifdef THREAD
#include <my_pthread.h> #include <my_pthread.h>
static pthread_mutex_t THR_LOCK_dbug; static pthread_mutex_t THR_LOCK_dbug;
...@@ -394,30 +384,6 @@ static CODE_STATE *code_state(void) ...@@ -394,30 +384,6 @@ static CODE_STATE *code_state(void)
return cs; return cs;
} }
#else /* !THREAD */
static CODE_STATE static_code_state=
{
"dbug", "?func", "?file", NULL, &init_settings,
NullS, NullS, 0,0,0,0,0,NullS
};
static CODE_STATE *code_state(void)
{
if (!init_done)
{
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
init_done=TRUE;
}
return &static_code_state;
}
#define pthread_mutex_lock(A) {}
#define pthread_mutex_unlock(A) {}
#endif
/* /*
* Translate some calls among different systems. * Translate some calls among different systems.
*/ */
...@@ -601,15 +567,6 @@ int DbugParse(CODE_STATE *cs, const char *control) ...@@ -601,15 +567,6 @@ int DbugParse(CODE_STATE *cs, const char *control)
else else
stack->flags |= PID_ON; stack->flags |= PID_ON;
break; break;
#ifndef THREAD
case 'g':
if (OpenProfile(cs, PROF_FILE))
{
stack->flags |= PROFILE_ON;
stack->p_functions= ListAdd(stack->p_functions, control, end);
}
break;
#endif
case 'L': case 'L':
if (sign < 0) if (sign < 0)
stack->flags &= ~LINE_ON; stack->flags &= ~LINE_ON;
...@@ -1154,23 +1111,7 @@ void _db_enter_(const char *_func_, const char *_file_, ...@@ -1154,23 +1111,7 @@ void _db_enter_(const char *_func_, const char *_file_,
_stack_frame_->prev= cs->framep; _stack_frame_->prev= cs->framep;
_stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep); _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep);
cs->framep= _stack_frame_; cs->framep= _stack_frame_;
#ifndef THREAD
if (DoProfile(cs))
{
long stackused;
if (cs->framep->prev == NULL)
stackused= 0;
else
{
stackused= (char*)(cs->framep->prev) - (char*)(cs->framep);
stackused= stackused > 0 ? stackused : -stackused;
}
(void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func);
(void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused,
AUTOS_REVERSE ? _stack_frame_->func : cs->func);
(void) fflush(cs->stack->prof_file);
}
#endif
switch (DoTrace(cs)) { switch (DoTrace(cs)) {
case ENABLE_TRACE: case ENABLE_TRACE:
cs->framep->level|= TRACE_ON; cs->framep->level|= TRACE_ON;
...@@ -1229,10 +1170,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) ...@@ -1229,10 +1170,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func); my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
DbugExit(buf); DbugExit(buf);
} }
#ifndef THREAD
if (DoProfile(cs))
(void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
#endif
if (DoTrace(cs) & DO_TRACE) if (DoTrace(cs) & DO_TRACE)
{ {
if (TRACING) if (TRACING)
...@@ -1744,36 +1682,6 @@ static int DoTrace(CODE_STATE *cs) ...@@ -1744,36 +1682,6 @@ static int DoTrace(CODE_STATE *cs)
return DONT_TRACE; return DONT_TRACE;
} }
/*
* FUNCTION
*
* DoProfile check to see if profiling is current enabled
*
* SYNOPSIS
*
* static BOOLEAN DoProfile()
*
* DESCRIPTION
*
* Checks to see if profiling is enabled based on whether the
* user has specified profiling, the maximum trace depth has
* not yet been reached, the current function is selected,
* and the current process is selected. Returns TRUE if
* profiling is enabled, FALSE otherwise.
*
*/
#ifndef THREAD
static BOOLEAN DoProfile(CODE_STATE *cs)
{
return PROFILING &&
cs->level <= cs->stack->maxdepth &&
InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) &&
InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED);
}
#endif
FILE *_db_fp_(void) FILE *_db_fp_(void)
{ {
CODE_STATE *cs; CODE_STATE *cs;
...@@ -1900,11 +1808,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_) ...@@ -1900,11 +1808,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
cs->lineno++; cs->lineno++;
if (cs->stack->flags & PID_ON) if (cs->stack->flags & PID_ON)
{ {
#ifdef THREAD
(void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name()); (void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name());
#else
(void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid());
#endif
} }
if (cs->stack->flags & NUMBER_ON) if (cs->stack->flags & NUMBER_ON)
(void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno); (void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno);
...@@ -2014,63 +1918,6 @@ static void DBUGOpenFile(CODE_STATE *cs, ...@@ -2014,63 +1918,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
} }
} }
/*
* FUNCTION
*
* OpenProfile open new output stream for profiler output
*
* SYNOPSIS
*
* static FILE *OpenProfile(name)
* char *name;
*
* DESCRIPTION
*
* Given name of a new file, opens the file
* and sets the profiler output stream to the new file.
*
* It is currently unclear whether the prefered behavior is
* to truncate any existing file, or simply append to it.
* The latter behavior would be desirable for collecting
* accumulated runtime history over a number of separate
* runs. It might take some changes to the analyzer program
* though, and the notes that Binayak sent with the profiling
* diffs indicated that append was the normal mode, but this
* does not appear to agree with the actual code. I haven't
* investigated at this time [fnf; 24-Jul-87].
*/
#ifndef THREAD
static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
REGISTER FILE *fp;
REGISTER BOOLEAN newfile;
fp=0;
if (!Writable(name))
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
(void) Delay(cs->stack->delay);
}
else
{
newfile= !EXISTS(name);
if (!(fp= fopen(name, "w")))
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
}
else
{
cs->stack->prof_file= fp;
}
}
return fp;
}
#endif
/* /*
* FUNCTION * FUNCTION
* *
...@@ -2419,80 +2266,6 @@ const char* _db_get_func_(void) ...@@ -2419,80 +2266,6 @@ const char* _db_get_func_(void)
return cs->func; return cs->func;
} }
/*
* Here we need the definitions of the clock routine. Add your
* own for whatever system that you have.
*/
#ifndef THREAD
#if defined(HAVE_GETRUSAGE)
#include <sys/param.h>
#include <sys/resource.h>
/* extern int getrusage(int, struct rusage *); */
/*
* Returns the user time in milliseconds used by this process so
* far.
*/
static unsigned long Clock()
{
struct rusage ru;
(void) getrusage(RUSAGE_SELF, &ru);
return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000;
}
#elif defined(__WIN__)
static ulong Clock()
{
return clock()*(1000/CLOCKS_PER_SEC);
}
#elif defined(amiga)
struct DateStamp { /* Yes, this is a hack, but doing it right */
long ds_Days; /* is incredibly ugly without splitting this */
long ds_Minute; /* off into a separate file */
long ds_Tick;
};
static int first_clock= TRUE;
static struct DateStamp begin;
static struct DateStamp elapsed;
static unsigned long Clock()
{
register struct DateStamp *now;
register unsigned long millisec= 0;
extern VOID *AllocMem();
now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L);
if (now != NULL)
{
if (first_clock == TRUE)
{
first_clock= FALSE;
(void) DateStamp(now);
begin= *now;
}
(void) DateStamp(now);
millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days);
millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute);
millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick);
(void) FreeMem(now, (long) sizeof(struct DateStamp));
}
return millisec;
}
#else
static unsigned long Clock()
{
return 0;
}
#endif /* RUSAGE */
#endif /* THREADS */
#else #else
......
...@@ -571,12 +571,10 @@ int main (int argc, char **argv) ...@@ -571,12 +571,10 @@ int main (int argc, char **argv)
FILE *infile; FILE *infile;
FILE *outfile = {stdout}; FILE *outfile = {stdout};
#ifdef THREAD
#if defined(HAVE_PTHREAD_INIT) #if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */ pthread_init(); /* Must be called before DBUG_ENTER */
#endif #endif
my_thread_global_init(); my_thread_global_init();
#endif /* THREAD */
{ {
DBUG_ENTER ("main"); DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]); DBUG_PROCESS (argv[0]);
......
...@@ -16,12 +16,11 @@ char *argv[]; ...@@ -16,12 +16,11 @@ char *argv[];
{ {
register int result, ix; register int result, ix;
extern int factorial(int); extern int factorial(int);
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) #if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */ pthread_init(); /* Must be called before DBUG_ENTER */
#endif #endif
#ifdef THREAD
my_thread_global_init(); my_thread_global_init();
#endif
{ {
DBUG_ENTER ("main"); DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]); DBUG_PROCESS (argv[0]);
......
...@@ -44,12 +44,11 @@ int main (int argc, char *argv[]) ...@@ -44,12 +44,11 @@ int main (int argc, char *argv[])
if (argc == 1) if (argc == 1)
return 0; return 0;
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) #if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */ pthread_init(); /* Must be called before DBUG_ENTER */
#endif #endif
#ifdef THREAD
my_thread_global_init(); my_thread_global_init();
#endif
dup2(1, 2); dup2(1, 2);
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
......
...@@ -40,7 +40,6 @@ SET(HEADERS ...@@ -40,7 +40,6 @@ SET(HEADERS
my_xml.h my_xml.h
mysql_embed.h mysql_embed.h
my_pthread.h my_pthread.h
my_no_pthread.h
decimal.h decimal.h
errmsg.h errmsg.h
my_global.h my_global.h
......
/* Copyright (C) 2000-2004 MySQL AB, 2009 Sun Microsystems, Inc /* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
reserved
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -25,10 +26,9 @@ extern "C" { ...@@ -25,10 +26,9 @@ extern "C" {
#ifndef _my_base_h #ifndef _my_base_h
#include <my_base.h> #include <my_base.h>
#endif #endif
#ifdef THREAD
#include <my_pthread.h> #include <my_pthread.h>
#include <thr_lock.h> #include <thr_lock.h>
#endif
#include "my_handler.h" #include "my_handler.h"
#include "my_tree.h" #include "my_tree.h"
...@@ -146,10 +146,8 @@ typedef struct st_heap_share ...@@ -146,10 +146,8 @@ typedef struct st_heap_share
uint open_count; uint open_count;
uchar *del_link; /* Link to next block with del. rec */ uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */ char * name; /* Name of "memory-file" */
#ifdef THREAD
THR_LOCK lock; THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */ mysql_mutex_t intern_lock; /* Locking for use with _locking */
#endif
my_bool delete_on_close; my_bool delete_on_close;
LIST open_list; LIST open_list;
uint auto_key; uint auto_key;
...@@ -175,9 +173,7 @@ typedef struct st_heap_info ...@@ -175,9 +173,7 @@ typedef struct st_heap_info
TREE_ELEMENT **last_pos; TREE_ELEMENT **last_pos;
uint lastkey_len; uint lastkey_len;
my_bool implicit_emptied; my_bool implicit_emptied;
#ifdef THREAD
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
#endif
LIST open_list; LIST open_list;
} HP_INFO; } HP_INFO;
......
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
reserved
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -30,9 +31,6 @@ ...@@ -30,9 +31,6 @@
#define EOVERFLOW 84 #define EOVERFLOW 84
#endif #endif
#if !defined(USE_MY_FUNC) && !defined(THREAD)
#include <my_nosys.h> /* For faster code, after test */
#endif /* USE_MY_FUNC */
#endif /* stdin */ #endif /* stdin */
#include <my_list.h> #include <my_list.h>
...@@ -351,7 +349,7 @@ enum ha_base_keytype { ...@@ -351,7 +349,7 @@ enum ha_base_keytype {
/* /*
update the 'variable' part of the info: update the 'variable' part of the info:
handler::records, deleted, data_file_length, index_file_length, handler::records, deleted, data_file_length, index_file_length,
delete_length, check_time, mean_rec_length check_time, mean_rec_length
*/ */
#define HA_STATUS_VARIABLE 16 #define HA_STATUS_VARIABLE 16
/* /*
...@@ -364,6 +362,11 @@ enum ha_base_keytype { ...@@ -364,6 +362,11 @@ enum ha_base_keytype {
update handler::auto_increment_value update handler::auto_increment_value
*/ */
#define HA_STATUS_AUTO 64 #define HA_STATUS_AUTO 64
/*
Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also
when only HA_STATUS_VARIABLE but it won't be used.
*/
#define HA_STATUS_VARIABLE_EXTRA 128
/* /*
Errorcodes given by handler functions Errorcodes given by handler functions
......
...@@ -33,9 +33,7 @@ typedef struct st_bitmap ...@@ -33,9 +33,7 @@ typedef struct st_bitmap
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
acquiring the mutex acquiring the mutex
*/ */
#ifdef THREAD
mysql_mutex_t *mutex; mysql_mutex_t *mutex;
#endif
} MY_BITMAP; } MY_BITMAP;
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -212,13 +212,6 @@ ...@@ -212,13 +212,6 @@
#include <sys/types.h> #include <sys/types.h>
#endif #endif
/* The client defines this to avoid all thread code */
#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
#undef THREAD
#undef HAVE_LINUXTHREADS
#undef HAVE_NPTL
#endif
#ifdef HAVE_THREADS_WITHOUT_SOCKETS #ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */ /* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H #undef HAVE_SYS_UN_H
...@@ -261,7 +254,7 @@ ...@@ -261,7 +254,7 @@
#endif #endif
#endif #endif
#if defined(THREAD) && !defined(__WIN__) #if !defined(__WIN__)
#ifndef _POSIX_PTHREAD_SEMANTICS #ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif #endif
...@@ -282,7 +275,7 @@ C_MODE_END ...@@ -282,7 +275,7 @@ C_MODE_END
#if !defined(SCO) && !defined(_REENTRANT) #if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT 1 /* Threads requires reentrant code */ #define _REENTRANT 1 /* Threads requires reentrant code */
#endif #endif
#endif /* THREAD */ #endif /* !defined(__WIN__) */
/* Go around some bugs in different OS and compilers */ /* Go around some bugs in different OS and compilers */
#ifdef _AIX /* By soren@t.dk */ #ifdef _AIX /* By soren@t.dk */
...@@ -415,7 +408,7 @@ C_MODE_END ...@@ -415,7 +408,7 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */ #include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG #define HAVE_ULONG
#endif #endif
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
/* Fix bug in setrlimit */ /* Fix bug in setrlimit */
#undef setrlimit #undef setrlimit
#define setrlimit cma_setrlimit64 #define setrlimit cma_setrlimit64
...@@ -1342,17 +1335,6 @@ do { doubleget_union _tmp; \ ...@@ -1342,17 +1335,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
#ifndef THREAD
#define thread_safe_increment(V,L) (V)++
#define thread_safe_decrement(V,L) (V)--
#define thread_safe_add(V,C,L) (V)+=(C)
#define thread_safe_sub(V,C,L) (V)-=(C)
#define statistic_increment(V,L) (V)++
#define statistic_decrement(V,L) (V)--
#define statistic_add(V,C,L) (V)+=(C)
#define statistic_sub(V,C,L) (V)-=(C)
#endif
#ifdef HAVE_CHARSET_utf8 #ifdef HAVE_CHARSET_utf8
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else #else
......
#ifndef MY_NO_PTHREAD_INCLUDED
#define MY_NO_PTHREAD_INCLUDED
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef THREAD
/*
This block is to access some thread-related type definitions
even in builds which do not need thread functions,
as some variables (based on these types) are declared
even in non-threaded builds.
Case in point: 'mf_keycache.c'
*/
#if defined(__WIN__)
#else /* Normal threads */
#include <pthread.h>
#endif /* defined(__WIN__) */
/*
This undefs some pthread mutex locks when one isn't using threads
to make thread safe code, that should also work in single thread
environment, easier to use.
*/
#define pthread_mutex_init(A,B)
#define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A)
#define pthread_mutex_destroy(A)
#define my_rwlock_init(A,B)
#define rw_rdlock(A)
#define rw_wrlock(A)
#define rw_unlock(A)
#define rwlock_destroy(A)
#define safe_mutex_assert_owner(mp)
#define mysql_mutex_init(A, B, C) do {} while (0)
#define mysql_mutex_lock(A) do {} while (0)
#define mysql_mutex_unlock(A) do {} while (0)
#define mysql_mutex_destroy(A) do {} while (0)
#define mysql_rwlock_init(A, B, C) do {} while (0)
#define mysql_rwlock_rdlock(A) do {} while (0)
#define mysql_rwlock_wrlock(A) do {} while (0)
#define mysql_rwlock_unlock(A) do {} while (0)
#define mysql_rwlock_destroy(A) do {} while (0)
typedef int my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_DONE 1
#define my_pthread_once(C,F) do { \
if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
} while(0)
#endif
#endif /* MY_NO_PTHREAD_INCLUDED */
...@@ -881,12 +881,6 @@ extern uint thd_lib_detected; ...@@ -881,12 +881,6 @@ extern uint thd_lib_detected;
to use my_atomic operations instead. to use my_atomic operations instead.
*/ */
/*
Warning:
When compiling without threads, this file is not included.
See the *other* declarations of thread_safe_xxx in include/my_global.h
*/
#ifdef THREAD
#ifndef thread_safe_increment #ifndef thread_safe_increment
#ifdef _WIN32 #ifdef _WIN32
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) #define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
...@@ -910,7 +904,7 @@ extern uint thd_lib_detected; ...@@ -910,7 +904,7 @@ extern uint thd_lib_detected;
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L))) (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif #endif
#endif #endif
#endif
/* /*
statistics_xxx functions are for non critical statistic, statistics_xxx functions are for non critical statistic,
......
...@@ -41,11 +41,7 @@ typedef struct my_aio_result { ...@@ -41,11 +41,7 @@ typedef struct my_aio_result {
# define MEM_CHECK_DEFINED(a,len) ((void) 0) # define MEM_CHECK_DEFINED(a,len) ((void) 0)
#endif /* HAVE_VALGRIND */ #endif /* HAVE_VALGRIND */
#ifndef THREAD
extern int my_errno; /* Last error in mysys */
#else
#include <my_pthread.h> #include <my_pthread.h>
#endif
#include <m_ctype.h> /* for CHARSET_INFO */ #include <m_ctype.h> /* for CHARSET_INFO */
#include <stdarg.h> #include <stdarg.h>
...@@ -314,7 +310,7 @@ struct st_my_file_info ...@@ -314,7 +310,7 @@ struct st_my_file_info
int oflag; /* open flags, e.g O_APPEND */ int oflag; /* open flags, e.g O_APPEND */
#endif #endif
enum file_type type; enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32) #if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_t mutex; mysql_mutex_t mutex;
#endif #endif
}; };
...@@ -334,9 +330,7 @@ typedef struct st_my_tmpdir ...@@ -334,9 +330,7 @@ typedef struct st_my_tmpdir
DYNAMIC_ARRAY full_list; DYNAMIC_ARRAY full_list;
char **list; char **list;
uint cur, max; uint cur, max;
#ifdef THREAD
mysql_mutex_t mutex; mysql_mutex_t mutex;
#endif
} MY_TMPDIR; } MY_TMPDIR;
typedef struct st_dynamic_string typedef struct st_dynamic_string
...@@ -348,7 +342,6 @@ typedef struct st_dynamic_string ...@@ -348,7 +342,6 @@ typedef struct st_dynamic_string
struct st_io_cache; struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
#ifdef THREAD
typedef struct st_io_cache_share typedef struct st_io_cache_share
{ {
mysql_mutex_t mutex; /* To sync on reads into buffer. */ mysql_mutex_t mutex; /* To sync on reads into buffer. */
...@@ -368,7 +361,6 @@ typedef struct st_io_cache_share ...@@ -368,7 +361,6 @@ typedef struct st_io_cache_share
my_bool alloced; my_bool alloced;
#endif #endif
} IO_CACHE_SHARE; } IO_CACHE_SHARE;
#endif
typedef struct st_io_cache /* Used when cacheing files */ typedef struct st_io_cache /* Used when cacheing files */
{ {
...@@ -409,7 +401,7 @@ typedef struct st_io_cache /* Used when cacheing files */ ...@@ -409,7 +401,7 @@ typedef struct st_io_cache /* Used when cacheing files */
WRITE_CACHE, and &read_pos and &read_end respectively otherwise WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/ */
uchar **current_pos, **current_end; uchar **current_pos, **current_end;
#ifdef THREAD
/* /*
The lock is for append buffer used in SEQ_READ_APPEND cache The lock is for append buffer used in SEQ_READ_APPEND cache
need mutex copying from append buffer to read buffer. need mutex copying from append buffer to read buffer.
...@@ -423,7 +415,7 @@ typedef struct st_io_cache /* Used when cacheing files */ ...@@ -423,7 +415,7 @@ typedef struct st_io_cache /* Used when cacheing files */
READ_CACHE mode is supported. READ_CACHE mode is supported.
*/ */
IO_CACHE_SHARE *share; IO_CACHE_SHARE *share;
#endif
/* /*
A caller will use my_b_read() macro to read from the cache A caller will use my_b_read() macro to read from the cache
if the data is already in cache, it will be simply copied with if the data is already in cache, it will be simply copied with
...@@ -631,6 +623,7 @@ extern const char** get_global_errmsgs(); ...@@ -631,6 +623,7 @@ extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors); extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags);
extern File my_fileno(FILE *fd); extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
...@@ -655,14 +648,6 @@ extern int my_redel(const char *from, const char *to, int MyFlags); ...@@ -655,14 +648,6 @@ extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags); extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd); extern char * my_filename(File fd);
#ifndef THREAD
extern void dont_break(void);
extern void allow_break(void);
#else
#define dont_break()
#define allow_break()
#endif
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
void my_print_open_files(void); void my_print_open_files(void);
#else #else
...@@ -735,12 +720,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, ...@@ -735,12 +720,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
pbool clear_cache); pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info); extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
#ifdef THREAD
extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads); IO_CACHE *write_cache, uint num_threads);
extern void remove_io_thread(IO_CACHE *info); extern void remove_io_thread(IO_CACHE *info);
#endif
extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_get(IO_CACHE *info); extern int _my_b_get(IO_CACHE *info);
......
...@@ -433,10 +433,8 @@ typedef struct st_mi_check_param ...@@ -433,10 +433,8 @@ typedef struct st_mi_check_param
const char *db_name, *table_name; const char *db_name, *table_name;
const char *op_name; const char *op_name;
enum_mi_stats_method stats_method; enum_mi_stats_method stats_method;
#ifdef THREAD
mysql_mutex_t print_msg_mutex; mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock; my_bool need_print_msg_lock;
#endif
} MI_CHECK; } MI_CHECK;
typedef struct st_sort_ft_buf typedef struct st_sort_ft_buf
...@@ -460,10 +458,8 @@ typedef struct st_sort_info ...@@ -460,10 +458,8 @@ typedef struct st_sort_info
SORT_FT_BUF *ft_buf; SORT_FT_BUF *ft_buf;
/* sync things */ /* sync things */
uint got_error, threads_running; uint got_error, threads_running;
#ifdef THREAD
mysql_mutex_t mutex; mysql_mutex_t mutex;
mysql_cond_t cond; mysql_cond_t cond;
#endif
} SORT_INFO; } SORT_INFO;
/* functions in mi_check */ /* functions in mi_check */
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
class THD; class THD;
uint filename_to_tablename(const char *from, char *to, uint to_length);
int get_quote_char_for_identifier(THD *thd, const char *name, uint length); int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
bool schema_table_store_record(THD *thd, TABLE *table); bool schema_table_store_record(THD *thd, TABLE *table);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
......
...@@ -41,7 +41,7 @@ typedef struct st_alarm_info ...@@ -41,7 +41,7 @@ typedef struct st_alarm_info
void thr_alarm_info(ALARM_INFO *info); void thr_alarm_info(ALARM_INFO *info);
#if defined(DONT_USE_THR_ALARM) || !defined(THREAD) #if defined(DONT_USE_THR_ALARM)
#define USE_ALARM_THREAD #define USE_ALARM_THREAD
#undef USE_ONE_SIGNAL_HAND #undef USE_ONE_SIGNAL_HAND
......
...@@ -35,21 +35,6 @@ sig_handler my_pipe_sig_handler(int sig); ...@@ -35,21 +35,6 @@ sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name); void read_user_name(char *name);
my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
/*
Let the user specify that we don't want SIGPIPE; This doesn't however work
with threaded applications as we can have multiple read in progress.
*/
#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD)
#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0;
#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE, my_pipe_sig_handler)
#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
#else
#define init_sigpipe_variables
#define set_sigpipe(mysql)
#define reset_sigpipe(mysql)
#endif
void mysql_read_default_options(struct st_mysql_options *options, void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group); const char *filename,const char *group);
void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name); void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name);
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
#include <sys/un.h> #include <sys/un.h>
#endif #endif
#if defined(THREAD) && !defined(__WIN__) #if !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */ #include <my_pthread.h> /* because of signal() */
#endif #endif
#ifndef INADDR_NONE #ifndef INADDR_NONE
...@@ -172,10 +172,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), ...@@ -172,10 +172,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
result= init_embedded_server(argc, argv, groups); result= init_embedded_server(argc, argv, groups);
#endif #endif
} }
#ifdef THREAD
else else
result= (int)my_thread_init(); /* Init if new thread */ result= (int)my_thread_init(); /* Init if new thread */
#endif
return result; return result;
} }
...@@ -229,18 +227,12 @@ MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void) ...@@ -229,18 +227,12 @@ MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)
my_bool STDCALL mysql_thread_init() my_bool STDCALL mysql_thread_init()
{ {
#ifdef THREAD
return my_thread_init(); return my_thread_init();
#else
return 0;
#endif
} }
void STDCALL mysql_thread_end() void STDCALL mysql_thread_end()
{ {
#ifdef THREAD
my_thread_end(); my_thread_end();
#endif
} }
...@@ -1092,11 +1084,7 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) ...@@ -1092,11 +1084,7 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
uint STDCALL mysql_thread_safe(void) uint STDCALL mysql_thread_safe(void)
{ {
#ifdef THREAD
return 1; return 1;
#else
return 0;
#endif
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
funcs_1.charset_collation_1 # depends on compile-time decisions funcs_1.charset_collation_1 # depends on compile-time decisions
funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myisam_views takes longer time on 6.0 branch than 5.1 branch
innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected
...@@ -13,11 +12,8 @@ main.gis # Bug#52208 2010-11-24 alik gis fails o ...@@ -13,11 +12,8 @@ main.gis # Bug#52208 2010-11-24 alik gis fails o
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically 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.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again) main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible) main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
main.show_check # Bug#58414 2010-11-24 alik Race condition in show_check.test
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
......
perl mysql-test-run.pl --timer --force --parallel=auto --comment=1st --experimental=collections/default.experimental 1st perl mysql-test-run.pl --timer --force --parallel=auto --comment=1st --experimental=collections/default.experimental 1st
perl mysql-test-run.pl --timer --force --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb perl mysql-test-run.pl --timer --force --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,rpl,sys_vars,perfschema
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
...@@ -497,3 +497,22 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=default; ...@@ -497,3 +497,22 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=default;
SET @@SESSION.AUTO_INCREMENT_OFFSET=default; SET @@SESSION.AUTO_INCREMENT_OFFSET=default;
DROP TABLE t1; DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
#
# Bug#50619 assert in handler::update_auto_increment
#
CREATE TABLE t1 (pk INT AUTO_INCREMENT, PRIMARY KEY (pk));
INSERT INTO t1 VALUES (NULL), (-1), (NULL);
SELECT * FROM t1;
pk
-1
1
2
DROP TABLE t1;
CREATE TABLE t1 (pk BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (pk));
INSERT INTO t1 VALUES (NULL), (18446744073709551615-1), (NULL);
ERROR HY000: Failed to read auto-increment value from storage engine
SELECT * FROM t1;
pk
1
18446744073709551614
DROP TABLE t1;
...@@ -1014,6 +1014,14 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000 ...@@ -1014,6 +1014,14 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000
SET @a=POLYFROMWKB(@a); SET @a=POLYFROMWKB(@a);
SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
SET @a=POLYFROMWKB(@a); SET @a=POLYFROMWKB(@a);
create table t1(a polygon NOT NULL)engine=myisam;
insert into t1 values (geomfromtext("point(0 1)"));
insert into t1 values (geomfromtext("point(1 0)"));
select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
p
NULL
NULL
drop table t1;
End of 5.1 tests End of 5.1 tests
CREATE TABLE t1( CREATE TABLE t1(
col0 BINARY NOT NULL, col0 BINARY NOT NULL,
......
...@@ -66,3 +66,27 @@ SELECT ((@id := id) - id) FROM t2; ...@@ -66,3 +66,27 @@ SELECT ((@id := id) - id) FROM t2;
KILL @id; KILL @id;
SET DEBUG_SYNC= "now SIGNAL killed"; SET DEBUG_SYNC= "now SIGNAL killed";
DROP TABLE t1, t2; DROP TABLE t1, t2;
SET DEBUG_SYNC= "RESET";
#
# Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
# OPTIMIZE TABLE
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
# Connection con1
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
# Sending:
OPTIMIZE TABLE t1;
# Connection default
SET DEBUG_SYNC= 'now WAIT_FOR waiting';
KILL QUERY ID;
SET DEBUG_SYNC= 'now SIGNAL killed';
# Connection con1
# Reaping: OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status Operation failed
# Connection default
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
...@@ -5,3 +5,111 @@ ...@@ -5,3 +5,111 @@
CREATE DATABASE XY; CREATE DATABASE XY;
USE XY; USE XY;
DROP DATABASE XY; DROP DATABASE XY;
USE TEST;
#
# Bug55222 Mysqldump table names case bug in REFERENCES clause
# InnoDB did not handle lower_case_table_names=2 for
# foreign_table_names and referenced_table_names.
#
SHOW VARIABLES LIKE 'lower_case_table_names';
Variable_name Value
lower_case_table_names 2
DROP TABLE IF EXISTS `Table2`;
DROP TABLE IF EXISTS `Table1`;
CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
SHOW CREATE TABLE `Table2`;
Table Table2
Create Table CREATE TABLE `Table2` (
`c1` int(11) NOT NULL,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `fk1` (`c2`),
CONSTRAINT `fk1` FOREIGN KEY (`c2`) REFERENCES `Table1` (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME fk1
UNIQUE_CONSTRAINT_CATALOG def
UNIQUE_CONSTRAINT_SCHEMA test
UNIQUE_CONSTRAINT_NAME PRIMARY
MATCH_OPTION NONE
UPDATE_RULE RESTRICT
DELETE_RULE RESTRICT
TABLE_NAME Table2
REFERENCED_TABLE_NAME Table1
DROP TABLE `Table2`;
DROP TABLE `Table1`;
DROP TABLE IF EXISTS Product_Order;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Customer;
CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
Product_Category INT NOT NULL,
Product_Id INT NOT NULL,
Customer_Id INT NOT NULL,
PRIMARY KEY(No),
INDEX (Product_Category, Product_Id),
FOREIGN KEY (Product_Category, Product_Id)
REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (Customer_Id),
FOREIGN KEY (Customer_Id)
REFERENCES Customer(Id)
) ENGINE=INNODB;
SHOW CREATE TABLE Product_Order;
Table Product_Order
Create Table CREATE TABLE `Product_Order` (
`No` int(11) NOT NULL AUTO_INCREMENT,
`Product_Category` int(11) NOT NULL,
`Product_Id` int(11) NOT NULL,
`Customer_Id` int(11) NOT NULL,
PRIMARY KEY (`No`),
KEY `Product_Category` (`Product_Category`,`Product_Id`),
KEY `Customer_Id` (`Customer_Id`),
CONSTRAINT `product_order_ibfk_1` FOREIGN KEY (`Product_Category`, `Product_Id`) REFERENCES `Product` (`Category`, `Id`) ON UPDATE CASCADE,
CONSTRAINT `product_order_ibfk_2` FOREIGN KEY (`Customer_Id`) REFERENCES `Customer` (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE Product;
Table Product
Create Table CREATE TABLE `Product` (
`Category` int(11) NOT NULL,
`Id` int(11) NOT NULL,
`Price` decimal(10,0) DEFAULT NULL,
PRIMARY KEY (`Category`,`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE Customer;
Table Customer
Create Table CREATE TABLE `Customer` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME product_order_ibfk_1
UNIQUE_CONSTRAINT_CATALOG def
UNIQUE_CONSTRAINT_SCHEMA test
UNIQUE_CONSTRAINT_NAME PRIMARY
MATCH_OPTION NONE
UPDATE_RULE CASCADE
DELETE_RULE RESTRICT
TABLE_NAME Product_Order
REFERENCED_TABLE_NAME Product
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME product_order_ibfk_2
UNIQUE_CONSTRAINT_CATALOG def
UNIQUE_CONSTRAINT_SCHEMA test
UNIQUE_CONSTRAINT_NAME PRIMARY
MATCH_OPTION NONE
UPDATE_RULE RESTRICT
DELETE_RULE RESTRICT
TABLE_NAME Product_Order
REFERENCED_TABLE_NAME Customer
DROP TABLE Product_Order;
DROP TABLE Product;
DROP TABLE Customer;
...@@ -7,13 +7,13 @@ slave_skip_errors OFF ...@@ -7,13 +7,13 @@ slave_skip_errors OFF
# #
# FLUSH PRIVILEGES should not implicitly unlock locked tables. # FLUSH PRIVILEGES should not implicitly unlock locked tables.
# #
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (c1 int); CREATE TABLE t1 (c1 INT);
lock tables t1 read; LOCK TABLES t1 READ;
flush privileges; FLUSH PRIVILEGES;
ERROR HY000: Table 'host' was not locked with LOCK TABLES ERROR HY000: Table 'host' was not locked with LOCK TABLES
unlock tables; UNLOCK TABLES;
drop table t1; DROP TABLE t1;
# #
# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
# #
...@@ -28,7 +28,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1; ...@@ -28,7 +28,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost'; GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
connection: con1 connection: con1
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest'; SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '<outfile>';
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1; INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
......
...@@ -1901,7 +1901,7 @@ c1 bigint, ...@@ -1901,7 +1901,7 @@ c1 bigint,
c2 set('sweet'), c2 set('sweet'),
key (c2,c1,c0), key (c2,c1,c0),
key(c0) key(c0)
) engine=myisam partition by hash (month(c0)) partitions 5; ) engine=myisam partition by hash (c0) partitions 5;
insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019; insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019;
insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644; insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644;
select c1 from t1 group by (select c0 from t1 limit 1); select c1 from t1 group by (select c0 from t1 limit 1);
......
This diff is collapsed.
...@@ -13,16 +13,16 @@ EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a; ...@@ -13,16 +13,16 @@ EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index 1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int) create table t1 (a DATETIME)
partition by range (a) partition by range (TO_DAYS(a))
subpartition by hash(to_seconds(a)) subpartition by hash(to_seconds(a))
(partition p0 values less than (1)); (partition p0 values less than (1));
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (a) /*!50500 PARTITION BY RANGE (TO_DAYS(a))
SUBPARTITION BY HASH (to_seconds(a)) SUBPARTITION BY HASH (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */ (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */
drop table t1; drop table t1;
......
...@@ -5004,6 +5004,58 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); ...@@ -5004,6 +5004,58 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
SELECT * FROM t2 UNION SELECT * FROM t2 SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# Bug #58818: Incorrect result for IN/ANY subquery
# with HAVING condition
#
CREATE TABLE t1(i INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t1s(i INT);
INSERT INTO t1s VALUES (10), (20), (30);
CREATE TABLE t2s(i INT);
INSERT INTO t2s VALUES (100), (200), (300);
SELECT * FROM t1
WHERE t1.i NOT IN
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
);
i
1
2
3
SELECT * FROM t1
WHERE t1.I IN
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
) IS UNKNOWN;
i
SELECT * FROM t1
WHERE NOT t1.I = ANY
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
);
i
1
2
3
SELECT * FROM t1
WHERE t1.i = ANY (
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
) IS UNKNOWN;
i
DROP TABLE t1,t1s,t2s;
End of 5.1 tests End of 5.1 tests
# #
# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
......
...@@ -164,6 +164,17 @@ a b ...@@ -164,6 +164,17 @@ a b
2 NULL 2 NULL
DROP TABLE t1, t2, t3, t4, t5; DROP TABLE t1, t2, t3, t4, t5;
# #
# Bug#58207: invalid memory reads when using default column value and
# tmptable needed
#
CREATE TABLE t(a VARCHAR(245) DEFAULT
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
INSERT INTO t VALUES (''),(''),(''),(''),(''),(''),(''),(''),(''),(''),('');
SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d;
default(a)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t;
#
# End of 5.1 tests. # End of 5.1 tests.
# #
# #
......
...@@ -1644,3 +1644,128 @@ b ...@@ -1644,3 +1644,128 @@ b
2 2
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.1 tests End of 5.1 tests
#
# Bug#57986 ORDER BY clause is not used after a UNION,
# if embedded in a SELECT
#
CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
CREATE TABLE t2 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
INSERT INTO t1 (c1, c2) VALUES ('t1a', 1), ('t1a', 2), ('t1a', 3), ('t1b', 2), ('t1b', 1);
INSERT INTO t2 (c1, c2) VALUES ('t2a', 1), ('t2a', 2), ('t2a', 3), ('t2b', 2), ('t2b', 1);
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY c2, c1;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT * FROM t1 UNION (SELECT * FROM t2) ORDER BY c2, c1;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT * FROM t1 UNION (SELECT * FROM t2 ORDER BY c2, c1);
c1 c2
t1a 1
t1a 2
t1a 3
t1b 2
t1b 1
t2a 1
t2a 2
t2a 3
t2b 2
t2b 1
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2)
ORDER BY c2, c1
) AS res;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2)
ORDER BY c2 DESC, c1 LIMIT 1
) AS res;
c1 c2
t1a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2 ORDER BY c2 DESC, c1 LIMIT 1)
) AS res;
c1 c2
t1a 1
t1a 2
t1a 3
t1b 2
t1b 1
t2a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
SELECT c1, c2 FROM t2
ORDER BY c2 DESC, c1 DESC LIMIT 1
) AS res;
c1 c2
t2a 3
SELECT c1, c2 FROM (
(
(SELECT c1, c2 FROM t1)
UNION
(SELECT c1, c2 FROM t2)
)
ORDER BY c2 DESC, c1 ASC LIMIT 1
) AS res;
c1 c2
t1a 3
DROP TABLE t1, t2;
#
# Bug #58970 Problem Subquery (without referencing a table)
# and Order By
#
SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a ASC LIMIT 1) AS dev;
dev
0
SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a DESC LIMIT 1) AS dev;
dev
1
SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a ASC LIMIT 1) AS dev;
dev
0
SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
dev
1
SELECT(SELECT 1 AS a ORDER BY a) AS dev;
dev
1
SELECT(SELECT 1 AS a LIMIT 1) AS dev;
dev
1
SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
dev
1
...@@ -1248,3 +1248,129 @@ Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist ...@@ -1248,3 +1248,129 @@ Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist
LOCK TABLES v1 READ; LOCK TABLES v1 READ;
ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist
DROP VIEW v1; DROP VIEW v1;
#
# Bug #58499 "DEFINER-security view selecting from INVOKER-security view
# access check wrong".
#
# Check that we correctly handle privileges for various combinations
# of INVOKER and DEFINER-security views using each other.
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
USE mysqltest1;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (j INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2);
#
# 1) DEFINER-security view uses INVOKER-security view (covers
# scenario originally described in the bug report).
CREATE SQL SECURITY INVOKER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY INVOKER VIEW v1_uses_t2 AS SELECT * FROM t2;
CREATE USER 'mysqluser1'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser1'@'%';
GRANT SELECT ON t1 TO 'mysqluser1'@'%';
# To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser1'.
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
#
# Connection 'default'.
CREATE USER 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser2'@'%';
GRANT SELECT ON t2 TO 'mysqluser2'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# The below statement should succeed thanks to suid nature of v2_uses_t1.
SELECT * FROM v2_uses_t1;
i
1
# The below statement should fail due to suid nature of v2_uses_t2.
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 2) INVOKER-security view uses INVOKER-security view.
#
# Connection 'default'.
DROP VIEW v2_uses_t1, v2_uses_t2;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
#
# Connection 'mysqluser1'.
# For both versions of 'v2' 'mysqluser1' privileges should be used.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# Connection 'mysqluser2'.
# And now for both versions of 'v2' 'mysqluser2' privileges should
# be used.
SELECT * FROM v2_uses_t1;
ERROR HY000: View 'mysqltest1.v2_uses_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM v2_uses_t2;
j
2
#
# 3) INVOKER-security view uses DEFINER-security view.
#
# Connection 'default'.
DROP VIEW v1_uses_t1, v1_uses_t2;
# To be able create 'v1_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser1'.
CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
#
# Connection 'default'.
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
# select should succeed and the second select should fail.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 4) DEFINER-security view uses DEFINER-security view.
#
# Connection 'default'.
DROP VIEW v2_uses_t1, v2_uses_t2;
# To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
#
# Connection 'default'.
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# Again privileges of creator of innermost views should apply.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
USE test;
DROP DATABASE mysqltest1;
DROP USER 'mysqluser1'@'%';
DROP USER 'mysqluser2'@'%';
...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc'); ...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc'); INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def'); INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def'); INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'PRIMARY'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
ERROR 23000: Duplicate entry 'abc-abc-def' for key 'PRIMARY'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
ERROR 23000: Duplicate entry 'abc-def-def' for key 'PRIMARY'
SELECT hex(c1),hex(c2),hex(c3) FROM t1; SELECT hex(c1),hex(c2),hex(c3) FROM t1;
hex(c1) hex(c2) hex(c3) hex(c1) hex(c2) hex(c3)
61626300000000000000 61626300000000000000 61626300000000000000 61626300000000000000 61626300000000000000 61626300000000000000
......
...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc'); ...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc'); INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def'); INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def'); INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'PRIMARY'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
ERROR 23000: Duplicate entry 'abc-abc-def' for key 'PRIMARY'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
ERROR 23000: Duplicate entry 'abc-def-def' for key 'PRIMARY'
SELECT * FROM t1; SELECT * FROM t1;
c1 c2 c3 c1 c2 c3
abc abc
......
...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc'); ...@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc'); INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def'); INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def'); INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
ERROR 23000: Duplicate entry 'abc-abc-def' for key 'c1'
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
ERROR 23000: Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1; SELECT * FROM t1;
c1 c2 c3 c1 c2 c3
abc abc
......
...@@ -10,25 +10,174 @@ File Position Binlog_Do_DB Binlog_Ignore_DB ...@@ -10,25 +10,174 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 master-bin.000001 107
stop slave; stop slave;
reset slave; reset slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
start slave; start slave;
show slave status;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 107
Relay_Log_File slave-relay-bin.000002
Relay_Log_Pos 254
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
Checking that both slave threads are running. Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 107
Relay_Log_Space 410
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
drop table if exists t1; drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n)); create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90); insert into t1 values (10),(45),(90);
......
...@@ -11,7 +11,13 @@ stop slave sql_thread; ...@@ -11,7 +11,13 @@ stop slave sql_thread;
insert into t1 values(1); insert into t1 values(1);
insert into t1 values(2); insert into t1 values(2);
stop slave; stop slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
change master to master_user='root'; change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
start slave; start slave;
select * from t1; select * from t1;
n n
......
...@@ -17,6 +17,45 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% ...@@ -17,6 +17,45 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%
--source include/wait_slave_status.inc --source include/wait_slave_status.inc
flush logs; flush logs;
Relay_Log_File mysqld-relay-bin.000003 SHOW SLAVE STATUS;
Checking that both slave threads are running. Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port SLAVE_PORT
Connect_Retry 60
Master_Log_File slave-bin.000001
Read_Master_Log_Pos 107
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File slave-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 107
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 2
STOP SLAVE; STOP SLAVE;
...@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; ...@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1; select count(*) from test.t1;
count(*) count(*)
2 2
show binlog events from <binlog_start>; show binlog events from 107;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1; drop table test.t1;
...@@ -4,23 +4,39 @@ reset master; ...@@ -4,23 +4,39 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 <Binlog_Ignore_DB>
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=107;
start slave; start slave;
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=107;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 No No 0 0 107 # None 0 No # No 0 0 1
start slave; start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1
stop slave; stop slave;
# impossible position leads to an error change master to master_log_pos=178;
change master to master_log_pos=MASTER_LOG_POS;
start slave; start slave;
Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0 1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 <Binlog_Ignore_DB>
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=207;
start slave; start slave;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
n n
......
...@@ -8,17 +8,48 @@ start slave; ...@@ -8,17 +8,48 @@ start slave;
CREATE TABLE t1 (a INT, b LONG); CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
show binlog events from <binlog_start>; SHOW BINLOG EVENTS;
**** On Slave **** **** On Slave ****
show binlog events from <binlog_start>; SHOW SLAVE STATUS;
Log_name Pos Event_type Server_id End_log_pos Info Slave_IO_State #
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) Master_Host 127.0.0.1
slave-bin.000001 # Query # # BEGIN Master_User root
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) Master_Port MASTER_PORT
slave-bin.000001 # Query # # COMMIT Connect_Retry 1
slave-bin.000001 # Query # # BEGIN Master_Log_File master-bin.000001
slave-bin.000001 # Table_map # # table_id: # (test.t1) Read_Master_Log_Pos #
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F Relay_Log_File #
slave-bin.000001 # Query # # COMMIT Relay_Log_Pos #
show binlog events from <binlog_start>; Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
SHOW BINLOG EVENTS;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
...@@ -41,11 +41,14 @@ t1 ...@@ -41,11 +41,14 @@ t1
t2 t2
**** On Master **** **** On Master ****
DROP TABLE t1,t2; DROP TABLE t1,t2;
show binlog events from <binlog_start>; SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a int)
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int)
master-bin.000001 279 Query 1 403 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 403 Query 1 527 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 527 Query 1 631 use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t2 t2
......
...@@ -17,5 +17,45 @@ a ...@@ -17,5 +17,45 @@ a
0 0
drop table t1; drop table t1;
insert into t1 values (1); insert into t1 values (1);
Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table test.t2
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1146
Last_Error Error executing row event: 'Table 'test.t1' doesn't exist'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1146
Last_SQL_Error Error executing row event: 'Table 'test.t1' doesn't exist'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
drop table t1, t2; drop table t1, t2;
...@@ -11,8 +11,9 @@ change master to master_user='test'; ...@@ -11,8 +11,9 @@ change master to master_user='test';
Master_User test Master_User test
Master_Host 127.0.0.1 Master_Host 127.0.0.1
reset slave; reset slave;
Master_User root Master_User test
Master_Host 127.0.0.1 Master_Host 127.0.0.1
change master to master_user='root';
include/start_slave.inc include/start_slave.inc
Master_User root Master_User root
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -30,11 +31,11 @@ include/stop_slave.inc ...@@ -30,11 +31,11 @@ include/stop_slave.inc
reset slave; reset slave;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
include/stop_slave.inc stop slave;
change master to master_user='root'; change master to master_user='root';
include/start_slave.inc include/start_slave.inc
include/stop_slave.inc stop slave;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
include/stop_slave.inc stop slave;
reset slave; reset slave;
...@@ -77,6 +77,8 @@ id2 ...@@ -77,6 +77,8 @@ id2
< ---- Master selects-- > < ---- Master selects-- >
------------------------- -------------------------
CALL test.p1(); CALL test.p1();
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM test.t3 ORDER BY id3; SELECT * FROM test.t3 ORDER BY id3;
id3 c id3 c
1 MySQL 1 MySQL
......
...@@ -69,9 +69,15 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C ...@@ -69,9 +69,15 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1; UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW()); INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t1 WHERE id = 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
DELETE FROM test.t2 WHERE id = 1; DELETE FROM test.t2 WHERE id = 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
DROP TRIGGER test.t1_bi; DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu; DROP TRIGGER test.t1_bu;
......
...@@ -12,39 +12,201 @@ create table t2(n int not null auto_increment primary key); ...@@ -12,39 +12,201 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t2 values (3),(4); insert into t2 values (3),(4);
drop table t2; drop table t2;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=311;
select * from t1; select * from t1;
n n
1 1
2 2
3 3
4 4
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS; show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 311
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n 1
1 n 2
2 n 3
3 n 4
4 show slave status;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS; Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-no-such-bin.000001
Until_Log_Pos 291
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
select * from t2; select * from t2;
n show slave status;
1 Slave_IO_State #
2 Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition Relay
Until_Log_File slave-relay-bin.000004
Until_Log_Pos 728
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=740;
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS; show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 740
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001'; start slave until master_log_file='master-bin.000001';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002'; start slave until relay_log_file='slave-relay-bin.000002';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS; start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave sql_thread; start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings: Warnings:
Note 1254 Slave is already running Level Note
Code 1254
Message Slave is already running
...@@ -8,8 +8,10 @@ create table t1 (n int); ...@@ -8,8 +8,10 @@ create table t1 (n int);
reset master; reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 107 None 0 No NULL No 0 0 1
start slave; start slave;
Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
insert into t1 values (1); insert into t1 values (1);
show status like "slave_running"; show status like "slave_running";
Variable_name Value Variable_name Value
......
...@@ -8,6 +8,9 @@ create table t1 (n int); ...@@ -8,6 +8,9 @@ create table t1 (n int);
reset master; reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 107 None 0 No NULL No 0 0 1
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
select * from t1; select * from t1;
......
...@@ -18,5 +18,46 @@ drop user rpl@127.0.0.1; ...@@ -18,5 +18,46 @@ drop user rpl@127.0.0.1;
flush privileges; flush privileges;
stop slave; stop slave;
start slave; start slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User rpl
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Connecting
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master NULL
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
drop table t1; drop table t1;
drop table t1; drop table t1;
...@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG); ...@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE; LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID()); INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES; UNLOCK TABLES;
show binlog events from <binlog_start>; show binlog events;
show binlog events from <binlog_start>; show binlog events;
drop database mysqltest1; drop database mysqltest1;
set global binlog_format= @saved_binlog_format; set global binlog_format= @saved_binlog_format;
...@@ -34,6 +34,8 @@ END// ...@@ -34,6 +34,8 @@ END//
SELECT sf1(); SELECT sf1();
sf1() sf1()
0 0
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
id data id data
1 1 1 1
...@@ -51,6 +53,8 @@ id data ...@@ -51,6 +53,8 @@ id data
2 1 2 1
3 3 3 3
INSERT INTO t4 VALUES(sf1()); INSERT INTO t4 VALUES(sf1());
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
id data id data
1 1 1 1
...@@ -71,6 +75,9 @@ id data ...@@ -71,6 +75,9 @@ id data
3 3 3 3
3 3 3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
id data id data
1 1 1 1
...@@ -97,6 +104,8 @@ id data ...@@ -97,6 +104,8 @@ id data
3 3 3 3
3 3 3 3
DELETE FROM t4 WHERE i = sf1() + 1; DELETE FROM t4 WHERE i = sf1() + 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
id data id data
1 1 1 1
......
...@@ -30,6 +30,8 @@ CLOSE cur1; ...@@ -30,6 +30,8 @@ CLOSE cur1;
CLOSE cur2; CLOSE cur2;
END// END//
CALL sp1(); CALL sp1();
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
id data id data
1 1 1 1
......
...@@ -6,3 +6,94 @@ ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/ ...@@ -6,3 +6,94 @@ ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/
ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
rpl_empty_master_crash : Test not applicable in 5.5+ rpl_empty_master_crash : Test not applicable in 5.5+
rpl_REDIRECT : Test not applicable in 5.5+ rpl_REDIRECT : Test not applicable in 5.5+
rpl_create_database : Result Difference Due To Change In .inc file
rpl_loaddata_m : Result Difference Due To Change In .inc file
rpl_sp_effects : Result Difference Due To Change In .inc file
rpl_variables : Result Difference Due To Change In .inc file
rpl_loaddata_s : Result Difference Due To Change In .inc file
rpl_dual_pos_advance : Result Difference Due To Change In .inc file
rpl000011 : Result Difference Due To Change In .inc file
rpl000013 : Result Difference Due To Change In .inc file
rpl_000015 : Result Difference Due To Change In .inc file
rpl_LD_INFILE : Result Difference Due To Change In .inc file
rpl_alter : Result Difference Due To Change In .inc file
rpl_alter_db : Result Difference Due To Change In .inc file
rpl_alter_db : Result Difference Due To Change In .inc file
rpl_bit : Result Difference Due To Change In .inc file
rpl_bit_npk : Result Difference Due To Change In .inc file
rpl_change_master : Result Difference Due To Change In .inc file
rpl_do_grant : Result Difference Due To Change In .inc file
rpl_drop : Result Difference Due To Change In .inc file
rpl_drop_db : Result Difference Due To Change In .inc file
rpl_flushlog_loop : Result Difference Due To Change In .inc file
rpl_get_lock : Result Difference Due To Change In .inc file
rpl_get_lock : Result Difference Due To Change In .inc file
rpl_insert : Result Difference Due To Change In .inc file
rpl_insert_select : Result Difference Due To Change In .inc file
rpl_loaddata2 : Result Difference Due To Change In .inc file
rpl_loaddatalocal : Result Difference Due To Change In .inc file
rpl_loadfile : Result Difference Due To Change In .inc file
rpl_log_pos : Result Difference Due To Change In .inc file
rpl_many_optimize : Result Difference Due To Change In .inc file
rpl_master_pos_wait : Result Difference Due To Change In .inc file
rpl_misc_functions : Result Difference Due To Change In .inc file
rpl_ps : Result Difference Due To Change In .inc file
rpl_server_id1 : Result Difference Due To Change In .inc file
rpl_session_var : Result Difference Due To Change In .inc file
rpl_sf : Result Difference Due To Change In .inc file
rpl_slave_status : Result Difference Due To Change In .inc file
rpl_sp004 : Result Difference Due To Change In .inc file
rpl_start_stop_slave : Result Difference Due To Change In .inc file
rpl_stm_max_relay_size : Result Difference Due To Change In .inc file
rpl_stm_mystery22 : Result Difference Due To Change In .inc file
rpl_stm_no_op : Result Difference Due To Change In .inc file
rpl_stm_reset_slave : Result Difference Due To Change In .inc file
rpl_temp_table : Result Difference Due To Change In .inc file
rpl_temporary : Result Difference Due To Change In .inc file
rpl_trigger : Result Difference Due To Change In .inc file
rpl_trunc_temp : Result Difference Due To Change In .inc file
rpl_user_variables : Result Difference Due To Change In .inc file
rpl_server_id2 : Result Difference Due To Change In .inc file
rpl000010 : Result Difference Due To Change In .inc file
rpl_init_slave : Result Difference Due To Change In .inc file
rpl_multi_delete2 : Result Difference Due To Change In .inc file
rpl_view : Result Difference Due To Change In .inc file
rpl_ignore_table_update : Result Difference Due To Change In .inc file
rpl_err_ignoredtable : Result Difference Due To Change In .inc file
rpl_multi_update4 : Result Difference Due To Change In .inc file
rpl_multi_delete : Result Difference Due To Change In .inc file
rpl_ignore_grant : Result Difference Due To Change In .inc file
rpl_ignore_revoke : Result Difference Due To Change In .inc file
rpl_free_items : Result Difference Due To Change In .inc file
rpl_replicate_ignore_db : Result Difference Due To Change In .inc file
rpl000017 : Result Difference Due To Change In .inc file
rpl_skip_error : Result Difference Due To Change In .inc file
rpl_row_until : Test Present in rpl suite as well . Test Fails table with t2 table not found.
rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_row_NOW : Result Difference Due To Change In .inc file
rpl_row_USER : Result Difference Due To Change In .inc file
rpl_row_drop : Result Difference Due To Change In .inc file
rpl_row_func001 : Result Difference Due To Change In .inc file
rpl_row_max_relay_size : Result Difference Due To Change In .inc file
rpl_row_reset_slave : Result Difference Due To Change In .inc file
rpl_row_sp001 : Result Difference Due To Change In .inc file
rpl_row_sp005 : Result Difference Due To Change In .inc file
rpl_row_sp008 : Result Difference Due To Change In .inc file
rpl_row_sp009 : Result Difference Due To Change In .inc file
rpl_row_sp010 : Result Difference Due To Change In .inc file
rpl_row_sp011 : Result Difference Due To Change In .inc file
rpl_row_sp012 : Result Difference Due To Change In .inc file
rpl_row_stop_middle : Result Difference Due To Change In .inc file
rpl_row_trig001 : Result Difference Due To Change In .inc file
rpl_row_trig002 : Result Difference Due To Change In .inc file
rpl_row_trig003 : Result Difference Due To Change In .inc file
rpl_row_view01 : Result Difference Due To Change In .inc file
rpl_switch_stm_row_mixed : Result Difference Due To Change In .inc file
rpl_relayspace : Result Difference Due To Change In .inc file
rpl_row_inexist_tbl : Result Difference Due To Change In .inc file
rpl_sp : Result Difference Due To Change In .inc file
rpl_rbr_to_sbr : Result Difference Due To Change In .inc file
rpl_row_until : Test Timesout
...@@ -43,14 +43,13 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc'); ...@@ -43,14 +43,13 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc'); INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def'); INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def'); INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
# Bug#52430 : Uncomment the following lines # Bug#52430
# when the bug is fixed --error ER_DUP_ENTRY
#--error ER_DUP_ENTRY INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc'); --error ER_DUP_ENTRY
#--error ER_DUP_ENTRY INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def'); --error ER_DUP_ENTRY
#--error ER_DUP_ENTRY INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
#INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
--sorted_result --sorted_result
SELECT hex(c1),hex(c2),hex(c3) FROM t1; SELECT hex(c1),hex(c2),hex(c3) FROM t1;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-- source include/master-slave.inc -- source include/master-slave.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log --enable_query_log
connection master; connection master;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment