merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back via Oracle/Innobase if needed.
This commit is contained in:
commit
eceba8912c
@ -1,4 +1,4 @@
|
||||
[MYSQL]
|
||||
post_commit_to = "guilhem@sun.com, alik@sun.com"
|
||||
#post_push_to = "commits@lists.mysql.com"
|
||||
tree_name = "mysql-trunk"
|
||||
post_commit_to = "commits@lists.mysql.com"
|
||||
post_push_to = "commits@lists.mysql.com"
|
||||
tree_name = "mysql-5.1"
|
||||
|
@ -13,7 +13,10 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
|
||||
IF(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0005 NEW)
|
||||
ENDIF(COMMAND cmake_policy)
|
||||
|
||||
PROJECT(MySql)
|
||||
|
||||
@ -28,6 +31,13 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
|
||||
|
||||
# Set standard options
|
||||
ADD_DEFINITIONS(-DHAVE_YASSL)
|
||||
ADD_DEFINITIONS(-DCMAKE_CONFIGD)
|
||||
ADD_DEFINITIONS(-DDEFAULT_MYSQL_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
|
||||
ADD_DEFINITIONS(-DDEFAULT_BASEDIR="c:/Program Files/MySQL/")
|
||||
ADD_DEFINITIONS(-DMYSQL_DATADIR="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/data")
|
||||
ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
|
||||
ADD_DEFINITIONS(-DPACKAGE=mysql)
|
||||
ADD_DEFINITIONS(-DSHAREDIR="share")
|
||||
|
||||
# Set debug options
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
|
||||
|
@ -101,7 +101,7 @@ mysql_upgrade_SOURCES= mysql_upgrade.c \
|
||||
# Fix for mit-threads
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(prefix)\"" \
|
||||
-DDATADIR="\"$(localstatedir)\""
|
||||
-DMYSQL_DATADIR="\"$(localstatedir)\""
|
||||
|
||||
sql_src=log_event.h mysql_priv.h rpl_constants.h \
|
||||
rpl_utility.h rpl_tblmap.h rpl_tblmap.cc \
|
||||
|
@ -170,6 +170,8 @@ static const char *xmlmeta[] = {
|
||||
"<", "<",
|
||||
">", ">",
|
||||
"\"", """,
|
||||
/* Turn \0 into a space. Why not �? That's not valid XML or HTML. */
|
||||
"\0", " ",
|
||||
0, 0
|
||||
};
|
||||
static const char *day_names[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
|
||||
@ -2302,8 +2304,10 @@ extern "C" char **new_mysql_completion (const char *text, int start, int end);
|
||||
*/
|
||||
|
||||
#if defined(USE_NEW_READLINE_INTERFACE)
|
||||
static int fake_magic_space(int, int);
|
||||
extern "C" char *no_completion(const char*,int)
|
||||
#elif defined(USE_LIBEDIT_INTERFACE)
|
||||
static int fake_magic_space(const char *, int);
|
||||
extern "C" int no_completion(const char*,int)
|
||||
#else
|
||||
extern "C" char *no_completion()
|
||||
@ -2380,6 +2384,18 @@ static int not_in_history(const char *line)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#if defined(USE_NEW_READLINE_INTERFACE)
|
||||
static int fake_magic_space(int, int)
|
||||
#else
|
||||
static int fake_magic_space(const char *, int)
|
||||
#endif
|
||||
{
|
||||
rl_insert(1, ' ');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void initialize_readline (char *name)
|
||||
{
|
||||
/* Allow conditional parsing of the ~/.inputrc file. */
|
||||
@ -2389,12 +2405,15 @@ static void initialize_readline (char *name)
|
||||
#if defined(USE_NEW_READLINE_INTERFACE)
|
||||
rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;
|
||||
rl_completion_entry_function= (rl_compentry_func_t*)&no_completion;
|
||||
|
||||
rl_add_defun("magic-space", (rl_command_func_t *)&fake_magic_space, -1);
|
||||
#elif defined(USE_LIBEDIT_INTERFACE)
|
||||
#ifdef HAVE_LOCALE_H
|
||||
setlocale(LC_ALL,""); /* so as libedit use isprint */
|
||||
#endif
|
||||
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
|
||||
rl_completion_entry_function= &no_completion;
|
||||
rl_add_defun("magic-space", (Function*)&fake_magic_space, -1);
|
||||
#else
|
||||
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
|
||||
rl_completion_entry_function= &no_completion;
|
||||
@ -3308,6 +3327,9 @@ print_table_data(MYSQL_RES *result)
|
||||
uint visible_length;
|
||||
uint extra_padding;
|
||||
|
||||
if (off)
|
||||
(void) tee_fputs(" ", PAGER);
|
||||
|
||||
if (cur[off] == NULL)
|
||||
{
|
||||
buffer= "NULL";
|
||||
@ -3342,7 +3364,7 @@ print_table_data(MYSQL_RES *result)
|
||||
else
|
||||
tee_print_sized_data(buffer, data_length, field_max_length+extra_padding, FALSE);
|
||||
}
|
||||
tee_fputs(" | ", PAGER);
|
||||
tee_fputs(" |", PAGER);
|
||||
}
|
||||
(void) tee_fputs("\n", PAGER);
|
||||
}
|
||||
@ -3482,11 +3504,29 @@ print_table_data_vertically(MYSQL_RES *result)
|
||||
mysql_field_seek(result,0);
|
||||
tee_fprintf(PAGER,
|
||||
"*************************** %d. row ***************************\n", row_count);
|
||||
|
||||
ulong *lengths= mysql_fetch_lengths(result);
|
||||
|
||||
for (uint off=0; off < mysql_num_fields(result); off++)
|
||||
{
|
||||
field= mysql_fetch_field(result);
|
||||
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
|
||||
tee_fprintf(PAGER, "%s\n",cur[off] ? (char*) cur[off] : "NULL");
|
||||
if (cur[off])
|
||||
{
|
||||
unsigned int i;
|
||||
const char *p;
|
||||
|
||||
for (i= 0, p= cur[off]; i < lengths[off]; i+= 1, p+= 1)
|
||||
{
|
||||
if (*p == '\0')
|
||||
tee_putc((int)' ', PAGER);
|
||||
else
|
||||
tee_putc((int)*p, PAGER);
|
||||
}
|
||||
tee_putc('\n', PAGER);
|
||||
}
|
||||
else
|
||||
tee_fprintf(PAGER, "NULL\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3553,7 +3593,7 @@ xmlencode_print(const char *src, uint length)
|
||||
tee_fputs("NULL", PAGER);
|
||||
else
|
||||
{
|
||||
for (const char *p = src; *p && length; *p++, length--)
|
||||
for (const char *p = src; length; *p++, length--)
|
||||
{
|
||||
const char *t;
|
||||
if ((t = array_value(xmlmeta, *p)))
|
||||
@ -3573,7 +3613,12 @@ safe_put_field(const char *pos,ulong length)
|
||||
else
|
||||
{
|
||||
if (opt_raw_data)
|
||||
tee_fputs(pos, PAGER);
|
||||
{
|
||||
unsigned long i;
|
||||
/* Can't use tee_fputs(), it stops with NUL characters. */
|
||||
for (i= 0; i < length; i++, pos++)
|
||||
tee_putc(*pos, PAGER);
|
||||
}
|
||||
else for (const char *end=pos+length ; pos != end ; pos++)
|
||||
{
|
||||
#ifdef USE_MB
|
||||
|
@ -253,8 +253,12 @@ get_one_option(int optid, const struct my_option *opt,
|
||||
break;
|
||||
|
||||
case 'b': /* --basedir */
|
||||
case 'v': /* --verbose */
|
||||
case 'd': /* --datadir */
|
||||
fprintf(stderr, "%s: the '--%s' option is always ignored\n",
|
||||
my_progname, optid == 'b' ? "basedir" : "datadir");
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'v': /* --verbose */
|
||||
case 'f': /* --force */
|
||||
add_option= FALSE;
|
||||
break;
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <mysql.h>
|
||||
|
||||
#define ADMIN_VERSION "8.42"
|
||||
#define MAX_MYSQL_VAR 256
|
||||
#define MAX_MYSQL_VAR 512
|
||||
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
|
||||
#define MAX_TRUNC_LENGTH 3
|
||||
|
||||
@ -371,7 +371,7 @@ int main(int argc,char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
while (!interrupted && (!opt_count_iterations || nr_iterations))
|
||||
while (!interrupted)
|
||||
{
|
||||
new_line = 0;
|
||||
if ((error=execute_commands(&mysql,argc,commands)))
|
||||
@ -395,11 +395,11 @@ int main(int argc,char *argv[])
|
||||
}
|
||||
if (interval)
|
||||
{
|
||||
if (opt_count_iterations && --nr_iterations == 0)
|
||||
break;
|
||||
sleep(interval);
|
||||
if (new_line)
|
||||
puts("");
|
||||
if (opt_count_iterations)
|
||||
nr_iterations--;
|
||||
}
|
||||
else
|
||||
break;
|
||||
@ -743,6 +743,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
mysql_error(mysql));
|
||||
return -1;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(mysql_num_rows(res) < MAX_MYSQL_VAR);
|
||||
|
||||
if (!opt_vertical)
|
||||
print_header(res);
|
||||
else
|
||||
|
@ -442,7 +442,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
||||
{
|
||||
if (use_db(db))
|
||||
return 1;
|
||||
if (opt_all_in_1)
|
||||
if (opt_all_in_1 && what_to_do != DO_UPGRADE)
|
||||
{
|
||||
/*
|
||||
We need table list in form `a`, `b`, `c`
|
||||
@ -536,7 +536,7 @@ static int process_all_tables_in_db(char *database)
|
||||
|
||||
num_columns= mysql_num_fields(res);
|
||||
|
||||
if (opt_all_in_1)
|
||||
if (opt_all_in_1 && what_to_do != DO_UPGRADE)
|
||||
{
|
||||
/*
|
||||
We need table list in form `a`, `b`, `c`
|
||||
|
@ -3137,6 +3137,12 @@ static void dump_table(char *table, char *db)
|
||||
dynstr_append_checked(&query_string, filename);
|
||||
dynstr_append_checked(&query_string, "'");
|
||||
|
||||
dynstr_append_checked(&query_string, " /*!50138 CHARACTER SET ");
|
||||
dynstr_append_checked(&query_string, default_charset == mysql_universal_client_charset ?
|
||||
my_charset_bin.name : /* backward compatibility */
|
||||
default_charset);
|
||||
dynstr_append_checked(&query_string, " */");
|
||||
|
||||
if (fields_terminated || enclosed || opt_enclosed || escaped)
|
||||
dynstr_append_checked(&query_string, " FIELDS");
|
||||
|
||||
@ -4810,7 +4816,8 @@ static my_bool get_view_structure(char *table, char* db)
|
||||
result_table);
|
||||
check_io(sql_file);
|
||||
}
|
||||
fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n", opt_quoted_table);
|
||||
/* Table might not exist if this view was dumped with --tab. */
|
||||
fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);
|
||||
if (opt_drop)
|
||||
{
|
||||
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
|
||||
|
@ -303,7 +303,8 @@ static int get_options(int *argc, char ***argv)
|
||||
static int write_to_table(char *filename, MYSQL *mysql)
|
||||
{
|
||||
char tablename[FN_REFLEN], hard_path[FN_REFLEN],
|
||||
sql_statement[FN_REFLEN*16+256], *end;
|
||||
escaped_name[FN_REFLEN * 2 + 1],
|
||||
sql_statement[FN_REFLEN*16+256], *end, *pos;
|
||||
DBUG_ENTER("write_to_table");
|
||||
DBUG_PRINT("enter",("filename: %s",filename));
|
||||
|
||||
@ -338,15 +339,25 @@ static int write_to_table(char *filename, MYSQL *mysql)
|
||||
fprintf(stdout, "Loading data from SERVER file: %s into %s\n",
|
||||
hard_path, tablename);
|
||||
}
|
||||
mysql_real_escape_string(mysql, escaped_name, hard_path,
|
||||
(unsigned long) strlen(hard_path));
|
||||
sprintf(sql_statement, "LOAD DATA %s %s INFILE '%s'",
|
||||
opt_low_priority ? "LOW_PRIORITY" : "",
|
||||
opt_local_file ? "LOCAL" : "", hard_path);
|
||||
opt_local_file ? "LOCAL" : "", escaped_name);
|
||||
end= strend(sql_statement);
|
||||
if (replace)
|
||||
end= strmov(end, " REPLACE");
|
||||
if (ignore)
|
||||
end= strmov(end, " IGNORE");
|
||||
end= strmov(strmov(end, " INTO TABLE "), tablename);
|
||||
end= strmov(end, " INTO TABLE `");
|
||||
/* Turn any ` into `` in table name. */
|
||||
for (pos= tablename; *pos; pos++)
|
||||
{
|
||||
if (*pos == '`')
|
||||
*end++= '`';
|
||||
*end++= *pos;
|
||||
}
|
||||
end= strmov(end, "`");
|
||||
|
||||
if (fields_terminated || enclosed || opt_enclosed || escaped)
|
||||
end= strmov(end, " FIELDS");
|
||||
|
@ -565,8 +565,7 @@ static struct my_option my_long_options[] =
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"csv", OPT_SLAP_CSV,
|
||||
"Generate CSV output to named file or to stdout if no file is named.",
|
||||
(uchar**) &opt_csv_str, (uchar**) &opt_csv_str, 0, GET_STR,
|
||||
OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
NULL, NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
||||
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -740,6 +739,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||
debug_check_flag= 1;
|
||||
break;
|
||||
case OPT_SLAP_CSV:
|
||||
if (!argument)
|
||||
argument= (char *)"-"; /* use stdout */
|
||||
opt_csv_str= argument;
|
||||
break;
|
||||
#include <sslopt-case.h>
|
||||
case 'V':
|
||||
print_version();
|
||||
|
@ -456,6 +456,10 @@ fi
|
||||
AC_DEFUN([MYSQL_STACK_DIRECTION],
|
||||
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
[AC_TRY_RUN([#include <stdlib.h>
|
||||
/* Prevent compiler optimization by HP's compiler, see bug#42213 */
|
||||
#if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux)
|
||||
#pragma noinline
|
||||
#endif
|
||||
int find_stack_direction ()
|
||||
{
|
||||
static char *addr = 0;
|
||||
|
@ -70,12 +70,16 @@ AC_CHECK_HEADERS(wctype.h)
|
||||
AC_CHECK_HEADERS(wchar.h)
|
||||
AC_CHECK_HEADERS(langinfo.h)
|
||||
|
||||
AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE([HAVE_MBSRTOWCS],[],[Define if you have mbsrtowcs]))
|
||||
AC_CHECK_FUNC(mbrtowc, AC_DEFINE([HAVE_MBRTOWC],[],[Define if you have mbrtowc]))
|
||||
AC_CHECK_FUNC(mbrlen, AC_DEFINE([HAVE_MBRLEN],[],[Define if you have mbrlen]))
|
||||
AC_CHECK_FUNC(wctomb, AC_DEFINE([HAVE_WCTOMB],[],[Define if you have wctomb]))
|
||||
AC_CHECK_FUNC(wcwidth, AC_DEFINE([HAVE_WCWIDTH],[],[Define if you have wcwidth]))
|
||||
AC_CHECK_FUNC(wcsdup, AC_DEFINE([HAVE_WCSDUP],[],[Define if you check wcsdup]))
|
||||
AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN,[],[Define if you have mbrlen]))
|
||||
AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP,[],[Define if you have mbscmp]))
|
||||
AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS,[],[Define if you have mbsrtowcs]))
|
||||
|
||||
AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB,[],[Define if you have wcrtomb]))
|
||||
AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC,[],[Define if you have mbrtowc]))
|
||||
AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL,[],[Define if you have wcscoll]))
|
||||
AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP,[],[Define if you have wcsdup]))
|
||||
AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH,[],[Define if you have wcwidth]))
|
||||
AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE,[],[Define if you have wctype]))
|
||||
|
||||
AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t,
|
||||
[AC_TRY_COMPILE([
|
||||
@ -88,6 +92,8 @@ if test $mysql_cv_have_mbstate_t = yes; then
|
||||
AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype)
|
||||
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset,
|
||||
[AC_TRY_LINK(
|
||||
[#include <langinfo.h>],
|
||||
@ -97,4 +103,41 @@ if test $mysql_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes])
|
||||
fi
|
||||
|
||||
dnl check for wchar_t in <wchar.h>
|
||||
AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <wchar.h>
|
||||
],
|
||||
[
|
||||
wchar_t foo;
|
||||
foo = 0;
|
||||
], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)])
|
||||
if test $bash_cv_type_wchar_t = yes; then
|
||||
AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here])
|
||||
fi
|
||||
|
||||
dnl check for wctype_t in <wctype.h>
|
||||
AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <wctype.h>],
|
||||
[
|
||||
wctype_t foo;
|
||||
foo = 0;
|
||||
], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)])
|
||||
if test $bash_cv_type_wctype_t = yes; then
|
||||
AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here])
|
||||
fi
|
||||
|
||||
dnl check for wint_t in <wctype.h>
|
||||
AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <wctype.h>],
|
||||
[
|
||||
wint_t foo;
|
||||
foo = 0;
|
||||
], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)])
|
||||
if test $bash_cv_type_wint_t = yes; then
|
||||
AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here])
|
||||
fi
|
||||
|
||||
])
|
||||
|
@ -131,7 +131,7 @@ extern "C" {
|
||||
#define DEFAULT_BASEDIR "sys:/"
|
||||
#define SHAREDIR "share/"
|
||||
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
|
||||
#define DATADIR "data/"
|
||||
#define MYSQL_DATADIR "data/"
|
||||
|
||||
/* 64-bit file system calls */
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
@ -17,15 +17,6 @@
|
||||
|
||||
#define BIG_TABLES
|
||||
|
||||
#ifdef __WIN2000__
|
||||
/* We have to do this define before including windows.h to get the AWE API
|
||||
functions */
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#else
|
||||
/* Get NT 4.0 functions */
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
/* Avoid endless warnings about sprintf() etc. being unsafe. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
@ -322,13 +313,15 @@ inline ulonglong double2ulonglong(double d)
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#ifndef CMAKE_CONFIGD
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define DATADIR "c:\\mysql\\data"
|
||||
#define MYSQL_DATADIR "c:\\mysql\\data"
|
||||
#define PACKAGE "mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#endif
|
||||
#endif
|
||||
#ifndef DEFAULT_HOME_ENV
|
||||
#define DEFAULT_HOME_ENV MYSQL_HOME
|
||||
#endif
|
||||
|
@ -441,7 +441,8 @@ enum ha_base_keytype {
|
||||
#define HA_ERR_INITIALIZATION 174 /* Error during initialization */
|
||||
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
|
||||
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
|
||||
#define HA_ERR_LAST 176 /* Copy of last error nr */
|
||||
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
|
||||
#define HA_ERR_LAST 177 /* Copy of last error nr */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
@ -47,6 +47,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
|
||||
ulonglong deleted; /* Deleted records in database */
|
||||
ulonglong recpos; /* Pos for last used record */
|
||||
ulonglong data_file_length;
|
||||
ulonglong dupp_key_pos; /* Offset of the Duplicate key in the merge table */
|
||||
uint reclength; /* Recordlength */
|
||||
int errkey; /* With key was dupplicated on err */
|
||||
uint options; /* HA_OPTION_... used */
|
||||
|
@ -109,6 +109,14 @@ typedef my_socket YASSL_SOCKET_T;
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
enum enum_ssl_init_error
|
||||
{
|
||||
SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,
|
||||
SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS,
|
||||
SSL_INITERR_MEMFAIL, SSL_INITERR_LASTERR
|
||||
};
|
||||
const char* sslGetErrString(enum enum_ssl_init_error err);
|
||||
|
||||
struct st_VioSSLFd
|
||||
{
|
||||
SSL_CTX *ssl_context;
|
||||
@ -124,7 +132,7 @@ struct st_VioSSLFd
|
||||
struct st_VioSSLFd
|
||||
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
|
||||
const char *ca_file,const char *ca_path,
|
||||
const char *cipher);
|
||||
const char *cipher, enum enum_ssl_init_error* error);
|
||||
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
||||
|
@ -85,7 +85,7 @@ BUILT_SOURCES = link_sources
|
||||
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
|
||||
$(target) $(BUILT_SOURCES)
|
||||
DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DDEFAULT_HOME_ENV=MYSQL_HOME \
|
||||
-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
|
||||
-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
|
||||
|
@ -26,7 +26,7 @@ pkgplugindir = $(pkglibdir)/plugin
|
||||
EXTRA_DIST = libmysqld.def CMakeLists.txt
|
||||
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
|
||||
-DPLUGINDIR="\"$(pkgplugindir)\"" \
|
||||
-DDISABLE_DTRACE
|
||||
|
@ -79,4 +79,4 @@ public:
|
||||
uint emb_count_querycache_size(THD *thd);
|
||||
int emb_load_querycache_result(THD *thd, Querycache_stream *src);
|
||||
void emb_store_querycache_result(Querycache_stream *dst, THD* thd);
|
||||
void net_send_eof(THD *thd, uint server_status, uint total_warn_count);
|
||||
bool net_send_eof(THD *thd, uint server_status, uint total_warn_count);
|
||||
|
@ -803,11 +803,11 @@ MYSQL_DATA *THD::alloc_new_dataset()
|
||||
*/
|
||||
|
||||
static
|
||||
void
|
||||
bool
|
||||
write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
|
||||
{
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
return;
|
||||
return FALSE;
|
||||
/*
|
||||
The following test should never be true, but it's better to do it
|
||||
because if 'is_fatal_error' is set the server is not going to execute
|
||||
@ -822,6 +822,7 @@ write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
|
||||
*/
|
||||
thd->cur_data->embedded_info->warning_count=
|
||||
(thd->spcont ? 0 : min(total_warn_count, 65535));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@ -1032,31 +1033,34 @@ bool Protocol_binary::write()
|
||||
@sa Server implementation of net_send_ok in protocol.cc for
|
||||
description of the arguments.
|
||||
|
||||
@return The function does not return errors.
|
||||
@return
|
||||
@retval TRUE An error occurred
|
||||
@retval FALSE Success
|
||||
*/
|
||||
|
||||
void
|
||||
bool
|
||||
net_send_ok(THD *thd,
|
||||
uint server_status, uint total_warn_count,
|
||||
ha_rows affected_rows, ulonglong id, const char *message)
|
||||
{
|
||||
DBUG_ENTER("emb_net_send_ok");
|
||||
MYSQL_DATA *data;
|
||||
bool error;
|
||||
MYSQL *mysql= thd->mysql;
|
||||
|
||||
if (!mysql) // bootstrap file handling
|
||||
DBUG_VOID_RETURN;
|
||||
DBUG_RETURN(FALSE);
|
||||
if (!(data= thd->alloc_new_dataset()))
|
||||
return;
|
||||
return TRUE;
|
||||
data->embedded_info->affected_rows= affected_rows;
|
||||
data->embedded_info->insert_id= id;
|
||||
if (message)
|
||||
strmake(data->embedded_info->info, message,
|
||||
sizeof(data->embedded_info->info)-1);
|
||||
|
||||
write_eof_packet(thd, server_status, total_warn_count);
|
||||
error= write_eof_packet(thd, server_status, total_warn_count);
|
||||
thd->cur_data= 0;
|
||||
DBUG_VOID_RETURN;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
@ -1065,27 +1069,41 @@ net_send_ok(THD *thd,
|
||||
|
||||
@sa net_send_ok
|
||||
|
||||
@return This function does not return errors.
|
||||
@return
|
||||
@retval TRUE An error occurred
|
||||
@retval FALSE Success
|
||||
*/
|
||||
|
||||
void
|
||||
bool
|
||||
net_send_eof(THD *thd, uint server_status, uint total_warn_count)
|
||||
{
|
||||
write_eof_packet(thd, server_status, total_warn_count);
|
||||
bool error= write_eof_packet(thd, server_status, total_warn_count);
|
||||
thd->cur_data= 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
|
||||
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
|
||||
{
|
||||
MYSQL_DATA *data= thd->cur_data ? thd->cur_data : thd->alloc_new_dataset();
|
||||
struct embedded_query_result *ei= data->embedded_info;
|
||||
MYSQL_DATA *data= thd->cur_data;
|
||||
struct embedded_query_result *ei;
|
||||
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
{
|
||||
fprintf(stderr, "ERROR: %d %s\n", sql_errno, err);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!data)
|
||||
data= thd->alloc_new_dataset();
|
||||
|
||||
ei= data->embedded_info;
|
||||
ei->last_errno= sql_errno;
|
||||
strmake(ei->info, err, sizeof(ei->info)-1);
|
||||
strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno));
|
||||
ei->server_status= thd->server_status;
|
||||
thd->cur_data= 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -258,3 +258,15 @@ dec $it;
|
||||
}
|
||||
show master status /* must show new binlog index after rotating */;
|
||||
drop table t3;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #45998: database crashes when running "create as select"
|
||||
--echo #
|
||||
CREATE DATABASE test1;
|
||||
USE test1;
|
||||
DROP DATABASE test1;
|
||||
CREATE TABLE test.t1(a int);
|
||||
INSERT INTO test.t1 VALUES (1), (2);
|
||||
CREATE TABLE test.t2 SELECT * FROM test.t1;
|
||||
USE test;
|
||||
DROP TABLES t1, t2;
|
||||
|
@ -0,0 +1,63 @@
|
||||
#
|
||||
# BUG#45214
|
||||
# The common part of the "rpl_get_master_version_and_clock" test.
|
||||
# Restart slave under network disconnection between slave and master
|
||||
# following the steps:
|
||||
# 1 - Got DBUG_SYNC_POINT lock
|
||||
# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here
|
||||
# 3 - shutdown master server for simulating network disconnection
|
||||
# 4 - Release DBUG_SYNC_POINT lock
|
||||
# 5 - Check if the slave I/O thread tries to reconnect to master.
|
||||
#
|
||||
# Note: Please make sure initialize the $debug_lock when call the test script.
|
||||
#
|
||||
connection slave;
|
||||
if (`SELECT '$debug_lock' = ''`)
|
||||
{
|
||||
--die Cannot continue. Please set value for $debug_lock.
|
||||
}
|
||||
|
||||
# Restart slave
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
connection master;
|
||||
# Write file to make mysql-test-run.pl expect the "crash", but don't start
|
||||
# it until it's told to
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait
|
||||
EOF
|
||||
|
||||
# Send shutdown to the connected server and give
|
||||
# it 10 seconds to die before zapping it
|
||||
shutdown_server 10;
|
||||
|
||||
connection slave;
|
||||
eval SELECT RELEASE_LOCK($debug_lock);
|
||||
|
||||
# Show slave last IO errno
|
||||
connection slave;
|
||||
source include/wait_for_slave_io_error.inc;
|
||||
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
|
||||
echo Slave_IO_Errno= $last_io_errno;
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
EOF
|
||||
|
||||
connection master;
|
||||
# Turn on reconnect
|
||||
--enable_reconnect
|
||||
|
||||
# Call script that will poll the server waiting for it to be back online again
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Turn off reconnect again
|
||||
--disable_reconnect
|
||||
|
||||
connection slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
29
mysql-test/r/bug40113.result
Normal file
29
mysql-test/r/bug40113.result
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
||||
# without error
|
||||
#
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
||||
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
b
|
||||
7
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
DROP TABLE t2, t1;
|
||||
End of 5.0 tests
|
@ -1894,4 +1894,18 @@ DROP TABLE t1;
|
||||
create table `me:i`(id int);
|
||||
drop table `me:i`;
|
||||
|
||||
# --
|
||||
# -- Bug#45829: CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
|
||||
# --
|
||||
|
||||
drop table if exists t1,t2,t3;
|
||||
create table t1 (a int) transactional=0;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'transactional=0' at line 1
|
||||
create table t2 (a int) page_checksum=1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'page_checksum=1' at line 1
|
||||
create table t3 (a int) row_format=page;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'page' at line 1
|
||||
|
||||
# -- End of Bug#45829
|
||||
|
||||
End of 5.1 tests
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -165,7 +165,7 @@ CREATE TABLE `good
|
||||
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
|
||||
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
|
||||
set names latin1;
|
||||
create table t1 (a char(10) character set koi8r, b text character set koi8r);
|
||||
insert into t1 values ('test','test');
|
||||
|
@ -543,3 +543,11 @@ awrd bwrd cwrd
|
||||
awrd bwrd cwrd
|
||||
awrd bwrd cwrd
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (col text, FULLTEXT KEY full_text (col));
|
||||
PREPARE s FROM
|
||||
"SELECT MATCH (col) AGAINST('findme') FROM t1 ORDER BY MATCH (col) AGAINST('findme')"
|
||||
;
|
||||
EXECUTE s;
|
||||
MATCH (col) AGAINST('findme')
|
||||
DEALLOCATE PREPARE s;
|
||||
DROP TABLE t1;
|
||||
|
@ -833,3 +833,16 @@ Table Op Msg_type Msg_text
|
||||
test.t2 check status OK
|
||||
drop table t1,t2;
|
||||
##################################################################
|
||||
#
|
||||
# Bug #46075: Assertion failed: 0, file .\protocol.cc, line 416
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
SET max_heap_table_size = 16384;
|
||||
SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size;
|
||||
SET GLOBAL myisam_data_pointer_size = 2;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
|
||||
Got one of the listed errors
|
||||
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -2115,6 +2115,52 @@ insert into m1 (col1) values (1);
|
||||
insert into m1 (col1) values (1);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
drop table m1, t1;
|
||||
#
|
||||
# Bug#45800 crash when replacing into a merge table and there is a duplicate
|
||||
#
|
||||
# Replace duplicate value in child table when merge table doesn't have key
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE m1 (c1 INT NOT NULL) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
c1
|
||||
666
|
||||
# insert the duplicate value into the merge table
|
||||
REPLACE INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
c1
|
||||
666
|
||||
DROP TABLE m1, t1;
|
||||
# Insert... on duplicate key update (with duplicate values in the table)
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE m1 (c1 INT NOT NULL) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
c1
|
||||
666
|
||||
# insert the duplicate value into the merge table
|
||||
INSERT INTO m1 VALUES (666) ON DUPLICATE KEY UPDATE c1=c1+1;
|
||||
SELECT * FROM m1;
|
||||
c1
|
||||
667
|
||||
DROP TABLE m1, t1;
|
||||
# Insert duplicate value on MERGE table, where, MERGE has a key but MyISAM has more keys
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE (c1), UNIQUE (c2));
|
||||
CREATE TABLE m1 (c1 INT, c2 INT, UNIQUE (c1)) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (1,2);
|
||||
# insert the duplicate value into the merge table
|
||||
INSERT INTO m1 VALUES (3,2);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
DROP TABLE m1,t1;
|
||||
# Try to define MERGE and MyISAM with keys on different columns
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE (c1));
|
||||
CREATE TABLE m1 (c1 INT, c2 INT, UNIQUE (c2)) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
# Try accessing the merge table for inserts (error occurs)
|
||||
INSERT INTO m1 VALUES (1,2);
|
||||
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||
INSERT INTO m1 VALUES (1,4);
|
||||
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||
DROP TABLE m1,t1;
|
||||
CREATE TABLE t1 (
|
||||
col1 INT(10)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
@ -2141,4 +2187,24 @@ SELECT * FROM m1;
|
||||
c1
|
||||
DROP TABLE m1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug45781 infinite hang/crash in "opening tables" after handler tries to
|
||||
# open merge table
|
||||
#
|
||||
DROP TABLE IF EXISTS m1,t1;
|
||||
CREATE TABLE t1(a int)engine=myisam;
|
||||
CREATE TABLE t2(a int)engine=myisam;
|
||||
CREATE TABLE t3(a int)engine=myisam;
|
||||
CREATE TABLE t4(a int)engine=myisam;
|
||||
CREATE TABLE t5(a int)engine=myisam;
|
||||
CREATE TABLE t6(a int)engine=myisam;
|
||||
CREATE TABLE t7(a int)engine=myisam;
|
||||
CREATE TABLE m1(a int)engine=merge union=(t1,t2,t3,t4,t5,t6,t7);
|
||||
SELECT 1 FROM m1;
|
||||
1
|
||||
HANDLER m1 OPEN;
|
||||
ERROR HY000: Table storage engine for 'm1' doesn't have this option
|
||||
DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7;
|
||||
SELECT 1 FROM m1;
|
||||
ERROR 42S02: Table 'test.m1' doesn't exist
|
||||
End of 5.1 tests
|
||||
|
@ -207,5 +207,27 @@ Warning (Code 1286): Unknown table engine 'nonexistent2'
|
||||
Warning (Code 1266): Using storage engine MyISAM for table 't2'
|
||||
Error (Code 1050): Table 't2' already exists
|
||||
drop tables t1, t2;
|
||||
<TABLE BORDER=1><TR><TH><</TH></TR><TR><TD>< & ></TD></TR></TABLE>
|
||||
<TABLE BORDER=1><TR><TH><</TH></TR><TR><TD>< & ></TD></TR></TABLE>create table t1 (a char(5));
|
||||
insert into t1 values ('\0b\0');
|
||||
a
|
||||
\0b\0
|
||||
a
|
||||
\0b\0
|
||||
+------+
|
||||
| a |
|
||||
+------+
|
||||
| b |
|
||||
+------+
|
||||
*************************** 1. row ***************************
|
||||
a: b
|
||||
<TABLE BORDER=1><TR><TH>a</TH></TR><TR><TD> b </TD></TR></TABLE><?xml version="1.0"?>
|
||||
|
||||
<resultset statement="select a from t1
|
||||
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<row>
|
||||
<field name="a"> b </field>
|
||||
</row>
|
||||
</resultset>
|
||||
drop table t1;
|
||||
|
||||
End of tests
|
||||
|
@ -186,4 +186,18 @@ a
|
||||
500
|
||||
DROP DATABASE `a@b`;
|
||||
USE test;
|
||||
#
|
||||
# Bug #31821: --all-in-1 and --fix-table-names don't work together
|
||||
#
|
||||
drop table if exists `#mysql50#t1-1`;
|
||||
create table `#mysql50#t1-1` (a int);
|
||||
show tables like 't1-1';
|
||||
Tables_in_test (t1-1)
|
||||
t1-1
|
||||
drop table `t1-1`;
|
||||
create table `#mysql50#t1-1` (a int);
|
||||
show tables like 't1-1';
|
||||
Tables_in_test (t1-1)
|
||||
t1-1
|
||||
drop table `t1-1`;
|
||||
End of 5.1 tests
|
||||
|
@ -1991,7 +1991,7 @@ SET character_set_client = utf8;
|
||||
`a` varchar(30)
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -2085,7 +2085,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11)
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -2159,7 +2159,7 @@ SET character_set_client = utf8;
|
||||
`a` varchar(30)
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -2293,7 +2293,7 @@ SET character_set_client = utf8;
|
||||
`c` varchar(30)
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -2307,7 +2307,7 @@ SET character_set_client = @saved_cs_client;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -2321,7 +2321,7 @@ SET character_set_client = @saved_cs_client;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!50001 DROP TABLE `v3`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v3`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -3054,7 +3054,7 @@ SET character_set_client = utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `test`;
|
||||
/*!50001 DROP TABLE `v0`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v0`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v0`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -3068,7 +3068,7 @@ USE `test`;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -3082,7 +3082,7 @@ USE `test`;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -3320,7 +3320,7 @@ insert into t values(5, 51);
|
||||
create view v1 as select qty, price, qty*price as value from t;
|
||||
create view v2 as select qty from v1;
|
||||
mysqldump {
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
@ -3335,7 +3335,7 @@ mysqldump {
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
|
||||
} mysqldump {
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
@ -3434,7 +3434,7 @@ SET character_set_client = utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `mysqldump_test_db`;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -3496,7 +3496,7 @@ SET character_set_client = @saved_cs_client;
|
||||
USE `mysqldump_tables`;
|
||||
|
||||
USE `mysqldump_views`;
|
||||
/*!50001 DROP TABLE `nasishnasifu`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
@ -3885,7 +3885,7 @@ SET character_set_client = utf8;
|
||||
`c` int(11)
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -4304,7 +4304,7 @@ SET character_set_client = utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `mysqldump_test_db`;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
@ -4430,6 +4430,25 @@ DROP DATABASE mysqldump_test_db;
|
||||
|
||||
# -- End of test case for Bug#32538.
|
||||
|
||||
#
|
||||
# Bug#37377 Incorrect DROP TABLE statement in dump of a VIEW using --tab
|
||||
#
|
||||
create table t1 (a int);
|
||||
create view v1 as select a from t1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#28071 mysqlimport does not quote or escape table name
|
||||
#
|
||||
drop table if exists `load`;
|
||||
create table `load` (a varchar(255));
|
||||
test.load: Records: 70 Deleted: 0 Skipped: 0 Warnings: 0
|
||||
select count(*) from `load`;
|
||||
count(*)
|
||||
70
|
||||
drop table `load`;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
|
||||
|
||||
Bug #34861 - mysqldump with --tab gives weird output for triggers.
|
||||
@ -4483,5 +4502,64 @@ DROP PROCEDURE IF EXISTS pr1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# Bug #30946: mysqldump silently ignores --default-character-set
|
||||
# when used with --tab
|
||||
#
|
||||
# Also see outfile_loaddata.test
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a INT, b CHAR(10) CHARSET koi8r, c CHAR(10) CHARSET latin1);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t1 VALUES (1, 'ABC-Ð<>БВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
# error on multi-character ENCLOSED/ESCAPED BY
|
||||
# default '--default-charset' (binary):
|
||||
##################################################
|
||||
1 ABC-áâ÷ DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# utf8:
|
||||
##################################################
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET utf8;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# latin1 (data corruption is expected):
|
||||
##################################################
|
||||
1 ABC-??? DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET latin1 ;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-??? DEF-ÂÃÄ
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# koi8r (data corruption is expected):
|
||||
##################################################
|
||||
1 ABC-áâ÷ DEF-???
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET koi8r;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-???
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
SET NAMES default;
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
|
@ -1500,3 +1500,60 @@ id1
|
||||
15
|
||||
16
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b INT NOT NULL,
|
||||
c char(100),
|
||||
KEY (b, c),
|
||||
KEY (b, a, c)
|
||||
)
|
||||
DEFAULT CHARSET = utf8;
|
||||
INSERT INTO t1 VALUES
|
||||
(1, 1, 1),
|
||||
(2, 2, 2),
|
||||
(3, 3, 3),
|
||||
(4, 4, 4),
|
||||
(5, 5, 5),
|
||||
(6, 6, 6),
|
||||
(7, 7, 7),
|
||||
(8, 8, 8),
|
||||
(9, 9, 9);
|
||||
INSERT INTO t1 SELECT a + 10, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 20, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 40, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 80, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 160, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 320, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 640, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 1280, b, c FROM t1 LIMIT 80;
|
||||
EXPLAIN
|
||||
SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range b,b_2 b 4 NULL 226 Using where
|
||||
SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9;
|
||||
a
|
||||
2071
|
||||
2061
|
||||
2051
|
||||
2041
|
||||
2031
|
||||
2021
|
||||
2011
|
||||
2001
|
||||
1991
|
||||
EXPLAIN
|
||||
SELECT DISTINCT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 0, 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range b,b_2 b 4 NULL 226 Using where; Using temporary
|
||||
SELECT DISTINCT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 0, 9;
|
||||
a
|
||||
2071
|
||||
2061
|
||||
2051
|
||||
2041
|
||||
2031
|
||||
2021
|
||||
2011
|
||||
2001
|
||||
1991
|
||||
DROP TABLE t1;
|
||||
|
@ -91,13 +91,152 @@ SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' FIELDS ENCLOSED BY 0xC3 FROM t1;
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
TRUNCATE t1;
|
||||
SELECT HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'));
|
||||
HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'))
|
||||
C35CC3C30A
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3;
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests.
|
||||
#
|
||||
# Bug #30946: mysqldump silently ignores --default-character-set
|
||||
# when used with --tab
|
||||
#
|
||||
# Also see mysqldump.test
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a INT, b CHAR(10) CHARSET koi8r, c CHAR(10) CHARSET latin1);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t1 VALUES (1, 'ABC-Ð<>БВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
# Error on multi-character ENCLOSED/ESCAPED BY
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ENCLOSED BY '12345';
|
||||
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ESCAPED BY '12345';
|
||||
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||
# "Not implemented" warning on multibyte ENCLOSED/ESCAPED BY character,
|
||||
# LOAD DATA rises error or has unpredictable result -- to be fixed later
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ENCLOSED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS ENCLOSED BY 'ÑŠ';
|
||||
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ESCAPED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS ESCAPED BY 'ÑŠ';
|
||||
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS TERMINATED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
##################################################
|
||||
1ÑŠABC-áâ÷ÑŠDEF-ÂÃÄ
|
||||
2ÑŠ\NÑŠ\N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
Warning 1265 Data truncated for column 'a' at row 2
|
||||
Warning 1261 Row 2 doesn't contain data for all columns
|
||||
Warning 1261 Row 2 doesn't contain data for all columns
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 NULL NULL
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
##################################################
|
||||
ÑŠ1 ABC-áâ÷ DEF-ÂÃÄ
|
||||
ÑŠ2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary LINES STARTING BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES TERMINATED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
##################################################
|
||||
1 ABC-áâ÷ DEF-ÂÃÄÑŠ2 \N \NÑŠ##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'ÑŠ';
|
||||
Warnings:
|
||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄÑŠ2
|
||||
2 NULL NULL
|
||||
# Default (binary) charset:
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1;
|
||||
##################################################
|
||||
1 ABC-áâ÷ DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# latin1 charset (INTO OUTFILE warning is expected):
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' CHARACTER SET latin1 FROM t1;
|
||||
Warnings:
|
||||
Warning 1366 Incorrect string value: '\xE1\xE2\xF7' for column 'b' at row 1
|
||||
##################################################
|
||||
1 ABC-??? DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET latin1 ;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-??? DEF-ÂÃÄ
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# KOI8-R charset (INTO OUTFILE warning is expected):
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' CHARACTER SET koi8r FROM t1;
|
||||
Warnings:
|
||||
Warning 1366 Incorrect string value: '\xC2\xC3\xC4' for column 'c' at row 1
|
||||
##################################################
|
||||
1 ABC-áâ÷ DEF-???
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET koi8r;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-???
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
# UTF-8 charset:
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' CHARACTER SET utf8 FROM t1;
|
||||
##################################################
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 \N \N
|
||||
##################################################
|
||||
TRUNCATE t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET utf8;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
a b c
|
||||
1 ABC-Ð<>БВ DEF-ÂÃÄ
|
||||
2 NULL NULL
|
||||
SET NAMES default;
|
||||
DROP TABLE t1, t2;
|
||||
# End of 5.1 tests.
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @old_general_log= @@global.general_log;
|
||||
drop table if exists t1, t2;
|
||||
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
|
||||
ENGINE=MyISAM
|
||||
@ -1068,7 +1067,13 @@ partition by range (a)
|
||||
subpartition by hash(a)
|
||||
(partition p0 values less than (0),
|
||||
partition p1 values less than (1) (subpartition sp0));
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 5
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'subpartition sp0))' at line 5
|
||||
create table t1 (a int, b int)
|
||||
partition by list (a)
|
||||
subpartition by hash(a)
|
||||
(partition p0 values in (0),
|
||||
partition p1 values in (1) (subpartition sp0));
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'subpartition sp0))' at line 5
|
||||
create table t1 (a int)
|
||||
partition by hash (a)
|
||||
(partition p0 (subpartition sp0));
|
||||
@ -1621,17 +1626,6 @@ create table t (s1 int) engine=myisam partition by key (s1);
|
||||
create trigger t_ad after delete on t for each row insert into t values (old.s1);
|
||||
insert into t values (1);
|
||||
drop table t;
|
||||
USE mysql;
|
||||
TRUNCATE TABLE general_log;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
ALTER TABLE general_log ENGINE = MyISAM;
|
||||
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
|
||||
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
|
||||
ERROR HY000: Incorrect usage of PARTITION and log table
|
||||
ALTER TABLE general_log ENGINE = CSV;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
use test;
|
||||
create table t2 (b int);
|
||||
create table t1 (b int)
|
||||
PARTITION BY RANGE (t2.b) (
|
||||
@ -1991,5 +1985,23 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
|
||||
PARTITION BY HASH(id) PARTITIONS 2;
|
||||
DROP TABLE t1;
|
||||
SET SESSION SQL_MODE=DEFAULT;
|
||||
#
|
||||
# BUG#45816 - assertion failure with index containing double
|
||||
# column on partitioned table
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a INT DEFAULT NULL,
|
||||
b DOUBLE DEFAULT NULL,
|
||||
c INT DEFAULT NULL,
|
||||
KEY idx2(b,a)
|
||||
) PARTITION BY HASH(c) PARTITIONS 3;
|
||||
INSERT INTO t1 VALUES (6,8,9);
|
||||
INSERT INTO t1 VALUES (6,8,10);
|
||||
SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
SET @@global.general_log= @old_general_log;
|
||||
|
@ -5,11 +5,50 @@ partition by list (a)
|
||||
(partition p0 values in (null));
|
||||
ERROR HY000: Engine cannot be used in partitioned tables
|
||||
USE mysql;
|
||||
TRUNCATE TABLE general_log;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
ALTER TABLE general_log ENGINE = MyISAM;
|
||||
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
|
||||
(PARTITION p0 VALUES LESS THAN (733144),
|
||||
PARTITION p1 VALUES LESS THAN (3000000));
|
||||
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
|
||||
ERROR HY000: Incorrect usage of PARTITION and log table
|
||||
ALTER TABLE general_log ENGINE = CSV;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
use test;
|
||||
#
|
||||
# Bug#40281: partitioning the general log table crashes the server
|
||||
#
|
||||
# set up partitioned log, and switch to it
|
||||
USE mysql;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
CREATE TABLE gl_partitioned LIKE general_log;
|
||||
ALTER TABLE gl_partitioned ENGINE=myisam;
|
||||
ALTER TABLE gl_partitioned PARTITION BY HASH (thread_id) PARTITIONS 10;
|
||||
ALTER TABLE general_log RENAME TO gl_nonpartitioned;
|
||||
ALTER TABLE gl_partitioned RENAME TO general_log;
|
||||
SELECT @@global.log_output INTO @old_glo;
|
||||
SET GLOBAL log_output='table';
|
||||
SET GLOBAL general_log =1;
|
||||
# do some things to be logged to partitioned log, should fail
|
||||
USE /* 1 */ test;
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
USE mysql;
|
||||
SET GLOBAL general_log =0;
|
||||
ALTER TABLE general_log RENAME TO gl_partitioned;
|
||||
ALTER TABLE gl_nonpartitioned RENAME TO general_log;
|
||||
# show whether we actually logged anything (no) to general_log
|
||||
SELECT COUNT(argument) FROM gl_partitioned;
|
||||
COUNT(argument)
|
||||
0
|
||||
DROP TABLE gl_partitioned;
|
||||
SET GLOBAL log_output = @old_glo;
|
||||
SET GLOBAL general_log = 1;
|
||||
USE /* 2 */ test;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
End of 5.1 tests
|
||||
|
81
mysql-test/r/partition_not_embedded.result
Normal file
81
mysql-test/r/partition_not_embedded.result
Normal file
@ -0,0 +1,81 @@
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
# Bug#30102 test
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (6),
|
||||
PARTITION `p1....................` VALUES LESS THAN (9),
|
||||
PARTITION p2 VALUES LESS THAN MAXVALUE);
|
||||
# List of files in database `test`, all original t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
# Renaming to a file name where the first partition is 250 chars
|
||||
# and the second partition is 350 chars
|
||||
RENAME TABLE t1 TO `t2_new..............................................end`;
|
||||
Got one of the listed errors
|
||||
# List of files in database `test`, should not be any t2-files here
|
||||
# List of files in database `test`, should be all t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
10
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
# List of files in database `test`, should be all t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
# Renaming to a file name where the first partition is 156 chars
|
||||
# and the second partition is 256 chars
|
||||
RENAME TABLE t1 TO `t2_............................_end`;
|
||||
Got one of the listed errors
|
||||
# List of files in database `test`, should not be any t2-files here
|
||||
# List of files in database `test`, should be all t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
10
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
DROP TABLE t1;
|
||||
# Should not be any files left here
|
||||
# End of bug#30102 test.
|
66
mysql-test/r/partition_rename_longfilename.result
Normal file
66
mysql-test/r/partition_rename_longfilename.result
Normal file
@ -0,0 +1,66 @@
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (6),
|
||||
PARTITION `p1....................` VALUES LESS THAN (9),
|
||||
PARTITION p2 VALUES LESS THAN MAXVALUE);
|
||||
# List of files in database `test`, all original t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
# Renaming to a file name where the first partition is 155 chars
|
||||
# and the second partition is 255 chars
|
||||
RENAME TABLE t1 TO `t2_............................end`;
|
||||
# List of files in database `test`, should not be any t1-files here
|
||||
# List of files in database `test`, should be all t2-files here
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYD
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYI
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYD
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYI
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend.frm
|
||||
t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend.par
|
||||
SELECT * FROM `t2_............................end`;
|
||||
a
|
||||
1
|
||||
10
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
RENAME TABLE `t2_............................end` to t1;
|
||||
# List of files in database `test`, should be all t1-files here
|
||||
t1#P#p0.MYD
|
||||
t1#P#p0.MYI
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
|
||||
t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
|
||||
t1#P#p2.MYD
|
||||
t1#P#p2.MYI
|
||||
t1.frm
|
||||
t1.par
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
10
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
DROP TABLE t1;
|
||||
# Should not be any files left here
|
||||
# End of bug#30102 test.
|
@ -249,3 +249,25 @@ DROP PROCEDURE p1;
|
||||
DELETE FROM mysql.user WHERE User='mysqltest_1';
|
||||
FLUSH PRIVILEGES;
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
#
|
||||
# Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
|
||||
#
|
||||
SELECT GET_LOCK('Bug44521', 0);
|
||||
GET_LOCK('Bug44521', 0)
|
||||
1
|
||||
** Connection con1
|
||||
CREATE PROCEDURE p()
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
SELECT GET_LOCK('Bug44521', 100);
|
||||
SELECT 2;
|
||||
END$
|
||||
CALL p();;
|
||||
** Default connection
|
||||
SELECT RELEASE_LOCK('Bug44521');
|
||||
RELEASE_LOCK('Bug44521')
|
||||
1
|
||||
DROP PROCEDURE p;
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -4361,6 +4361,28 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45061: Incorrectly market field caused wrong result.
|
||||
#
|
||||
CREATE TABLE `C` (
|
||||
`int_nokey` int(11) NOT NULL,
|
||||
`int_key` int(11) NOT NULL,
|
||||
KEY `int_key` (`int_key`)
|
||||
);
|
||||
INSERT INTO `C` VALUES (9,9), (0,0), (8,6), (3,6), (7,6), (0,4),
|
||||
(1,7), (9,4), (0,8), (9,4), (0,7), (5,5), (0,0), (8,5), (8,7),
|
||||
(5,2), (1,8), (7,0), (0,9), (9,5);
|
||||
SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`);
|
||||
int_nokey int_key
|
||||
9 9
|
||||
0 0
|
||||
5 5
|
||||
0 0
|
||||
EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY C ALL NULL NULL NULL NULL 20 100.00 Using where
|
||||
DROP TABLE C;
|
||||
# End of test for bug#45061.
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
@ -35,4 +35,11 @@ CREATE DATABASE IF NOT EXISTS init_file;
|
||||
CREATE TABLE IF NOT EXISTS init_file.startup ( startdate DATETIME );
|
||||
INSERT INTO init_file.startup VALUES ( NOW() );
|
||||
|
||||
#
|
||||
# Bug#43587 "Putting event_scheduler=1 in init SQL file crashes mysqld"
|
||||
#
|
||||
|
||||
SET GLOBAL event_scheduler = 'ON';
|
||||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DISABLE DO SELECT 1;
|
||||
DROP EVENT ev1;
|
||||
SET GLOBAL event_scheduler = 'OFF';
|
||||
|
@ -1298,3 +1298,14 @@ show master status /* must show new binlog index after rotating */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 106
|
||||
drop table t3;
|
||||
#
|
||||
# Bug #45998: database crashes when running "create as select"
|
||||
#
|
||||
CREATE DATABASE test1;
|
||||
USE test1;
|
||||
DROP DATABASE test1;
|
||||
CREATE TABLE test.t1(a int);
|
||||
INSERT INTO test.t1 VALUES (1), (2);
|
||||
CREATE TABLE test.t2 SELECT * FROM test.t1;
|
||||
USE test;
|
||||
DROP TABLES t1, t2;
|
||||
|
@ -773,3 +773,14 @@ show master status /* must show new binlog index after rotating */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 106
|
||||
drop table t3;
|
||||
#
|
||||
# Bug #45998: database crashes when running "create as select"
|
||||
#
|
||||
CREATE DATABASE test1;
|
||||
USE test1;
|
||||
DROP DATABASE test1;
|
||||
CREATE TABLE test.t1(a int);
|
||||
INSERT INTO test.t1 VALUES (1), (2);
|
||||
CREATE TABLE test.t2 SELECT * FROM test.t1;
|
||||
USE test;
|
||||
DROP TABLES t1, t2;
|
||||
|
@ -28,3 +28,23 @@ UPDATE t1 SET b='4' WHERE a=1 LIMIT 1;
|
||||
UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE b42851;
|
||||
USE test;
|
||||
#
|
||||
# Bug#46265: Can not disable warning about unsafe statements for binary logging
|
||||
#
|
||||
SET @old_log_warnings = @@log_warnings;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
SET GLOBAL LOG_WARNINGS = 1;
|
||||
INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL log_warnings = @old_log_warnings;
|
||||
# Count the number of times the "Unsafe" message was printed
|
||||
# to the error log.
|
||||
Occurrences: 1
|
||||
|
@ -1 +1 @@
|
||||
--binlog-ignore-db=b42851
|
||||
--binlog-ignore-db=b42851 --log-error
|
||||
|
@ -56,6 +56,8 @@ SET SQL_LOG_BIN= 1;
|
||||
|
||||
-- echo ### FILTERED database => assertion: warnings ARE NOT shown
|
||||
|
||||
let $old_db= `SELECT DATABASE()`;
|
||||
|
||||
CREATE DATABASE b42851;
|
||||
USE b42851;
|
||||
|
||||
@ -71,3 +73,36 @@ DROP TABLE t1;
|
||||
|
||||
# clean up
|
||||
DROP DATABASE b42851;
|
||||
|
||||
eval USE $old_db;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46265: Can not disable warning about unsafe statements for binary logging
|
||||
--echo #
|
||||
|
||||
SET @old_log_warnings = @@log_warnings;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
|
||||
SET GLOBAL LOG_WARNINGS = 1;
|
||||
INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
|
||||
DROP TABLE t1;
|
||||
|
||||
SET GLOBAL log_warnings = @old_log_warnings;
|
||||
|
||||
let LOG_ERROR= `SELECT @@GLOBAL.log_error`;
|
||||
|
||||
--echo # Count the number of times the "Unsafe" message was printed
|
||||
--echo # to the error log.
|
||||
|
||||
perl;
|
||||
$log_error= $ENV{'LOG_ERROR'};
|
||||
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
|
||||
$count = () = grep(/Bug#46265/g,<FILE>);
|
||||
print "Occurrences: $count\n";
|
||||
close(FILE);
|
||||
EOF
|
||||
|
@ -764,7 +764,7 @@ f_char2 CHAR(20),
|
||||
f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart31 , SUBPARTITION subpart32 ))' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
@ -772,7 +772,7 @@ f_char2 CHAR(20),
|
||||
f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
|
||||
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
@ -781,8 +781,7 @@ f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
|
||||
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPA' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
|
@ -796,7 +796,7 @@ f_char2 CHAR(20),
|
||||
f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart31 , SUBPARTITION subpart32 ))' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
@ -804,7 +804,7 @@ f_char2 CHAR(20),
|
||||
f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
|
||||
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
@ -813,8 +813,7 @@ f_charbig VARCHAR(1000) )
|
||||
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
|
||||
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646)
|
||||
(SUBPARTITION subpart31 , SUBPA' at line 7
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
|
||||
CREATE TABLE t1 ( f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
|
@ -33,12 +33,10 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 2' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (2 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
@ -56,12 +54,10 @@ COMMIT;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 2' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (2 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
@ -79,12 +75,10 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 1' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (1 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
@ -100,17 +94,13 @@ COMMIT;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 1' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
source include/diff_master_slave.inc;
|
||||
source include/diff_master_slave.inc;
|
||||
########################################################################
|
||||
# Cleanup
|
||||
########################################################################
|
||||
|
@ -0,0 +1,40 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
|
||||
IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
|
||||
1
|
||||
SELECT GET_LOCK("debug_lock.before_get_UNIX_TIMESTAMP", 1000);
|
||||
GET_LOCK("debug_lock.before_get_UNIX_TIMESTAMP", 1000)
|
||||
1
|
||||
set global debug= 'd,debug_lock.before_get_UNIX_TIMESTAMP';
|
||||
stop slave;
|
||||
start slave;
|
||||
SELECT RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
|
||||
RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
|
||||
1
|
||||
Slave_IO_Errno= 2013
|
||||
SELECT IS_FREE_LOCK("debug_lock.before_get_SERVER_ID");
|
||||
IS_FREE_LOCK("debug_lock.before_get_SERVER_ID")
|
||||
1
|
||||
SELECT GET_LOCK("debug_lock.before_get_SERVER_ID", 1000);
|
||||
GET_LOCK("debug_lock.before_get_SERVER_ID", 1000)
|
||||
1
|
||||
set global debug= 'd,debug_lock.before_get_SERVER_ID';
|
||||
stop slave;
|
||||
start slave;
|
||||
SELECT RELEASE_LOCK("debug_lock.before_get_SERVER_ID");
|
||||
RELEASE_LOCK("debug_lock.before_get_SERVER_ID")
|
||||
1
|
||||
Slave_IO_Errno= 2013
|
||||
set global debug= '';
|
||||
reset master;
|
||||
include/stop_slave.inc
|
||||
change master to master_port=SLAVE_PORT;
|
||||
start slave;
|
||||
*** must be having the replicate-same-server-id IO thread error ***
|
||||
Slave_IO_Errno= 1593
|
||||
Slave_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).
|
@ -19,5 +19,50 @@ fn16456()
|
||||
timestamp
|
||||
set binlog_format=STATEMENT;
|
||||
select fn16456();
|
||||
ERROR HY000: Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events
|
||||
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
|
||||
drop function fn16456;
|
||||
set global log_bin_trust_function_creators=0;
|
||||
create function fn16456()
|
||||
returns int deterministic
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
set binlog_format=ROW;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
set binlog_format=STATEMENT;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
drop function fn16456;
|
||||
set global log_bin_trust_function_creators=0;
|
||||
create function fn16456()
|
||||
returns int no sql
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
set binlog_format=ROW;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
set binlog_format=STATEMENT;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
drop function fn16456;
|
||||
set global log_bin_trust_function_creators=0;
|
||||
create function fn16456()
|
||||
returns int reads sql data
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
set binlog_format=ROW;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
set binlog_format=STATEMENT;
|
||||
select fn16456();
|
||||
fn16456()
|
||||
timestamp
|
||||
drop function fn16456;
|
||||
|
@ -24,3 +24,48 @@ Slave_open_temp_tables 0
|
||||
[on master]
|
||||
DROP TABLE t1;
|
||||
[on slave]
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
|
||||
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ();
|
||||
CREATE TEMPORARY TABLE t1_tmp (i1 int);
|
||||
ALTER TABLE t1_tmp ADD COLUMN b INT;
|
||||
DELETE FROM t2;
|
||||
CREATE TEMPORARY TABLE t2_tmp (a int);
|
||||
ALTER TABLE t1_tmp ADD COLUMN c INT;
|
||||
### assertion: assert that there is one open temp table on slave
|
||||
SHOW STATUS LIKE 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
DROP TABLE t1_tmp, t2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE t2_tmp;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
### assertion: assert that slave has no temporary tables opened
|
||||
SHOW STATUS LIKE 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 0
|
||||
DROP TABLE t3, t1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
|
||||
slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
|
||||
slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
|
||||
slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ()
|
||||
slave-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int)
|
||||
slave-bin.000001 # Query # # use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT
|
||||
slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
|
||||
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1_tmp` /* generated by server */
|
||||
slave-bin.000001 # Query # # BEGIN
|
||||
slave-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
slave-bin.000001 # Query # # COMMIT
|
||||
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
|
||||
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
|
||||
slave-bin.000001 # Query # # use `test`; DROP TABLE t3, t1
|
||||
|
@ -125,13 +125,14 @@ while ($type)
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
let $diff_statement= SELECT * FROM t order by i;
|
||||
source include/diff_master_slave.inc;
|
||||
# Re-enable this after fixing BUG#46130
|
||||
#connection master;
|
||||
#let $diff_statement= SELECT * FROM t order by i;
|
||||
#source include/diff_master_slave.inc;
|
||||
|
||||
connection master;
|
||||
let $diff_statement= SELECT * FROM n order by d, f;
|
||||
source include/diff_master_slave.inc;
|
||||
#connection master;
|
||||
#let $diff_statement= SELECT * FROM n order by d, f;
|
||||
#source include/diff_master_slave.inc;
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Cleanup
|
||||
|
60
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Normal file
60
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Normal file
@ -0,0 +1,60 @@
|
||||
#
|
||||
# BUG#45214
|
||||
# This test verifies if the slave I/O tread tries to reconnect to
|
||||
# master when it tries to get the values of the UNIX_TIMESTAMP, SERVER_ID,
|
||||
# COLLATION_SERVER and TIME_ZONE from master under network disconnection.
|
||||
# The COLLATION_SERVER and TIME_ZONE are got only on master server version 4.
|
||||
# So they can't be verified by test case here.
|
||||
# Finish the following tests by calling its common test script:
|
||||
# extra/rpl_tests/rpl_get_master_version_and_clock.test.
|
||||
# And meanwhile this test checks that the slave I/O thread refuses to start if slave
|
||||
# and master have the same server id (because this is a useless setup,
|
||||
# and otherwise SHOW SLAVE STATUS shows progress but all queries are
|
||||
# ignored, which has caught our customers), unless
|
||||
# --replicate-same-server-id.
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
source include/have_debug.inc;
|
||||
#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
|
||||
connection slave;
|
||||
let $debug_saved= `select @@global.debug`;
|
||||
|
||||
let $debug_lock= "debug_lock.before_get_UNIX_TIMESTAMP";
|
||||
eval SELECT IS_FREE_LOCK($debug_lock);
|
||||
eval SELECT GET_LOCK($debug_lock, 1000);
|
||||
|
||||
set global debug= 'd,debug_lock.before_get_UNIX_TIMESTAMP';
|
||||
source extra/rpl_tests/rpl_get_master_version_and_clock.test;
|
||||
|
||||
#Test case 2: Try to get the value of the SERVER_ID from master under network disconnection
|
||||
connection slave;
|
||||
let $debug_lock= "debug_lock.before_get_SERVER_ID";
|
||||
eval SELECT IS_FREE_LOCK($debug_lock);
|
||||
eval SELECT GET_LOCK($debug_lock, 1000);
|
||||
|
||||
set global debug= 'd,debug_lock.before_get_SERVER_ID';
|
||||
source extra/rpl_tests/rpl_get_master_version_and_clock.test;
|
||||
|
||||
eval set global debug= '$debug_saved';
|
||||
|
||||
#Test case 3: This test checks that the slave I/O thread refuses to start
|
||||
#if slave and master have the same server id.
|
||||
connection slave;
|
||||
reset master;
|
||||
# replicate ourselves
|
||||
source include/stop_slave.inc;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval change master to master_port=$SLAVE_MYPORT;
|
||||
start slave;
|
||||
|
||||
let $slave_param= Last_IO_Errno;
|
||||
let $slave_param_value= 1593;
|
||||
source include/wait_for_slave_param.inc;
|
||||
--echo *** must be having the replicate-same-server-id IO thread error ***
|
||||
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
|
||||
let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
|
||||
echo Slave_IO_Errno= $last_io_errno;
|
||||
echo Slave_IO_Error= $last_io_error;
|
||||
|
||||
# End of tests
|
@ -1,6 +1,7 @@
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
|
||||
# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
|
||||
|
||||
# save status
|
||||
|
||||
@ -55,15 +56,131 @@ select fn16456();
|
||||
|
||||
set binlog_format=STATEMENT;
|
||||
|
||||
--error ER_BINLOG_ROW_RBR_TO_SBR
|
||||
--error ER_BINLOG_UNSAFE_ROUTINE
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# clean
|
||||
|
||||
drop function fn16456;
|
||||
|
||||
|
||||
|
||||
# success in definition with deterministic
|
||||
|
||||
set global log_bin_trust_function_creators=0;
|
||||
|
||||
delimiter |;
|
||||
create function fn16456()
|
||||
returns int deterministic
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
|
||||
|
||||
# allow funcall in RBR
|
||||
|
||||
set binlog_format=ROW;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# allow funcall in SBR
|
||||
|
||||
set binlog_format=STATEMENT;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# clean
|
||||
|
||||
drop function fn16456;
|
||||
|
||||
|
||||
# success in definition with NO SQL
|
||||
|
||||
set global log_bin_trust_function_creators=0;
|
||||
|
||||
delimiter |;
|
||||
create function fn16456()
|
||||
returns int no sql
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
|
||||
|
||||
# allow funcall in RBR
|
||||
|
||||
set binlog_format=ROW;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# allow funcall in SBR
|
||||
|
||||
set binlog_format=STATEMENT;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
# clean
|
||||
|
||||
drop function fn16456;
|
||||
|
||||
|
||||
|
||||
# success in definition with reads sql data
|
||||
|
||||
set global log_bin_trust_function_creators=0;
|
||||
|
||||
delimiter |;
|
||||
create function fn16456()
|
||||
returns int reads sql data
|
||||
begin
|
||||
return unix_timestamp();
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
|
||||
|
||||
# allow funcall in RBR
|
||||
|
||||
set binlog_format=ROW;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# allow funcall in SBR
|
||||
|
||||
set binlog_format=STATEMENT;
|
||||
|
||||
--replace_column 1 timestamp
|
||||
select fn16456();
|
||||
|
||||
|
||||
|
||||
# clean
|
||||
|
||||
drop function fn16456;
|
||||
|
||||
|
||||
|
||||
# restore status
|
||||
|
||||
drop function fn16456;
|
||||
|
||||
--disable_query_log
|
||||
eval set binlog_format=$oblf;
|
||||
eval set global log_bin_trust_function_creators=$otfc;
|
||||
|
@ -51,3 +51,98 @@ DROP TABLE t1;
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# BUG#43046: mixed mode switch to row format with temp table lead to wrong
|
||||
# result
|
||||
#
|
||||
# NOTES
|
||||
# =====
|
||||
#
|
||||
# 1. Temporary tables cannot be logged using the row-based
|
||||
# format. Thus, once row-based logging is used, all subsequent
|
||||
# statements using that table are unsafe, and we approximate this
|
||||
# condition by treating all statements made by that client as
|
||||
# unsafe until the client no longer holds any temporary tables.
|
||||
#
|
||||
# 2. Two different connections can use the same temporary table
|
||||
# name without conflicting with each other or with an
|
||||
# existing non-TEMPORARY table of the same name.
|
||||
#
|
||||
# DESCRIPTION
|
||||
# ===========
|
||||
#
|
||||
# The test is implemented as follows:
|
||||
# 1. create regular tables
|
||||
# 2. create a temporary table t1_tmp: should be logged as statement
|
||||
# 3. issue an alter table: should be logged as statement
|
||||
# 4. issue statement that forces switch to RBR
|
||||
# 5. create another temporary table t2_tmp: should not be logged
|
||||
# 6. issue alter table on t1_tmp: should not be logged
|
||||
# 7. drop t1_tmp and regular table on same statement: should log both in
|
||||
# statement format (but different statements)
|
||||
# 8. issue deterministic insert: logged as row (because t2_tmp still
|
||||
# exists).
|
||||
# 9. drop t2_tmp and issue deterministic statement: should log drop and
|
||||
# query in statement format (show switch back to STATEMENT format)
|
||||
# 10. in the end the slave should not have open temp tables.
|
||||
#
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
-- source include/master-slave-reset.inc
|
||||
-- connection master
|
||||
|
||||
# action: setup environment
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
|
||||
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ();
|
||||
|
||||
# assertion: assert that CREATE is logged as STATEMENT
|
||||
CREATE TEMPORARY TABLE t1_tmp (i1 int);
|
||||
|
||||
# assertion: assert that ALTER TABLE is logged as STATEMENT
|
||||
ALTER TABLE t1_tmp ADD COLUMN b INT;
|
||||
|
||||
# action: force switch to RBR
|
||||
DELETE FROM t2;
|
||||
|
||||
# assertion: assert that t2_tmp will not make into the binlog (RBR logging atm)
|
||||
CREATE TEMPORARY TABLE t2_tmp (a int);
|
||||
|
||||
# assertion: assert that ALTER TABLE on t1_tmp will not make into the binlog
|
||||
ALTER TABLE t1_tmp ADD COLUMN c INT;
|
||||
|
||||
-- echo ### assertion: assert that there is one open temp table on slave
|
||||
-- sync_slave_with_master
|
||||
SHOW STATUS LIKE 'Slave_open_temp_tables';
|
||||
|
||||
-- connection master
|
||||
|
||||
# assertion: assert that both drops are logged
|
||||
DROP TABLE t1_tmp, t2;
|
||||
|
||||
# assertion: assert that statement is logged as row (master still has one
|
||||
# opened temporary table - t2_tmp.
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
# assertion: assert that DROP TABLE *is* logged despite CREATE is not.
|
||||
DROP TEMPORARY TABLE t2_tmp;
|
||||
|
||||
# assertion: assert that statement is now logged as STMT (mixed mode switches
|
||||
# back to STATEMENT).
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- echo ### assertion: assert that slave has no temporary tables opened
|
||||
SHOW STATUS LIKE 'Slave_open_temp_tables';
|
||||
|
||||
-- connection master
|
||||
|
||||
# action: drop remaining tables
|
||||
DROP TABLE t3, t1;
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- source include/show_binlog_events.inc
|
||||
|
1
mysql-test/t/bug40113-master.opt
Normal file
1
mysql-test/t/bug40113-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb_lock_wait_timeout=1
|
46
mysql-test/t/bug40113.test
Normal file
46
mysql-test/t/bug40113.test
Normal file
@ -0,0 +1,46 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
||||
--echo # without error
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
||||
|
||||
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
BEGIN;
|
||||
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
|
||||
CONNECT (addconroot, localhost, root,,);
|
||||
CONNECTION addconroot;
|
||||
|
||||
BEGIN;
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
CONNECTION default;
|
||||
DISCONNECT addconroot;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
--echo End of 5.0 tests
|
@ -1539,5 +1539,29 @@ DROP TABLE t1;
|
||||
create table `me:i`(id int);
|
||||
drop table `me:i`;
|
||||
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Bug#45829 CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
|
||||
#
|
||||
|
||||
--echo
|
||||
--echo # --
|
||||
--echo # -- Bug#45829: CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
|
||||
--echo # --
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3;
|
||||
--enable_warnings
|
||||
--error ER_PARSE_ERROR
|
||||
create table t1 (a int) transactional=0;
|
||||
--error ER_PARSE_ERROR
|
||||
create table t2 (a int) page_checksum=1;
|
||||
--error ER_PARSE_ERROR
|
||||
create table t3 (a int) row_format=page;
|
||||
--echo
|
||||
--echo # -- End of Bug#45829
|
||||
|
||||
--echo
|
||||
--echo End of 5.1 tests
|
||||
|
@ -56,3 +56,54 @@ select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
--echo Start of 5.4 tests
|
||||
|
||||
--echo #
|
||||
--echo # WL#3997 New euckr characters
|
||||
--echo #
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a varchar(10) character set euckr);
|
||||
INSERT INTO t1 VALUES (0xA2E6), (0xA2E7);
|
||||
SELECT hex(a), hex(@utf8:=convert(a using utf8)), hex(convert(@utf8 using euckr)) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # WL#3332 Korean Enhancements
|
||||
--echo # euckr valid codes are now [81..FE][41..5A,61..7A,81..FE]
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a binary(1), key(a));
|
||||
--disable_query_log
|
||||
let $1=255;
|
||||
while($1)
|
||||
{
|
||||
eval INSERT INTO t1 VALUES (unhex(hex($1)));
|
||||
dec $1;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t2 (s VARCHAR(4), a VARCHAR(1) CHARACTER SET euckr);
|
||||
--disable_warnings
|
||||
INSERT INTO t2
|
||||
SELECT hex(concat(t11.a, t12.a)), concat(t11.a, t12.a)
|
||||
FROM t1 t11, t1 t12
|
||||
WHERE t11.a >= 0x81 AND t11.a <= 0xFE
|
||||
AND t12.a >= 0x41 AND t12.a <= 0xFE
|
||||
ORDER BY t11.a, t12.a;
|
||||
--enable_warnings
|
||||
SELECT s as bad_code FROM t2 WHERE a='' ORDER BY s;
|
||||
DELETE FROM t2 WHERE a='';
|
||||
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
|
||||
--disable_warnings
|
||||
UPDATE t2 SET u=a, a2=u;
|
||||
--enable_warnings
|
||||
SELECT s as unassigned_code FROM t2 WHERE u='?';
|
||||
DELETE FROM t2 WHERE u='?';
|
||||
# Make sure there are no euckr->utf8->euckr roundtrip problems
|
||||
SELECT count(*) as roundtrip_problem_chars FROM t2 WHERE hex(a) <> hex(a2);
|
||||
SELECT s, hex(a), hex(u), hex(a2) FROM t2 ORDER BY s;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo End of 5.4 tests
|
||||
|
@ -471,3 +471,16 @@ CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
|
||||
INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST('+awrd bwrd* +cwrd*' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#37740 Server crashes on execute statement with full text search and match against
|
||||
#
|
||||
CREATE TABLE t1 (col text, FULLTEXT KEY full_text (col));
|
||||
|
||||
PREPARE s FROM
|
||||
"SELECT MATCH (col) AGAINST('findme') FROM t1 ORDER BY MATCH (col) AGAINST('findme')"
|
||||
;
|
||||
|
||||
EXECUTE s;
|
||||
DEALLOCATE PREPARE s;
|
||||
DROP TABLE t1;
|
||||
|
@ -36,9 +36,15 @@ rollback;
|
||||
connection b;
|
||||
reap;
|
||||
rollback;
|
||||
|
||||
# Cleanup
|
||||
connection a;
|
||||
disconnect a;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection b;
|
||||
disconnect b;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
disconnect a;
|
||||
disconnect b;
|
||||
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
|
||||
|
@ -394,3 +394,24 @@ check table t2 extended;
|
||||
drop table t1,t2;
|
||||
--echo ##################################################################
|
||||
|
||||
--echo #
|
||||
--echo # Bug #46075: Assertion failed: 0, file .\protocol.cc, line 416
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
# To force MyISAM temp. table in the following INSERT ... SELECT.
|
||||
SET max_heap_table_size = 16384;
|
||||
# To overflow the temp. table.
|
||||
SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size;
|
||||
SET GLOBAL myisam_data_pointer_size = 2;
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
|
||||
--error ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL
|
||||
INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
|
||||
|
||||
# Cleanup
|
||||
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1515,6 +1515,49 @@ insert into m1 (col1) values (1);
|
||||
|
||||
drop table m1, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#45800 crash when replacing into a merge table and there is a duplicate
|
||||
--echo #
|
||||
|
||||
--echo # Replace duplicate value in child table when merge table doesn't have key
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE m1 (c1 INT NOT NULL) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
--echo # insert the duplicate value into the merge table
|
||||
REPLACE INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
DROP TABLE m1, t1;
|
||||
|
||||
--echo # Insert... on duplicate key update (with duplicate values in the table)
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE m1 (c1 INT NOT NULL) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (666);
|
||||
SELECT * FROM m1;
|
||||
--echo # insert the duplicate value into the merge table
|
||||
INSERT INTO m1 VALUES (666) ON DUPLICATE KEY UPDATE c1=c1+1;
|
||||
SELECT * FROM m1;
|
||||
DROP TABLE m1, t1;
|
||||
|
||||
--echo # Insert duplicate value on MERGE table, where, MERGE has a key but MyISAM has more keys
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE (c1), UNIQUE (c2));
|
||||
CREATE TABLE m1 (c1 INT, c2 INT, UNIQUE (c1)) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
INSERT INTO m1 VALUES (1,2);
|
||||
--echo # insert the duplicate value into the merge table
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO m1 VALUES (3,2);
|
||||
DROP TABLE m1,t1;
|
||||
|
||||
--echo # Try to define MERGE and MyISAM with keys on different columns
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE (c1));
|
||||
CREATE TABLE m1 (c1 INT, c2 INT, UNIQUE (c2)) ENGINE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1);
|
||||
--echo # Try accessing the merge table for inserts (error occurs)
|
||||
--error ER_WRONG_MRG_TABLE
|
||||
INSERT INTO m1 VALUES (1,2);
|
||||
--error ER_WRONG_MRG_TABLE
|
||||
INSERT INTO m1 VALUES (1,4);
|
||||
DROP TABLE m1,t1;
|
||||
|
||||
#
|
||||
#Bug #44040 MySQL allows creating a MERGE table upon VIEWs but crashes
|
||||
#when using it
|
||||
@ -1555,4 +1598,28 @@ SELECT * FROM m1;
|
||||
DROP TABLE m1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug45781 infinite hang/crash in "opening tables" after handler tries to
|
||||
--echo # open merge table
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS m1,t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a int)engine=myisam;
|
||||
CREATE TABLE t2(a int)engine=myisam;
|
||||
CREATE TABLE t3(a int)engine=myisam;
|
||||
CREATE TABLE t4(a int)engine=myisam;
|
||||
CREATE TABLE t5(a int)engine=myisam;
|
||||
CREATE TABLE t6(a int)engine=myisam;
|
||||
CREATE TABLE t7(a int)engine=myisam;
|
||||
CREATE TABLE m1(a int)engine=merge union=(t1,t2,t3,t4,t5,t6,t7);
|
||||
SELECT 1 FROM m1;
|
||||
--error ER_ILLEGAL_HA
|
||||
HANDLER m1 OPEN;
|
||||
DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT 1 FROM m1; # Should not hang!
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -387,5 +387,19 @@ drop tables t1, t2;
|
||||
#
|
||||
--exec $MYSQL --html test -e "select '< & >' as '<'"
|
||||
|
||||
#
|
||||
# Bug #27884: mysql client + null byte
|
||||
#
|
||||
create table t1 (a char(5));
|
||||
insert into t1 values ('\0b\0');
|
||||
--exec $MYSQL test -e "select a from t1"
|
||||
--exec $MYSQL -r test -e "select a from t1"
|
||||
--exec $MYSQL -s test -e "select a from t1"
|
||||
--exec $MYSQL --table test -e "select a from t1"
|
||||
--exec $MYSQL --vertical test -e "select a from t1"
|
||||
--exec $MYSQL --html test -e "select a from t1"
|
||||
--exec $MYSQL --xml test -e "select a from t1"
|
||||
drop table t1;
|
||||
|
||||
--echo
|
||||
--echo End of tests
|
||||
|
@ -7,6 +7,26 @@
|
||||
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Hack:
|
||||
#
|
||||
# If running with Valgrind ($VALGRIND_TEST <> 0) then the resource
|
||||
# consumption (CPU) for upgrading a large log table will be intense.
|
||||
# Therefore, truncate the log table in advance and issue a statement
|
||||
# that should be logged.
|
||||
#
|
||||
if (`SELECT $VALGRIND_TEST`)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--disable_abort_on_error
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
SELECT 1;
|
||||
--enable_abort_on_error
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
}
|
||||
|
||||
#
|
||||
# Basic test that we can run mysql_upgrde and that it finds the
|
||||
# expected binaries it uses.
|
||||
|
@ -193,5 +193,22 @@ DROP DATABASE `a@b`;
|
||||
|
||||
USE test;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #31821: --all-in-1 and --fix-table-names don't work together
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists `#mysql50#t1-1`;
|
||||
--enable_warnings
|
||||
|
||||
create table `#mysql50#t1-1` (a int);
|
||||
--exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test
|
||||
show tables like 't1-1';
|
||||
drop table `t1-1`;
|
||||
|
||||
create table `#mysql50#t1-1` (a int);
|
||||
--exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1"
|
||||
show tables like 't1-1';
|
||||
drop table `t1-1`;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -1496,8 +1496,11 @@ INSERT INTO t1 VALUES (1), (2);
|
||||
--exec $MYSQL_DUMP --tab=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test
|
||||
|
||||
@ -1947,8 +1950,50 @@ DROP DATABASE mysqldump_test_db;
|
||||
--echo # -- End of test case for Bug#32538.
|
||||
--echo
|
||||
|
||||
# We reset concurrent_inserts value to whatever it was at the start of the test
|
||||
# This line must be executed _after_ all test cases.
|
||||
--echo #
|
||||
--echo # Bug#37377 Incorrect DROP TABLE statement in dump of a VIEW using --tab
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
create view v1 as select a from t1;
|
||||
|
||||
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test t1 v1
|
||||
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/v1.sql
|
||||
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#28071 mysqlimport does not quote or escape table name
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists `load`;
|
||||
--enable_warnings
|
||||
create table `load` (a varchar(255));
|
||||
|
||||
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/tmp/load.txt
|
||||
|
||||
--exec $MYSQL_IMPORT --ignore test $MYSQLTEST_VARDIR/tmp/load.txt
|
||||
|
||||
select count(*) from `load`;
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/load.txt
|
||||
|
||||
drop table `load`;
|
||||
|
||||
# We reset concurrent_inserts value to whatever it was at the start of the
|
||||
# test This line must be executed _after_ all test cases.
|
||||
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
|
||||
|
||||
|
||||
@ -2007,6 +2052,88 @@ DROP TABLE IF EXISTS t1;
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo #
|
||||
--echo # Bug #30946: mysqldump silently ignores --default-character-set
|
||||
--echo # when used with --tab
|
||||
--echo #
|
||||
--echo # Also see outfile_loaddata.test
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a INT, b CHAR(10) CHARSET koi8r, c CHAR(10) CHARSET latin1);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/t1.txt
|
||||
|
||||
|
||||
--echo # error on multi-character ENCLOSED/ESCAPED BY
|
||||
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-enclosed-by='12345' test t1
|
||||
--remove_file $file
|
||||
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-escaped-by='12345' test t1
|
||||
--remove_file $file
|
||||
|
||||
--echo # default '--default-charset' (binary):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # utf8:
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET utf8
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # latin1 (data corruption is expected):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # koi8r (data corruption is expected):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET koi8r
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
SET NAMES default;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
###########################################################################
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
@ -1361,3 +1361,44 @@ DROP TABLE t1;
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Bug#46454: MySQL wrong index optimisation leads to incorrect result & crashes
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b INT NOT NULL,
|
||||
c char(100),
|
||||
KEY (b, c),
|
||||
KEY (b, a, c)
|
||||
)
|
||||
DEFAULT CHARSET = utf8;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(1, 1, 1),
|
||||
(2, 2, 2),
|
||||
(3, 3, 3),
|
||||
(4, 4, 4),
|
||||
(5, 5, 5),
|
||||
(6, 6, 6),
|
||||
(7, 7, 7),
|
||||
(8, 8, 8),
|
||||
(9, 9, 9);
|
||||
|
||||
INSERT INTO t1 SELECT a + 10, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 20, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 40, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 80, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 160, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 320, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 640, b, c FROM t1;
|
||||
INSERT INTO t1 SELECT a + 1280, b, c FROM t1 LIMIT 80;
|
||||
|
||||
EXPLAIN
|
||||
SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9;
|
||||
SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9;
|
||||
|
||||
EXPLAIN
|
||||
SELECT DISTINCT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 0, 9;
|
||||
SELECT DISTINCT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 0, 9;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@ -111,3 +111,146 @@ SELECT HEX(c1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 5.0 tests.
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo #
|
||||
--echo # Bug #30946: mysqldump silently ignores --default-character-set
|
||||
--echo # when used with --tab
|
||||
--echo #
|
||||
--echo # Also see mysqldump.test
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a INT, b CHAR(10) CHARSET koi8r, c CHAR(10) CHARSET latin1);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/t1.txt
|
||||
|
||||
|
||||
--echo # Error on multi-character ENCLOSED/ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ENCLOSED BY '12345'
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ESCAPED BY '12345'
|
||||
--remove_file $file
|
||||
|
||||
|
||||
--echo # "Not implemented" warning on multibyte ENCLOSED/ESCAPED BY character,
|
||||
--echo # LOAD DATA rises error or has unpredictable result -- to be fixed later
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ENCLOSED BY 'ъ'
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083 # backward compatibility
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ENCLOSED BY 'ъ'
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ESCAPED BY 'ъ'
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083 # backward compatibility
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ESCAPED BY 'ъ'
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS TERMINATED BY 'ъ'
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ъ'
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' LINES STARTING BY 'ъ'
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary LINES STARTING BY 'ъ'
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' LINES TERMINATED BY 'ъ'
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'ъ'
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--echo # Default (binary) charset:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$file' FROM t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # latin1 charset (INTO OUTFILE warning is expected):
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET latin1 FROM t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # KOI8-R charset (INTO OUTFILE warning is expected):
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET koi8r FROM t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET koi8r
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
--echo # UTF-8 charset:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET utf8 FROM t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
TRUNCATE t2;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET utf8
|
||||
--remove_file $file
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
|
||||
SET NAMES default;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
###########################################################################
|
||||
--echo # End of 5.1 tests.
|
||||
|
@ -10,8 +10,6 @@
|
||||
#
|
||||
--source include/have_partition.inc
|
||||
|
||||
SET @old_general_log= @@global.general_log;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
@ -1019,6 +1017,17 @@ subpartition by hash(a)
|
||||
(partition p0 values less than (0),
|
||||
partition p1 values less than (1) (subpartition sp0));
|
||||
|
||||
#
|
||||
# Bug 46354 Crash with subpartition
|
||||
#
|
||||
--error ER_PARSE_ERROR
|
||||
create table t1 (a int, b int)
|
||||
partition by list (a)
|
||||
subpartition by hash(a)
|
||||
(partition p0 values in (0),
|
||||
partition p1 values in (1) (subpartition sp0));
|
||||
|
||||
|
||||
#
|
||||
# BUG 15961 No error when subpartition defined without subpartition by clause
|
||||
#
|
||||
@ -1640,23 +1649,6 @@ create trigger t_ad after delete on t for each row insert into t values (old.s1)
|
||||
insert into t values (1);
|
||||
drop table t;
|
||||
|
||||
#
|
||||
# Bug #27816: Log tables ran with partitions crashes the server when logging
|
||||
# is enabled.
|
||||
#
|
||||
|
||||
USE mysql;
|
||||
TRUNCATE TABLE general_log;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
ALTER TABLE general_log ENGINE = MyISAM;
|
||||
--error ER_WRONG_USAGE
|
||||
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
|
||||
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
|
||||
ALTER TABLE general_log ENGINE = CSV;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
use test;
|
||||
|
||||
#
|
||||
# Bug #27084 partitioning by list seems failing when using case
|
||||
# BUG #18198: Case no longer supported, test case removed
|
||||
@ -1987,6 +1979,23 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
|
||||
DROP TABLE t1;
|
||||
SET SESSION SQL_MODE=DEFAULT;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
SET @@global.general_log= @old_general_log;
|
||||
--echo #
|
||||
--echo # BUG#45816 - assertion failure with index containing double
|
||||
--echo # column on partitioned table
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a INT DEFAULT NULL,
|
||||
b DOUBLE DEFAULT NULL,
|
||||
c INT DEFAULT NULL,
|
||||
KEY idx2(b,a)
|
||||
) PARTITION BY HASH(c) PARTITIONS 3;
|
||||
|
||||
INSERT INTO t1 VALUES (6,8,9);
|
||||
INSERT INTO t1 VALUES (6,8,10);
|
||||
|
||||
SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
|
||||
|
||||
DROP TABLE t1;
|
||||
--echo End of 5.1 tests
|
||||
|
@ -24,15 +24,68 @@ partition by list (a)
|
||||
(partition p0 values in (null));
|
||||
|
||||
#
|
||||
# Bug#27816: Log tables ran with partitions crashes the server when logging
|
||||
# Bug #27816: Log tables ran with partitions crashes the server when logging
|
||||
# is enabled.
|
||||
#
|
||||
|
||||
USE mysql;
|
||||
TRUNCATE TABLE general_log;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
ALTER TABLE general_log ENGINE = MyISAM;
|
||||
--error ER_WRONG_USAGE
|
||||
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
|
||||
(PARTITION p0 VALUES LESS THAN (733144),
|
||||
PARTITION p1 VALUES LESS THAN (3000000));
|
||||
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
|
||||
ALTER TABLE general_log ENGINE = CSV;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
use test;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#40281: partitioning the general log table crashes the server
|
||||
--echo #
|
||||
|
||||
--echo # set up partitioned log, and switch to it
|
||||
|
||||
USE mysql;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET GLOBAL general_log = 0;
|
||||
CREATE TABLE gl_partitioned LIKE general_log;
|
||||
ALTER TABLE gl_partitioned ENGINE=myisam;
|
||||
ALTER TABLE gl_partitioned PARTITION BY HASH (thread_id) PARTITIONS 10;
|
||||
ALTER TABLE general_log RENAME TO gl_nonpartitioned;
|
||||
ALTER TABLE gl_partitioned RENAME TO general_log;
|
||||
|
||||
SELECT @@global.log_output INTO @old_glo;
|
||||
SET GLOBAL log_output='table';
|
||||
SET GLOBAL general_log =1;
|
||||
|
||||
--echo # do some things to be logged to partitioned log, should fail
|
||||
USE /* 1 */ test;
|
||||
|
||||
CREATE TABLE t1 (i INT);
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
disconnect con1;
|
||||
|
||||
connection default;
|
||||
USE mysql;
|
||||
SET GLOBAL general_log =0;
|
||||
ALTER TABLE general_log RENAME TO gl_partitioned;
|
||||
ALTER TABLE gl_nonpartitioned RENAME TO general_log;
|
||||
|
||||
--echo # show whether we actually logged anything (no) to general_log
|
||||
SELECT COUNT(argument) FROM gl_partitioned;
|
||||
|
||||
DROP TABLE gl_partitioned;
|
||||
|
||||
SET GLOBAL log_output = @old_glo;
|
||||
SET GLOBAL general_log = 1;
|
||||
|
||||
USE /* 2 */ test;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
53
mysql-test/t/partition_not_embedded.test
Normal file
53
mysql-test/t/partition_not_embedded.test
Normal file
@ -0,0 +1,53 @@
|
||||
-- source include/have_partition.inc
|
||||
-- source include/not_embedded.inc
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
|
||||
#
|
||||
# Bug#30102: rename table does corrupt tables with partition files on failure
|
||||
#
|
||||
--echo # Bug#30102 test
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (6),
|
||||
PARTITION `p1....................` VALUES LESS THAN (9),
|
||||
PARTITION p2 VALUES LESS THAN MAXVALUE);
|
||||
# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
|
||||
# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
|
||||
--echo # List of files in database `test`, all original t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
--echo # Renaming to a file name where the first partition is 250 chars
|
||||
--echo # and the second partition is 350 chars
|
||||
# 7,7 avoids the error message, which is not deterministic.
|
||||
--error 7,7
|
||||
RENAME TABLE t1 TO `t2_new..............................................end`;
|
||||
# 1234567890123456789012345678901234567890123456
|
||||
--echo # List of files in database `test`, should not be any t2-files here
|
||||
--list_files $MYSQLD_DATADIR/test t2*
|
||||
--echo # List of files in database `test`, should be all t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
--echo # List of files in database `test`, should be all t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--echo # Renaming to a file name where the first partition is 156 chars
|
||||
--echo # and the second partition is 256 chars
|
||||
# 7,7 avoids the error message, which is not deterministic.
|
||||
--error 7,7
|
||||
RENAME TABLE t1 TO `t2_............................_end`;
|
||||
# 1234567890123456789012345678
|
||||
# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156
|
||||
--echo # List of files in database `test`, should not be any t2-files here
|
||||
--list_files $MYSQLD_DATADIR/test t2*
|
||||
--echo # List of files in database `test`, should be all t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo # Should not be any files left here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--list_files $MYSQLD_DATADIR/test t2*
|
||||
--echo # End of bug#30102 test.
|
50
mysql-test/t/partition_rename_longfilename.test
Normal file
50
mysql-test/t/partition_rename_longfilename.test
Normal file
@ -0,0 +1,50 @@
|
||||
-- source include/not_windows.inc
|
||||
-- source include/have_partition.inc
|
||||
-- source include/not_embedded.inc
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
|
||||
#
|
||||
# Bug#30102: rename table does corrupt tables with partition files on failure
|
||||
# This test case renames the table such that the partition file name
|
||||
# is 255 chars long. Due the restriction of 260 char path name (including drive label)
|
||||
# this will fail in windows.
|
||||
# Other tests related to this bug can be found in partition_not_embedded.test
|
||||
#
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (6),
|
||||
PARTITION `p1....................` VALUES LESS THAN (9),
|
||||
PARTITION p2 VALUES LESS THAN MAXVALUE);
|
||||
# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
|
||||
# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
|
||||
--echo # List of files in database `test`, all original t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
--echo # Renaming to a file name where the first partition is 155 chars
|
||||
--echo # and the second partition is 255 chars
|
||||
RENAME TABLE t1 TO `t2_............................end`;
|
||||
# 1234567890123456789012345678
|
||||
# t2_ + end
|
||||
# .MY[ID] or .frm
|
||||
# #P#p[012]
|
||||
# 28 * @002e
|
||||
# 6 + 4 + 5 + 28 * 5 = 155
|
||||
--echo # List of files in database `test`, should not be any t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--echo # List of files in database `test`, should be all t2-files here
|
||||
--list_files $MYSQLD_DATADIR/test t2*
|
||||
--sorted_result
|
||||
SELECT * FROM `t2_............................end`;
|
||||
RENAME TABLE `t2_............................end` to t1;
|
||||
--echo # List of files in database `test`, should be all t1-files here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo # Should not be any files left here
|
||||
--list_files $MYSQLD_DATADIR/test t1*
|
||||
--list_files $MYSQLD_DATADIR/test t2*
|
||||
--echo # End of bug#30102 test.
|
@ -380,3 +380,39 @@ set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
# Wait till all disconnects are completed
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
|
||||
--echo #
|
||||
SELECT GET_LOCK('Bug44521', 0);
|
||||
--connect (con1,localhost,root,,)
|
||||
--echo ** Connection con1
|
||||
delimiter $;
|
||||
CREATE PROCEDURE p()
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
SELECT GET_LOCK('Bug44521', 100);
|
||||
SELECT 2;
|
||||
END$
|
||||
delimiter ;$
|
||||
--send CALL p();
|
||||
--connection default
|
||||
--echo ** Default connection
|
||||
let $wait_condition=
|
||||
SELECT count(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "User lock" AND info = "SELECT GET_LOCK('Bug44521', 100)";
|
||||
--source include/wait_condition.inc
|
||||
let $conid =
|
||||
`SELECT id FROM information_schema.processlist
|
||||
WHERE state = "User lock" AND info = "SELECT GET_LOCK('Bug44521', 100)"`;
|
||||
dirty_close con1;
|
||||
SELECT RELEASE_LOCK('Bug44521');
|
||||
let $wait_condition=
|
||||
SELECT count(*) = 0 FROM information_schema.processlist
|
||||
WHERE id = $conid;
|
||||
--source include/wait_condition.inc
|
||||
DROP PROCEDURE p;
|
||||
|
||||
--echo # ------------------------------------------------------------------
|
||||
--echo # -- End of 5.1 tests
|
||||
--echo # ------------------------------------------------------------------
|
||||
|
@ -3315,6 +3315,27 @@ EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 GROUP BY a);
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 WHERE a > 3 GROUP BY a);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#45061: Incorrectly market field caused wrong result.
|
||||
--echo #
|
||||
CREATE TABLE `C` (
|
||||
`int_nokey` int(11) NOT NULL,
|
||||
`int_key` int(11) NOT NULL,
|
||||
KEY `int_key` (`int_key`)
|
||||
);
|
||||
|
||||
INSERT INTO `C` VALUES (9,9), (0,0), (8,6), (3,6), (7,6), (0,4),
|
||||
(1,7), (9,4), (0,8), (9,4), (0,7), (5,5), (0,0), (8,5), (8,7),
|
||||
(5,2), (1,8), (7,0), (0,9), (9,5);
|
||||
|
||||
--disable_warnings
|
||||
SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`);
|
||||
EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`);
|
||||
--enable_warnings
|
||||
|
||||
DROP TABLE C;
|
||||
--echo # End of test for bug#45061.
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
@ -517,3 +517,111 @@
|
||||
fun:dlopen*
|
||||
}
|
||||
|
||||
#
|
||||
# BUG#45630
|
||||
# Suppress valgrind failures within nptl_pthread_exit_hack_handler on Ubuntu 9.04, x86 (but not amd64)
|
||||
#
|
||||
|
||||
{
|
||||
Mem loss within nptl_pthread_exit_hack_handler 1
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/libc-*.so
|
||||
obj:*/ld-*.so
|
||||
fun:__libc_dlopen_mode
|
||||
fun:pthread_cancel_init
|
||||
fun:_Unwind_ForcedUnwind
|
||||
fun:__pthread_unwind
|
||||
fun:pthread_exit
|
||||
fun:nptl_pthread_exit_hack_handler
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
|
||||
{
|
||||
Mem loss within nptl_pthread_exit_hack_handler 2
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/libc-*.so
|
||||
obj:*/ld-*.so
|
||||
fun:__libc_dlopen_mode
|
||||
fun:pthread_cancel_init
|
||||
fun:_Unwind_ForcedUnwind
|
||||
fun:__pthread_unwind
|
||||
fun:pthread_exit
|
||||
fun:nptl_pthread_exit_hack_handler
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
|
||||
{
|
||||
Mem loss within nptl_pthread_exit_hack_handler 3
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/libc-*.so
|
||||
obj:*/ld-*.so
|
||||
fun:__libc_dlopen_mode
|
||||
fun:pthread_cancel_init
|
||||
fun:_Unwind_ForcedUnwind
|
||||
fun:__pthread_unwind
|
||||
fun:pthread_exit
|
||||
fun:nptl_pthread_exit_hack_handler
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
|
||||
{
|
||||
Mem loss within nptl_pthread_exit_hack_handler 4
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/libc-*.so
|
||||
obj:*/ld-*.so
|
||||
fun:__libc_dlopen_mode
|
||||
fun:pthread_cancel_init
|
||||
fun:_Unwind_ForcedUnwind
|
||||
fun:__pthread_unwind
|
||||
fun:pthread_exit
|
||||
fun:nptl_pthread_exit_hack_handler
|
||||
fun:start_thread
|
||||
}
|
||||
|
||||
{
|
||||
Mem loss within nptl_pthread_exit_hack_handler 5
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/ld-*.so
|
||||
obj:*/libc-*.so
|
||||
obj:*/ld-*.so
|
||||
fun:__libc_dlopen_mode
|
||||
fun:pthread_cancel_init
|
||||
fun:_Unwind_ForcedUnwind
|
||||
fun:__pthread_unwind
|
||||
fun:pthread_exit
|
||||
fun:nptl_pthread_exit_hack_handler
|
||||
fun:start_thread
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ libmysys_a_LIBADD = @THREAD_LOBJECTS@
|
||||
# test_charset_DEPENDENCIES= $(LIBRARIES)
|
||||
# charset2html_DEPENDENCIES= $(LIBRARIES)
|
||||
DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
|
||||
-DDEFAULT_HOME_ENV=MYSQL_HOME \
|
||||
|
@ -32,11 +32,11 @@
|
||||
DESCRIPTION
|
||||
init_dynamic_array() initiates array and allocate space for
|
||||
init_alloc eilements.
|
||||
Array is usable even if space allocation failed.
|
||||
Array is usable even if space allocation failed, hence, the
|
||||
function never returns TRUE.
|
||||
Static buffers must begin immediately after the array structure.
|
||||
|
||||
RETURN VALUE
|
||||
TRUE my_malloc_ci() failed
|
||||
FALSE Ok
|
||||
*/
|
||||
|
||||
@ -63,12 +63,12 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
|
||||
array->size_of_element=element_size;
|
||||
if ((array->buffer= init_buffer))
|
||||
DBUG_RETURN(FALSE);
|
||||
if (!(array->buffer=(uchar*) my_malloc_ci(element_size*init_alloc,
|
||||
MYF(MY_WME))))
|
||||
{
|
||||
/*
|
||||
Since the dynamic array is usable even if allocation fails here malloc
|
||||
should not throw an error
|
||||
*/
|
||||
if (!(array->buffer= (char*) my_malloc_ci(element_size*init_alloc, MYF(0))))
|
||||
array->max_element=0;
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ static const char *handler_error_messages[]=
|
||||
"The event could not be processed no other hanlder error happened",
|
||||
"Got a fatal error during initialzaction of handler",
|
||||
"File to short; Expected more data in file",
|
||||
"Read page with wrong checksum"
|
||||
"Read page with wrong checksum",
|
||||
"Too many active concurrent transactions"
|
||||
};
|
||||
|
||||
|
@ -56,6 +56,12 @@ SOURCE=`pwd`
|
||||
CP="cp -p"
|
||||
MV="mv"
|
||||
|
||||
# There are platforms, notably OS X on Intel (x86 + x86_64),
|
||||
# for which "uname" does not provide sufficient information.
|
||||
# The value of CFLAGS as used during compilation is the most exact info
|
||||
# we can get - after all, we care about _what_ we built, not _where_ we did it.
|
||||
cflags="@CFLAGS@"
|
||||
|
||||
STRIP=1 # Option ignored
|
||||
SILENT=0
|
||||
PLATFORM=""
|
||||
@ -104,7 +110,50 @@ if [ x"$PLATFORM" = x"" ] ; then
|
||||
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
|
||||
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
|
||||
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
|
||||
fi
|
||||
|
||||
# Get the "machine", which really is the CPU architecture (including the size).
|
||||
# The precedence is:
|
||||
# 1) use an explicit argument, if given;
|
||||
# 2) use platform-specific fixes, if there are any (see bug#37808);
|
||||
# 3) stay with the default (determined during "configure", using predefined macros).
|
||||
|
||||
if [ x"$MACHINE" != x"" ] ; then
|
||||
machine=$MACHINE
|
||||
else
|
||||
case $system in
|
||||
osx* )
|
||||
# Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty!
|
||||
cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'`
|
||||
case "$cflag_arch" in
|
||||
i386 ) case $system in
|
||||
osx10.4 ) machine=i686 ;; # Used a different naming
|
||||
* ) machine=x86 ;;
|
||||
esac ;;
|
||||
x86_64 ) machine=x86_64 ;;
|
||||
ppc ) ;; # No treatment needed with PPC
|
||||
ppc64 ) ;;
|
||||
* ) # No matching compiler flag? "--platform" is needed
|
||||
if [ x"$PLATFORM" != x"" ] ; then
|
||||
: # See below: "$PLATFORM" will take precedence anyway
|
||||
elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then
|
||||
: # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch"
|
||||
else
|
||||
echo "On system '$system' only specific '-arch' values are expected."
|
||||
echo "It is taken from the 'CFLAGS' whose value is:"
|
||||
echo "$cflags"
|
||||
echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT"
|
||||
exit 1
|
||||
fi ;;
|
||||
esac # "$cflag_arch"
|
||||
;;
|
||||
esac # $system
|
||||
fi
|
||||
|
||||
# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence.
|
||||
if [ x"$PLATFORM" != x"" ] ; then
|
||||
:
|
||||
else
|
||||
PLATFORM="$system-$machine"
|
||||
fi
|
||||
|
||||
|
0
sql-bench/README
Executable file → Normal file
0
sql-bench/README
Executable file → Normal file
@ -2027,6 +2027,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
||||
(!mysql->options.protocol ||
|
||||
mysql->options.protocol == MYSQL_PROTOCOL_TCP))
|
||||
{
|
||||
int status= -1;
|
||||
unix_socket=0; /* This is not used */
|
||||
if (!port)
|
||||
port=mysql_port;
|
||||
@ -2052,6 +2053,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
||||
net->vio= vio_new(sock, VIO_TYPE_TCPIP, VIO_BUFFERED_READ);
|
||||
bzero((char*) &sock_addr,sizeof(sock_addr));
|
||||
sock_addr.sin_family = AF_INET;
|
||||
sock_addr.sin_port = (ushort) htons((ushort) port);
|
||||
|
||||
/*
|
||||
The server name may be a host name or IP address
|
||||
@ -2060,28 +2062,46 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
||||
if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE)
|
||||
{
|
||||
memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr));
|
||||
status= my_connect(sock, (struct sockaddr *) &sock_addr,
|
||||
sizeof(sock_addr), mysql->options.connect_timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
int tmp_errno;
|
||||
int i, tmp_errno;
|
||||
struct hostent tmp_hostent,*hp;
|
||||
char buff2[GETHOSTBYNAME_BUFF_SIZE];
|
||||
hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
|
||||
&tmp_errno);
|
||||
if (!hp)
|
||||
|
||||
/*
|
||||
Don't attempt to connect to non IPv4 addresses as the client could
|
||||
end up sending information to a unknown server. For example, a IPv6
|
||||
address might be returned from gethostbyname depending on options
|
||||
set via the RES_OPTIONS environment variable.
|
||||
*/
|
||||
if (!hp || (hp->h_addrtype != AF_INET))
|
||||
{
|
||||
my_gethostbyname_r_free();
|
||||
set_mysql_extended_error(mysql, CR_UNKNOWN_HOST, unknown_sqlstate,
|
||||
ER(CR_UNKNOWN_HOST), host, tmp_errno);
|
||||
goto error;
|
||||
}
|
||||
memcpy(&sock_addr.sin_addr, hp->h_addr,
|
||||
|
||||
for (i= 0; status && hp->h_addr_list[i]; i++)
|
||||
{
|
||||
IF_DBUG(char ipaddr[18];)
|
||||
memcpy(&sock_addr.sin_addr, hp->h_addr_list[i],
|
||||
min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length));
|
||||
DBUG_PRINT("info",("Trying %s...",
|
||||
(my_inet_ntoa(sock_addr.sin_addr, ipaddr), ipaddr)));
|
||||
status= my_connect(sock, (struct sockaddr *) &sock_addr,
|
||||
sizeof(sock_addr), mysql->options.connect_timeout);
|
||||
}
|
||||
|
||||
my_gethostbyname_r_free();
|
||||
}
|
||||
sock_addr.sin_port = (ushort) htons((ushort) port);
|
||||
if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
|
||||
mysql->options.connect_timeout))
|
||||
|
||||
if (status)
|
||||
{
|
||||
DBUG_PRINT("error",("Got error %d on connect to '%s'",socket_errno,
|
||||
host));
|
||||
|
@ -171,7 +171,7 @@ mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
|
||||
|
||||
DEFS = -DMYSQL_SERVER \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
|
||||
-DPLUGINDIR="\"$(pkgplugindir)\"" \
|
||||
-DHAVE_EVENT_SCHEDULER \
|
||||
|
@ -1430,13 +1430,7 @@ Event_job_data::execute(THD *thd, bool drop)
|
||||
thd->variables.sql_mode= sql_mode;
|
||||
thd->variables.time_zone= time_zone;
|
||||
|
||||
/*
|
||||
Peculiar initialization order is a crutch to avoid races in SHOW
|
||||
PROCESSLIST which reads thd->{query/query_length} without a mutex.
|
||||
*/
|
||||
thd->query_length= 0;
|
||||
thd->query= sp_sql.c_ptr_safe();
|
||||
thd->query_length= sp_sql.length();
|
||||
thd->set_query(sp_sql.c_ptr_safe(), sp_sql.length());
|
||||
|
||||
{
|
||||
Parser_state parser_state(thd, thd->query, thd->query_length);
|
||||
@ -1497,13 +1491,8 @@ end_no_lex_start:
|
||||
else
|
||||
{
|
||||
ulong saved_master_access;
|
||||
/*
|
||||
Peculiar initialization order is a crutch to avoid races in SHOW
|
||||
PROCESSLIST which reads thd->{query/query_length} without a mutex.
|
||||
*/
|
||||
thd->query_length= 0;
|
||||
thd->query= sp_sql.c_ptr_safe();
|
||||
thd->query_length= sp_sql.length();
|
||||
|
||||
thd->set_query(sp_sql.c_ptr_safe(), sp_sql.length());
|
||||
|
||||
/*
|
||||
NOTE: even if we run in read-only mode, we should be able to lock
|
||||
@ -1528,8 +1517,7 @@ end_no_lex_start:
|
||||
thd->end_statement();
|
||||
thd->cleanup_after_query();
|
||||
/* Avoid races with SHOW PROCESSLIST */
|
||||
thd->query_length= 0;
|
||||
thd->query= NULL;
|
||||
thd->set_query(NULL, 0);
|
||||
|
||||
DBUG_PRINT("info", ("EXECUTED %s.%s ret: %d", dbname.str, name.str, ret));
|
||||
|
||||
|
@ -158,6 +158,7 @@ deinit_event_thread(THD *thd)
|
||||
thread_count--;
|
||||
thread_running--;
|
||||
delete thd;
|
||||
pthread_cond_broadcast(&COND_thread_count);
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
}
|
||||
|
||||
@ -418,6 +419,7 @@ Event_scheduler::start()
|
||||
thread_count--;
|
||||
thread_running--;
|
||||
delete new_thd;
|
||||
pthread_cond_broadcast(&COND_thread_count);
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
}
|
||||
end:
|
||||
@ -550,6 +552,7 @@ error:
|
||||
thread_count--;
|
||||
thread_running--;
|
||||
delete new_thd;
|
||||
pthread_cond_broadcast(&COND_thread_count);
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
}
|
||||
delete event_name;
|
||||
@ -625,13 +628,13 @@ Event_scheduler::stop()
|
||||
DBUG_PRINT("info", ("Scheduler thread has id %lu",
|
||||
scheduler_thd->thread_id));
|
||||
/* Lock from delete */
|
||||
pthread_mutex_lock(&scheduler_thd->LOCK_delete);
|
||||
pthread_mutex_lock(&scheduler_thd->LOCK_thd_data);
|
||||
/* This will wake up the thread if it waits on Queue's conditional */
|
||||
sql_print_information("Event Scheduler: Killing the scheduler thread, "
|
||||
"thread id %lu",
|
||||
scheduler_thd->thread_id);
|
||||
scheduler_thd->awake(THD::KILL_CONNECTION);
|
||||
pthread_mutex_unlock(&scheduler_thd->LOCK_delete);
|
||||
pthread_mutex_unlock(&scheduler_thd->LOCK_thd_data);
|
||||
|
||||
/* thd could be 0x0, when shutting down */
|
||||
sql_print_information("Event Scheduler: "
|
||||
|
@ -852,22 +852,23 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Inits the scheduler's structures.
|
||||
/**
|
||||
Initializes the scheduler's structures.
|
||||
|
||||
SYNOPSIS
|
||||
Events::init()
|
||||
@param opt_noacl_or_bootstrap
|
||||
TRUE if there is --skip-grant-tables or --bootstrap
|
||||
option. In that case we disable the event scheduler.
|
||||
|
||||
NOTES
|
||||
This function is not synchronized.
|
||||
@note This function is not synchronized.
|
||||
|
||||
RETURN VALUE
|
||||
FALSE OK
|
||||
TRUE Error in case the scheduler can't start
|
||||
@retval FALSE Perhaps there was an error, and the event scheduler
|
||||
is disabled. But the error is not fatal and the
|
||||
server start up can continue.
|
||||
@retval TRUE Fatal error. Startup must terminate (call unireg_abort()).
|
||||
*/
|
||||
|
||||
bool
|
||||
Events::init(my_bool opt_noacl)
|
||||
Events::init(my_bool opt_noacl_or_bootstrap)
|
||||
{
|
||||
|
||||
THD *thd;
|
||||
@ -875,11 +876,6 @@ Events::init(my_bool opt_noacl)
|
||||
|
||||
DBUG_ENTER("Events::init");
|
||||
|
||||
/* Disable the scheduler if running with --skip-grant-tables */
|
||||
if (opt_noacl)
|
||||
opt_event_scheduler= EVENTS_DISABLED;
|
||||
|
||||
|
||||
/* We need a temporary THD during boot */
|
||||
if (!(thd= new THD()))
|
||||
{
|
||||
@ -908,23 +904,30 @@ Events::init(my_bool opt_noacl)
|
||||
/*
|
||||
Since we allow event DDL even if the scheduler is disabled,
|
||||
check the system tables, as we might need them.
|
||||
|
||||
If run with --skip-grant-tables or --bootstrap, don't try to do the
|
||||
check of system tables and don't complain: in these modes the tables
|
||||
are most likely not there and we're going to disable the event
|
||||
scheduler anyway.
|
||||
*/
|
||||
if (Event_db_repository::check_system_tables(thd))
|
||||
if (opt_noacl_or_bootstrap || Event_db_repository::check_system_tables(thd))
|
||||
{
|
||||
if (! opt_noacl_or_bootstrap)
|
||||
{
|
||||
sql_print_error("Event Scheduler: An error occurred when initializing "
|
||||
"system tables.%s",
|
||||
opt_event_scheduler == EVENTS_DISABLED ?
|
||||
"" : " Disabling the Event Scheduler.");
|
||||
"system tables. Disabling the Event Scheduler.");
|
||||
check_system_tables_error= TRUE;
|
||||
}
|
||||
|
||||
/* Disable the scheduler since the system tables are not up to date */
|
||||
opt_event_scheduler= EVENTS_DISABLED;
|
||||
check_system_tables_error= TRUE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
Was disabled explicitly from the command line, or because we're running
|
||||
with --skip-grant-tables, or because we have no system tables.
|
||||
with --skip-grant-tables, or --bootstrap, or because we have no system
|
||||
tables.
|
||||
*/
|
||||
if (opt_event_scheduler == Events::EVENTS_DISABLED)
|
||||
goto end;
|
||||
@ -941,7 +944,7 @@ Events::init(my_bool opt_noacl)
|
||||
}
|
||||
|
||||
if (event_queue->init_queue(thd) || load_events_from_db(thd) ||
|
||||
opt_event_scheduler == EVENTS_ON && scheduler->start())
|
||||
(opt_event_scheduler == EVENTS_ON && scheduler->start()))
|
||||
{
|
||||
sql_print_error("Event Scheduler: Error while loading from disk.");
|
||||
res= TRUE; /* fatal error: request unireg_abort */
|
||||
|
40
sql/field.cc
40
sql/field.cc
@ -4598,7 +4598,6 @@ bool Field_double::send_binary(Protocol *protocol)
|
||||
|
||||
int Field_double::cmp(const uchar *a_ptr, const uchar *b_ptr)
|
||||
{
|
||||
ASSERT_COLUMN_MARKED_FOR_READ;
|
||||
double a,b;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
if (table->s->db_low_byte_first)
|
||||
@ -6271,48 +6270,15 @@ check_string_copy_error(Field_str *field,
|
||||
const char *end,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
const char *pos, *end_orig;
|
||||
char tmp[64], *t;
|
||||
const char *pos;
|
||||
char tmp[32];
|
||||
|
||||
if (!(pos= well_formed_error_pos) &&
|
||||
!(pos= cannot_convert_error_pos))
|
||||
return FALSE;
|
||||
|
||||
end_orig= end;
|
||||
set_if_smaller(end, pos + 6);
|
||||
convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6);
|
||||
|
||||
for (t= tmp; pos < end; pos++)
|
||||
{
|
||||
/*
|
||||
If the source string is ASCII compatible (mbminlen==1)
|
||||
and the source character is in ASCII printable range (0x20..0x7F),
|
||||
then display the character as is.
|
||||
|
||||
Otherwise, if the source string is not ASCII compatible (e.g. UCS2),
|
||||
or the source character is not in the printable range,
|
||||
then print the character using HEX notation.
|
||||
*/
|
||||
if (((unsigned char) *pos) >= 0x20 &&
|
||||
((unsigned char) *pos) <= 0x7F &&
|
||||
cs->mbminlen == 1)
|
||||
{
|
||||
*t++= *pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
*t++= '\\';
|
||||
*t++= 'x';
|
||||
*t++= _dig_vec_upper[((unsigned char) *pos) >> 4];
|
||||
*t++= _dig_vec_upper[((unsigned char) *pos) & 15];
|
||||
}
|
||||
}
|
||||
if (end_orig > end)
|
||||
{
|
||||
*t++= '.';
|
||||
*t++= '.';
|
||||
*t++= '.';
|
||||
}
|
||||
*t= '\0';
|
||||
push_warning_printf(field->table->in_use,
|
||||
field->table->in_use->abort_on_warning ?
|
||||
MYSQL_ERROR::WARN_LEVEL_ERROR :
|
||||
|
@ -253,8 +253,7 @@ static void run_query(THD *thd, char *buf, char *end,
|
||||
const char* found_semicolon= NULL;
|
||||
|
||||
bzero((char*) &thd->net, sizeof(NET));
|
||||
thd->query_length= end - buf;
|
||||
thd->query= buf;
|
||||
thd->set_query(buf, (uint) (end - buf));
|
||||
thd->variables.pseudo_thread_id= thread_id;
|
||||
thd->transaction.stmt.modified_non_trans_table= FALSE;
|
||||
if (disable_binlog)
|
||||
@ -297,8 +296,7 @@ static void run_query(THD *thd, char *buf, char *end,
|
||||
thd->main_da.reset_diagnostics_area();
|
||||
|
||||
thd->options= save_thd_options;
|
||||
thd->query_length= save_thd_query_length;
|
||||
thd->query= save_thd_query;
|
||||
thd->set_query(save_thd_query, save_thd_query_length);
|
||||
thd->variables.pseudo_thread_id= save_thread_id;
|
||||
thd->status_var= save_thd_status_var;
|
||||
thd->transaction.all= save_thd_transaction_all;
|
||||
@ -3755,7 +3753,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
|
||||
if (ndbcluster_terminating)
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_server_started);
|
||||
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -423,12 +423,9 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
|
||||
|
||||
int ha_partition::delete_table(const char *name)
|
||||
{
|
||||
int error;
|
||||
DBUG_ENTER("ha_partition::delete_table");
|
||||
|
||||
if ((error= del_ren_cre_table(name, NULL, NULL, NULL)))
|
||||
DBUG_RETURN(error);
|
||||
DBUG_RETURN(handler::delete_table(name));
|
||||
DBUG_RETURN(del_ren_cre_table(name, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
|
||||
@ -456,12 +453,9 @@ int ha_partition::delete_table(const char *name)
|
||||
|
||||
int ha_partition::rename_table(const char *from, const char *to)
|
||||
{
|
||||
int error;
|
||||
DBUG_ENTER("ha_partition::rename_table");
|
||||
|
||||
if ((error= del_ren_cre_table(from, to, NULL, NULL)))
|
||||
DBUG_RETURN(error);
|
||||
DBUG_RETURN(handler::rename_table(from, to));
|
||||
DBUG_RETURN(del_ren_cre_table(from, to, NULL, NULL));
|
||||
}
|
||||
|
||||
|
||||
@ -1807,6 +1801,15 @@ uint ha_partition::del_ren_cre_table(const char *from,
|
||||
DBUG_PRINT("enter", ("from: (%s) to: (%s)", from, to));
|
||||
name_buffer_ptr= m_name_buffer_ptr;
|
||||
file= m_file;
|
||||
if (to == NULL && table_arg == NULL)
|
||||
{
|
||||
/*
|
||||
Delete table, start by delete the .par file. If error, break, otherwise
|
||||
delete as much as possible.
|
||||
*/
|
||||
if ((error= handler::delete_table(from)))
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
/*
|
||||
Since ha_partition has HA_FILE_BASED, it must alter underlying table names
|
||||
if they do not have HA_FILE_BASED and lower_case_table_names == 2.
|
||||
@ -1828,6 +1831,8 @@ uint ha_partition::del_ren_cre_table(const char *from,
|
||||
create_partition_name(to_buff, to_path, name_buffer_ptr,
|
||||
NORMAL_PART_NAME, FALSE);
|
||||
error= (*file)->ha_rename_table(from_buff, to_buff);
|
||||
if (error)
|
||||
goto rename_error;
|
||||
}
|
||||
else if (table_arg == NULL) // delete branch
|
||||
error= (*file)->ha_delete_table(from_buff);
|
||||
@ -1843,6 +1848,15 @@ uint ha_partition::del_ren_cre_table(const char *from,
|
||||
save_error= error;
|
||||
i++;
|
||||
} while (*(++file));
|
||||
if (to != NULL)
|
||||
{
|
||||
if ((error= handler::rename_table(from, to)))
|
||||
{
|
||||
/* Try to revert everything, ignore errors */
|
||||
(void) handler::rename_table(to, from);
|
||||
goto rename_error;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(save_error);
|
||||
create_error:
|
||||
name_buffer_ptr= m_name_buffer_ptr;
|
||||
@ -1850,7 +1864,21 @@ create_error:
|
||||
{
|
||||
create_partition_name(from_buff, from_path, name_buffer_ptr, NORMAL_PART_NAME,
|
||||
FALSE);
|
||||
VOID((*file)->ha_delete_table((const char*) from_buff));
|
||||
(void) (*file)->ha_delete_table((const char*) from_buff);
|
||||
name_buffer_ptr= strend(name_buffer_ptr) + 1;
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
rename_error:
|
||||
name_buffer_ptr= m_name_buffer_ptr;
|
||||
for (abort_file= file, file= m_file; file < abort_file; file++)
|
||||
{
|
||||
/* Revert the rename, back from 'to' to the original 'from' */
|
||||
create_partition_name(from_buff, from_path, name_buffer_ptr,
|
||||
NORMAL_PART_NAME, FALSE);
|
||||
create_partition_name(to_buff, to_path, name_buffer_ptr,
|
||||
NORMAL_PART_NAME, FALSE);
|
||||
/* Ignore error here */
|
||||
(void) (*file)->ha_rename_table(to_buff, from_buff);
|
||||
name_buffer_ptr= strend(name_buffer_ptr) + 1;
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
@ -3702,7 +3730,7 @@ int ha_partition::index_init(uint inx, bool sorted)
|
||||
*/
|
||||
if (m_lock_type == F_WRLCK)
|
||||
bitmap_union(table->read_set, &m_part_info->full_part_field_set);
|
||||
else if (sorted)
|
||||
if (sorted)
|
||||
{
|
||||
/*
|
||||
An ordered scan is requested. We must make sure all fields of the
|
||||
@ -5386,6 +5414,13 @@ int ha_partition::extra(enum ha_extra_function operation)
|
||||
/* Currently only NDB use the *_CANNOT_BATCH */
|
||||
break;
|
||||
}
|
||||
/*
|
||||
http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations.html
|
||||
says we no longer support logging to partitioned tables, so we fail
|
||||
here.
|
||||
*/
|
||||
case HA_EXTRA_MARK_AS_LOG_TABLE:
|
||||
DBUG_RETURN(ER_UNSUPORTED_LOG_ENGINE);
|
||||
default:
|
||||
{
|
||||
/* Temporary crash to discover what is wrong */
|
||||
|
@ -63,7 +63,9 @@ static const LEX_STRING sys_table_aliases[]=
|
||||
};
|
||||
|
||||
const char *ha_row_type[] = {
|
||||
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
|
||||
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT",
|
||||
/* Reserved to be "PAGE" in future versions */ "?",
|
||||
"?","?","?"
|
||||
};
|
||||
|
||||
const char *tx_isolation_names[] =
|
||||
@ -343,6 +345,7 @@ int ha_init_errors(void)
|
||||
SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY));
|
||||
SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED));
|
||||
SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE));
|
||||
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER(ER_TOO_MANY_CONCURRENT_TRXS));
|
||||
|
||||
/* Register the error messages for use with my_error(). */
|
||||
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
|
||||
@ -2748,6 +2751,9 @@ void handler::print_error(int error, myf errflag)
|
||||
case HA_ERR_AUTOINC_ERANGE:
|
||||
textno= ER_WARN_DATA_OUT_OF_RANGE;
|
||||
break;
|
||||
case HA_ERR_TOO_MANY_CONCURRENT_TRXS:
|
||||
textno= ER_TOO_MANY_CONCURRENT_TRXS;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
/* The error was "unknown" to this function.
|
||||
@ -2974,6 +2980,7 @@ uint handler::get_dup_key(int error)
|
||||
*/
|
||||
int handler::delete_table(const char *name)
|
||||
{
|
||||
int saved_error= 0;
|
||||
int error= 0;
|
||||
int enoent_or_zero= ENOENT; // Error if no file was deleted
|
||||
char buff[FN_REFLEN];
|
||||
@ -2983,21 +2990,31 @@ int handler::delete_table(const char *name)
|
||||
fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT);
|
||||
if (my_delete_with_symlink(buff, MYF(0)))
|
||||
{
|
||||
if ((error= my_errno) != ENOENT)
|
||||
break;
|
||||
if (my_errno != ENOENT)
|
||||
{
|
||||
/*
|
||||
If error on the first existing file, return the error.
|
||||
Otherwise delete as much as possible.
|
||||
*/
|
||||
if (enoent_or_zero)
|
||||
return my_errno;
|
||||
saved_error= my_errno;
|
||||
}
|
||||
}
|
||||
else
|
||||
enoent_or_zero= 0; // No error for ENOENT
|
||||
error= enoent_or_zero;
|
||||
}
|
||||
return error;
|
||||
return saved_error ? saved_error : error;
|
||||
}
|
||||
|
||||
|
||||
int handler::rename_table(const char * from, const char * to)
|
||||
{
|
||||
int error= 0;
|
||||
for (const char **ext= bas_ext(); *ext ; ext++)
|
||||
const char **ext, **start_ext;
|
||||
start_ext= bas_ext();
|
||||
for (ext= start_ext; *ext ; ext++)
|
||||
{
|
||||
if (rename_file_ext(from, to, *ext))
|
||||
{
|
||||
@ -3006,6 +3023,12 @@ int handler::rename_table(const char * from, const char * to)
|
||||
error= 0;
|
||||
}
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
/* Try to revert the rename. Ignore errors. */
|
||||
for (; ext >= start_ext; ext--)
|
||||
rename_file_ext(to, from, *ext);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,9 @@ enum legacy_db_type
|
||||
|
||||
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
|
||||
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
|
||||
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
|
||||
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT,
|
||||
/** Unused. Reserved for future versions. */
|
||||
ROW_TYPE_PAGE };
|
||||
|
||||
enum enum_binlog_func {
|
||||
BFN_RESET_LOGS= 1,
|
||||
@ -323,7 +325,9 @@ enum enum_binlog_command {
|
||||
#define HA_CREATE_USED_PASSWORD (1L << 17)
|
||||
#define HA_CREATE_USED_CONNECTION (1L << 18)
|
||||
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
|
||||
/** Unused. Reserved for future versions. */
|
||||
#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
|
||||
/** Unused. Reserved for future versions. */
|
||||
#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
|
||||
|
||||
typedef ulonglong my_xid; // this line is the same as in log_event.h
|
||||
@ -914,13 +918,14 @@ typedef struct st_ha_create_information
|
||||
uint options; /* OR of HA_CREATE_ options */
|
||||
uint merge_insert_method;
|
||||
uint extra_size; /* length of extra data segment */
|
||||
/* 0 not used, 1 if not transactional, 2 if transactional */
|
||||
/** Transactional or not. Unused; reserved for future versions. */
|
||||
enum ha_choice transactional;
|
||||
bool table_existed; /* 1 in create if table existed */
|
||||
bool frm_only; /* 1 if no ha_create_table() */
|
||||
bool varchar; /* 1 if table has a VARCHAR */
|
||||
enum ha_storage_media storage_media; /* DEFAULT, DISK or MEMORY */
|
||||
enum ha_choice page_checksum; /* If we have page_checksums */
|
||||
/** Per-page checksums or not. Unused; reserved for future versions. */
|
||||
enum ha_choice page_checksum;
|
||||
} HA_CREATE_INFO;
|
||||
|
||||
|
||||
|
@ -599,6 +599,7 @@ bool Item_ident::remove_dependence_processor(uchar * arg)
|
||||
DBUG_ENTER("Item_ident::remove_dependence_processor");
|
||||
if (depended_from == (st_select_lex *) arg)
|
||||
depended_from= 0;
|
||||
context= &((st_select_lex *) arg)->context;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -5990,6 +5990,9 @@ Item_func_sp::execute_impl(THD *thd)
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
Security_context *save_security_ctx= thd->security_ctx;
|
||||
#endif
|
||||
enum enum_sp_data_access access=
|
||||
(m_sp->m_chistics->daccess == SP_DEFAULT_ACCESS) ?
|
||||
SP_DEFAULT_ACCESS_MAPPING : m_sp->m_chistics->daccess;
|
||||
|
||||
DBUG_ENTER("Item_func_sp::execute_impl");
|
||||
|
||||
@ -6007,11 +6010,13 @@ Item_func_sp::execute_impl(THD *thd)
|
||||
Throw an error if a non-deterministic function is called while
|
||||
statement-based replication (SBR) is active.
|
||||
*/
|
||||
|
||||
if (!m_sp->m_chistics->detistic && !trust_function_creators &&
|
||||
(access == SP_CONTAINS_SQL || access == SP_MODIFIES_SQL_DATA) &&
|
||||
(mysql_bin_log.is_open() &&
|
||||
thd->variables.binlog_format == BINLOG_FORMAT_STMT))
|
||||
{
|
||||
my_error(ER_BINLOG_ROW_RBR_TO_SBR, MYF(0));
|
||||
my_error(ER_BINLOG_UNSAFE_ROUTINE, MYF(0));
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -1519,6 +1519,7 @@ public:
|
||||
ft_handler->please->close_search(ft_handler);
|
||||
ft_handler= 0;
|
||||
concat_ws= 0;
|
||||
table= 0; // required by Item_func_match::eq()
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
enum Functype functype() const { return FT_FUNC; }
|
||||
|
@ -1227,6 +1227,10 @@ Item_in_subselect::single_value_transformer(JOIN *join,
|
||||
else
|
||||
{
|
||||
// it is single select without tables => possible optimization
|
||||
// remove the dependence mark since the item is moved to upper
|
||||
// select and is not outer anymore.
|
||||
item->walk(&Item::remove_dependence_processor, 0,
|
||||
(uchar *) select_lex->outer_select());
|
||||
item= func->create(left_expr, item);
|
||||
// fix_field of item will be done in time of substituting
|
||||
substitution= item;
|
||||
|
@ -387,7 +387,6 @@ static SYMBOL symbols[] = {
|
||||
{ "PACK_KEYS", SYM(PACK_KEYS_SYM)},
|
||||
{ "PARSER", SYM(PARSER_SYM)},
|
||||
{ "PAGE", SYM(PAGE_SYM)},
|
||||
{ "PAGE_CHECKSUM", SYM(PAGE_CHECKSUM_SYM)},
|
||||
{ "PARTIAL", SYM(PARTIAL)},
|
||||
{ "PARTITION", SYM(PARTITION_SYM)},
|
||||
{ "PARTITIONING", SYM(PARTITIONING_SYM)},
|
||||
@ -543,7 +542,6 @@ static SYMBOL symbols[] = {
|
||||
{ "TO", SYM(TO_SYM)},
|
||||
{ "TRAILING", SYM(TRAILING)},
|
||||
{ "TRANSACTION", SYM(TRANSACTION_SYM)},
|
||||
{ "TRANSACTIONAL", SYM(TRANSACTIONAL_SYM)},
|
||||
{ "TRIGGER", SYM(TRIGGER_SYM)},
|
||||
{ "TRIGGERS", SYM(TRIGGERS_SYM)},
|
||||
{ "TRUE", SYM(TRUE_SYM)},
|
||||
|
48
sql/log.cc
48
sql/log.cc
@ -1564,25 +1564,15 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
|
||||
YESNO(all),
|
||||
YESNO(thd->transaction.all.modified_non_trans_table),
|
||||
YESNO(thd->transaction.stmt.modified_non_trans_table)));
|
||||
if ((all && thd->transaction.all.modified_non_trans_table) ||
|
||||
(!all && thd->transaction.stmt.modified_non_trans_table &&
|
||||
!mysql_bin_log.check_write_error(thd)) ||
|
||||
((thd->options & OPTION_KEEP_LOG) &&
|
||||
!mysql_bin_log.check_write_error(thd)))
|
||||
if (mysql_bin_log.check_write_error(thd))
|
||||
{
|
||||
/*
|
||||
We write the transaction cache with a rollback last if we have
|
||||
modified any non-transactional table. We do this even if we are
|
||||
committing a single statement that has modified a
|
||||
non-transactional table since it can have modified a
|
||||
transactional table in that statement as well, which needs to be
|
||||
rolled back on the slave.
|
||||
"all == true" means that a "rollback statement" triggered the error and
|
||||
this function was called. However, this must not happen as a rollback
|
||||
is written directly to the binary log. And in auto-commit mode, a single
|
||||
statement that is rolled back has the flag all == false.
|
||||
*/
|
||||
Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, TRUE, 0);
|
||||
error= binlog_end_trans(thd, trx_data, &qev, all);
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_ASSERT(!all);
|
||||
/*
|
||||
We reach this point if either only transactional tables were modified or
|
||||
the effect of a statement that did not get into the binlog needs to be
|
||||
@ -1599,6 +1589,32 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
|
||||
trx_data->set_incident();
|
||||
error= binlog_end_trans(thd, trx_data, 0, all);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
We flush the cache with a rollback, wrapped in a beging/rollback if:
|
||||
. aborting a transcation that modified a non-transactional table or;
|
||||
. aborting a statement that modified both transactional and
|
||||
non-transctional tables but which is not in the boundaries of any
|
||||
transaction;
|
||||
. the OPTION_KEEP_LOG is activate.
|
||||
*/
|
||||
if ((all && thd->transaction.all.modified_non_trans_table) ||
|
||||
(!all && thd->transaction.stmt.modified_non_trans_table &&
|
||||
!(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) ||
|
||||
((thd->options & OPTION_KEEP_LOG)))
|
||||
{
|
||||
Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, TRUE, 0);
|
||||
error= binlog_end_trans(thd, trx_data, &qev, all);
|
||||
}
|
||||
/*
|
||||
Otherwise, we simply truncate the cache as there is no change on
|
||||
non-transactional tables as follows.
|
||||
*/
|
||||
else if ((all && !thd->transaction.all.modified_non_trans_table) ||
|
||||
(!all && !thd->transaction.stmt.modified_non_trans_table))
|
||||
error= binlog_end_trans(thd, trx_data, 0, all);
|
||||
}
|
||||
if (!all)
|
||||
trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback
|
||||
DBUG_RETURN(error);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user